Declares an abstract source type. More...
#include <xdispatch/source.h>
Protected Member Functions | |
sourcetype () | |
virtual | ~sourcetype () |
void | ready (const any &=any()) |
This method needs to be called every time your sourcetype is read. | |
virtual dispatch_source_t | native () |
Overload this method in case you are implementing a sourcetype based on an dispatch_source_t. |
Declares an abstract source type.
Subclass this type to implement custom source types. Whenever your type becomes ready and the source should dispatch the handler, simply call ready() with some data you want to make available via source::data() to your handler
xdispatch::sourcetype::sourcetype | ( | ) | [protected] |
virtual xdispatch::sourcetype::~sourcetype | ( | ) | [protected, virtual] |
virtual dispatch_source_t xdispatch::sourcetype::native | ( | ) | [protected, virtual] |
Overload this method in case you are implementing a sourcetype based on an dispatch_source_t.
This way users can access the native object by using source::native().
By default this is returning NULL
This method needs to be called every time your sourcetype is read.
The passed data can later be obtained in the handler by using source::data()