CMS 3D CMS Logo

IOSelectWindows.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_IOSELECT_WINDOWS_H
00002 # define CLASSLIB_IOSELECT_WINDOWS_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "IOSelectMethod.h"
00007 # include <list>
00008 # ifdef _WIN32
00009 #  include <windows.h>
00010 
00011 namespace lat {
00012 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00013 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00014 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00015 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00016 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00017 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00018 
00020 class IOSelectWindows : public IOSelectMethod
00021 {
00022 public:
00023     class Poll
00024     {
00025     public:
00026         virtual ~Poll (void);
00027 
00028         virtual void    start (IOSelectWindows *in);
00029         virtual void    update (IOSelectWindows *in);
00030         virtual void    close (IOSelectWindows *in);
00031     };
00032 
00033     class Poller
00034     {
00035     public:
00036         virtual ~Poller (void);
00037 
00038         virtual HANDLE  handle (void) const;
00039 
00040         virtual void    initialise (void);
00041         virtual void    run (void);
00042         virtual void    stop (void);
00043         virtual void    finalise (void);
00044 
00045     private:
00046         HANDLE          m_self;
00047     };
00048 
00049     IOSelectWindows (void);
00050     ~IOSelectWindows (void);
00051 
00052     // Attaching and detaching channels
00053     virtual void        attach    (const IOSelectRequest &req);
00054     virtual void        detach    (const IOSelectRequest &req);
00055     virtual void        clear     (void);
00056 
00057     // Channel status access
00058     virtual void        setMask   (IOFD fd, unsigned value);
00059     virtual void        andMask   (IOFD fd, unsigned value);
00060     virtual void        orMask    (IOFD fd, unsigned value);
00061 
00062     // Selection
00063     virtual bool        wait      (long msecs);
00064     virtual IOFD        next      (IOSelectEvent &event, IOSelectCB &cb);
00065 
00066 private:
00067     size_t              findReq   (IOFD fd);
00068 
00069     // FIXME: additional records chained to this?
00070     std::vector<Poll *> m_polls;
00071     std::vector<Poller *> m_pollers;
00072     size_t              m_fds;
00073     HANDLE              m_w4 [MAXIMUM_WAIT_OBJECTS];
00074     DWORD               m_sig;
00075     int                 m_nready;
00076     int                 m_current;
00077     bool                m_msgq;
00078     DWORD               m_ms;
00079 };
00080 
00081 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00082 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00083 
00084 } // namespace lat
00085 # endif // _WIN32
00086 #endif // CLASSLIB_IOSELECT_WINDOWS_H

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