#define HH_IOEvent_ 1
// Custom includes
-#include "Events.hh"
#include "Scheduler/Scheduler.hh"
+#include "Events.hh"
//#include "IOEvent.mpp"
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
namespace ppi {
+ /** \brief IOEvent event information
+
+ Information passed to the IOEvent event handler
+ */
struct IOEventInfo
{
- unsigned events;
+ unsigned events; ///< Type of event signaled
+ /**< The value is a combination of the flags from
+ IOEvent::EventFlags */
};
- /** \brief
+ /** \brief FileHandle based I/O read/write event
+
+ An IOEvent is signaled, whenever the FileHandle \a handle becomes readable or writable. The
+ type of event is specified using the \a events mask with values from EventFlags.
- \fixme Implement error/EOF handling
+ \see IOEventInfo
+
+ \ingroup event_group
*/
class IOEvent
: public EventImplementation<IOEventInfo>
///////////////////////////////////////////////////////////////////////////
// Types
+ // This is stupid, however there is no way to import the Scheduler::EventId enum together
+ // with the enumeration symbols
+
enum EventFlags { Read = Scheduler::EV_READ,
- Write = Scheduler::EV_WRITE };
+ Prio = Scheduler::EV_PRIO,
+ Write = Scheduler::EV_WRITE,
+ Hup = Scheduler::EV_HUP,
+ Err = Scheduler::EV_ERR };
///////////////////////////////////////////////////////////////////////////
///\name Structors and default members
///@}
///////////////////////////////////////////////////////////////////////////
+ /** \brief Unhandled error condition */
+ struct ErrorException : public std::exception
+ { virtual char const * what() const throw()
+ { return "senf::ppi::IOEvent::ErrorException"; } };
+
+ /** \brief Unhandled hangup condition */
+ struct HangupException : public std::exception
+ { virtual char const * what() const throw()
+ { return "senf::ppi::IOEvent::HangupException"; } };
+
protected:
private:
virtual void v_enable();
- virtual void v_disable();
+ virtual void v_disable();
void cb(int, Scheduler::EventId event);