senf::ppi::IOEvent Class Reference

FileHandle based I/O read/write event. More...

#include <senf/PPI/IOEvent.hh>

Inheritance diagram for senf::ppi::IOEvent:

Classes

struct  ErrorException
 Unhandled error condition. More...
 
struct  HangupException
 Unhandled hangup condition. More...
 

Public Types

enum  EventFlags {
  Read = scheduler::FdEvent::EV_READ, Prio = scheduler::FdEvent::EV_PRIO, Write = scheduler::FdEvent::EV_WRITE, Hup = scheduler::FdEvent::EV_HUP,
  Err = scheduler::FdEvent::EV_ERR
}
 
- Public Types inherited from senf::ppi::EventImplementation< IOEventInfo >
typedef IOEventInfo Event
 
typedef detail::EventArgType< IOEventInfo >::type EventArg
 

Public Member Functions

template<class Handle >
void set (Handle handle, unsigned events)
 
- Public Member Functions inherited from senf::ppi::EventImplementation< IOEventInfo >
module::Modulemodule () const
 Module in which the event is registered. More...
 
EventManagermanager () const
 EventManager of the event. More...
 
- Public Member Functions inherited from senf::ppi::EventDescriptor
virtual ~EventDescriptor ()
 
bool enabled () const
 Check, whether the event is currently enabled. More...
 
void enabled (bool v)
 Enable or disable the event. More...
 

Structors and default members

 IOEvent ()
 
template<class Handle >
 IOEvent (Handle handle, unsigned events)
 

Additional Inherited Members

- Protected Types inherited from senf::ppi::EventImplementationHelper< EventType, Self >
typedef detail::EventArgType< EventType >::type EventArg
 
- Protected Member Functions inherited from senf::ppi::EventImplementation< IOEventInfo >
 EventImplementation ()
 
- Protected Member Functions inherited from senf::ppi::EventDescriptor
 EventDescriptor ()
 
- Protected Member Functions inherited from senf::ppi::EventImplementationHelper< EventType, Self >
void callback (EventArg event, ClockService::clock_type time)
 Forward event to user callback. More...
 
void callback (EventArg event)
 Forward event to user callback. More...
 

Detailed Description

FileHandle based I/O read/write event.

An IOEvent is signaled, whenever the FileHandle handle becomes readable or writable. The type of event is specified using the events mask with values from EventFlags.

There are two types of flags:

  • Event flags (Read, Prio, Write) specify the type of event. The callback will be called whenever one of the specified events occurs on the filehandle
  • Error flags (Hup, Err) specify some type of error condition on the filehandle. If you specify an error flag when registering the event, the error condition will be passed to the callback, otherwise an ErrorException or HangupException will be thrown.
See also
IOEventInfo

Definition at line 61 of file IOEvent.hh.

Member Enumeration Documentation

◆ EventFlags

Enumerator
Read 

FileHandle is readable

Prio 

FileHandle priority data is readable

Write 

FileHandle is writable

Hup 

Hangup condition on FileHandle

Err 

Some other error condition on FileHandle

Definition at line 71 of file IOEvent.hh.

Constructor & Destructor Documentation

◆ IOEvent() [1/2]

senf::ppi::IOEvent::IOEvent ( )

◆ IOEvent() [2/2]

template<class Handle >
senf::ppi::IOEvent::IOEvent ( Handle  handle,
unsigned  events 
)

Member Function Documentation

◆ set()

template<class Handle >
void senf::ppi::IOEvent::set ( Handle  handle,
unsigned  events 
)

The documentation for this class was generated from the following files: