boost::net::demultiplexer — demultiplexer
template<typename Impl> class demultiplexer { public: // types typedef Impl::synchronisation_type synchronisation_type; // default synchronisation type to use with this demultiplexer typedef Impl::notification_mode notification_mode; // notifcation mode // construct/copy/destruct demultiplexer(); demultiplexer(const demultiplexer &); demultiplexer& operator=(const demultiplexer &); // public member functions template<typename AsynchArguments> demultiplexer_error add(AsynchArguments &, bool = true) ; template<typename AsynchArguments> demultiplexer_error remove(AsynchArguments &, bool = true) ; bool handle_events(long = -1) ; void run() ; void stop() ; void notify() ; // private member functions };
Interface for demultiplexing io and other event notifications.
Provides a common interface for implementations classes. While the implementation classes can be used directly, the use of this facade will ensure no extra methods are exposed, and that the application remains useable with any implementation.
demultiplexer
construct/copy/destructdemultiplexer();
Required as we are explicitly hiding th copy constructor
demultiplexer(const demultiplexer & );
demultiplexer& operator=(const demultiplexer & );
demultiplexer
public member functionstemplate<typename AsynchArguments> demultiplexer_error add(AsynchArguments & , bool notify = true) ;
Different demultiplexers will place different requirements on the AsynchArguments.
For example a wait_for_events based demultiplexer will expect the arguments to be able to provide an event, and provide a method to complete the request which is responsable for posting a user callback function for execution.
A completion port demultiplexer expects the arguments to provide a mode function, and a descriptor
template<typename AsynchArguments> demultiplexer_error remove(AsynchArguments & , bool notify = true) ;
The return value is true if the resource can be reused with another demultiplexer.
bool handle_events(long timeout = -1) ;
void run() ;
void stop() ;
void notify() ;
Copyright © 2004 Hugo Duncan |