Show
Ignore:
Timestamp:
04/16/06 22:10:21 (7 years ago)
Author:
ahu
Message:

add automatic mplexer selection at runtime, still need to do compile time

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/selectmplexer.cc

    r709 r713  
    1010using namespace std; 
    1111 
    12 class SelectFDMultiplexer : public FDMultiplexer 
    13 { 
    14 public: 
    15   SelectFDMultiplexer() 
    16   {} 
    17   virtual ~SelectFDMultiplexer() 
    18   {} 
    19  
    20   virtual int run(struct timeval* tv=0); 
    21  
    22   virtual void addFD(callbackmap_t& cbmap, int fd, callbackfunc_t toDo, boost::any parameter); 
    23   virtual void removeFD(callbackmap_t& cbmap, int fd); 
    24 }; 
    25  
    26  
    27 FDMultiplexer* getMultiplexer() 
     12static FDMultiplexer* make() 
    2813{ 
    2914  return new SelectFDMultiplexer(); 
    3015} 
    3116 
     17static struct RegisterOurselves 
     18{ 
     19  RegisterOurselves() { 
     20    FDMultiplexer::getMultiplexerMap().insert(make_pair(1, &make)); 
     21  } 
     22} doIt; 
    3223 
    3324void SelectFDMultiplexer::addFD(callbackmap_t& cbmap, int fd, callbackfunc_t toDo, boost::any parameter)