eventxx  1.0.1
eventxx::event< F > Struct Template Reference

Generic event object. More...

Inheritance diagram for eventxx::event< F >:

Public Member Functions

 event (int fd, type ev, F &handler) throw ()
 Creates a new event. More...
 
- Public Member Functions inherited from eventxx::basic_event
bool pending (type ev) const throw ()
 Checks if there is an event pending. More...
 
time timeout () const throw ()
 Timeout of the event. More...
 
void priority (int priority) const throw (invalid_event, invalid_priority)
 Sets the event's priority. More...
 
int fd () const throw ()
 Event's file descriptor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from eventxx::basic_event
 basic_event () throw ()
 

Detailed Description

template<typename F>
struct eventxx::event< F >

Generic event object.

This object stores all the information about an event, including a callback functor, which is called when the event is fired. The template parameter must be a functor (callable object or function) that can take 2 parameters: an integer (the file descriptor of the fired event) and an event::type (the type of event being fired). There is a specialized version of this class which takes as the template parameter a C function with the eventxx::ccallback_type signature, just like C libevent API does.

See also
eventxx::event< ccallback_type >
Examples
prio-test.cpp, and test-weof.cpp.

Constructor & Destructor Documentation

◆ event()

template<typename F >
eventxx::event< F >::event ( int  fd,
type  ev,
F &  handler 
)
throw (
)
inline

Creates a new event.

Parameters
fdFile descriptor to monitor for events.
evType of events to monitor (see eventxx::type).
handlerCallback functor.

References eventxx::basic_event::fd().


The documentation for this struct was generated from the following file: