// $Id$
//
-// Copyright (C) 2007
-// Fraunhofer Institute for Open Communication Systems (FOKUS)
-// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
/** \file
\brief IOEvent public header */
-#ifndef HH_IOEvent_
-#define HH_IOEvent_ 1
+#ifndef HH_SENF_PPI_IOEvent_
+#define HH_SENF_PPI_IOEvent_ 1
// Custom includes
#include "../Scheduler/Scheduler.hh"
#include "Events.hh"
+#include "../Utils/Exception.hh"
//#include "IOEvent.mpp"
///////////////////////////////hh.p////////////////////////////////////////
// with the enumeration symbols
enum EventFlags {
- Read = Scheduler::EV_READ /**< FileHandle is readable */
- , Prio = Scheduler::EV_PRIO /**< FileHandle priority data is readable */
- , Write = Scheduler::EV_WRITE /**< FileHandle is writable */
- , Hup = Scheduler::EV_HUP /**< Hangup condition on FileHandle */
- , Err = Scheduler::EV_ERR /**< Some other error condition on FileHandle */
+ Read = scheduler::FdEvent::EV_READ /**< FileHandle is readable */
+ , Prio = scheduler::FdEvent::EV_PRIO /**< FileHandle priority data is readable */
+ , Write = scheduler::FdEvent::EV_WRITE /**< FileHandle is writable */
+ , Hup = scheduler::FdEvent::EV_HUP /**< Hangup condition on FileHandle */
+ , Err = scheduler::FdEvent::EV_ERR /**< Some other error condition on FileHandle */
};
///////////////////////////////////////////////////////////////////////////
///\name Structors and default members
///@{
+ IOEvent();
+
template <class Handle>
IOEvent(Handle handle, unsigned events);
///@}
///////////////////////////////////////////////////////////////////////////
+ template <class Handle>
+ void set(Handle handle, unsigned events);
+
/** \brief Unhandled error condition */
- struct ErrorException : public std::exception
- { virtual char const * what() const throw()
- { return "senf::ppi::IOEvent::ErrorException"; } };
+ struct ErrorException : public senf::Exception
+ { ErrorException() : senf::Exception("senf::ppi::IOEvent::ErrorException"){} };
/** \brief Unhandled hangup condition */
- struct HangupException : public std::exception
- { virtual char const * what() const throw()
- { return "senf::ppi::IOEvent::HangupException"; } };
+ struct HangupException : public senf::Exception
+ { HangupException() : senf::Exception("senf::ppi::IOEvent::HangupException"){} };
protected:
private:
virtual void v_enable();
- virtual void v_disable();
+ virtual void v_disable();
- void cb(Scheduler::EventId event);
+ void cb(int event);
int fd_;
- unsigned events_;
+ scheduler::FdEvent event_;
};
}}
///////////////////////////////hh.e////////////////////////////////////////
-//#include "IOEvent.cci"
-//#include "IOEvent.ct"
+#include "IOEvent.cci"
+#include "IOEvent.ct"
#include "IOEvent.cti"
#endif