boost.png (6897 bytes)

PrevUpHomeNext

Class template demultiplexer

boost::net::demultiplexer — demultiplexer

Synopsis

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
};

Description

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/destruct

  1. demultiplexer();

    Required as we are explicitly hiding th copy constructor

  2. demultiplexer(const demultiplexer & );
  3. demultiplexer& operator=(const demultiplexer & );

demultiplexer public member functions

  1. template<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

  2. template<typename AsynchArguments> 
      demultiplexer_error remove(AsynchArguments & , bool notify = true) ;

    The return value is true if the resource can be reused with another demultiplexer.

  3. bool handle_events(long timeout = -1) ;
  4. void run() ;
  5. void stop() ;
  6. void notify() ;

demultiplexer private member functions

    Copyright © 2004 Hugo Duncan

    PrevUpHomeNext