CMS 3D CMS Logo

IOSelectPoll.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_IOSELECT_POLL_H
00002 # define CLASSLIB_IOSELECT_POLL_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "IOSelectFdMap.h"
00007 # if HAVE_POLL
00008 #  include <sys/time.h>
00009 #  include <sys/types.h>
00010 #  include <sys/poll.h>
00011 #  include <unistd.h>
00012 #  include <errno.h>
00013 #  include <vector>
00014 
00015 namespace lat {
00016 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00017 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00018 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00019 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00020 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00021 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00022 
00024 class IOSelectPoll : public IOSelectFdMap
00025 {
00026 public:
00027     IOSelectPoll (void);
00028     ~IOSelectPoll (void);
00029 
00030     // Attaching and detaching descriptors
00031     virtual void        attach    (const IOSelectRequest &req);
00032     virtual void        detach    (const IOSelectRequest &req);
00033     virtual void        clear     (void);
00034 
00035     // Descriptor listening states
00036     virtual void        setMask   (IOFD fd, unsigned value);
00037     virtual void        andMask   (IOFD fd, unsigned value);
00038     virtual void        orMask    (IOFD fd, unsigned value);
00039 
00040     // Selection
00041     virtual bool        wait      (long msecs);
00042     virtual IOFD        next      (IOSelectEvent &event, IOSelectCB &cb);
00043 
00044 private:
00047     std::vector<pollfd> m_polls;
00048 
00050     int                 m_nready;
00051 
00054     size_t              m_current;
00055 };
00056 
00057 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00058 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00059 
00060 } // namespace lat
00061 # endif // ! _WIN32
00062 #endif // CLASSLIB_IOSELECT_POLL_H

Generated on Tue Jun 9 17:39:00 2009 for CMSSW by  doxygen 1.5.4