Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::unievent::UnixEventPoll Class Reference

Manages events associated with various file descriptors and/or signals. This is an implementation of UnixEventRegistry that uses the poll(2) system call to find out about events. More...

#include <UniEvent/UnixEventPoll.h>

Inheritance diagram for strmod::unievent::UnixEventPoll:

Inheritance graph
[legend]
List of all members.

Public Methods

 UnixEventPoll (Dispatcher *dispatcher)
 Construct to use dispatcher to post events to.

virtual ~UnixEventPoll ()
 Currently doesn't clean signal handlers.

virtual int AreYouA (const lcore::ClassIdent &cid) const
 Asks if a class is of a particular type, or publicly derived from that type.

virtual bool invariant () const
 This should ALWAYS return true. It says whether the class invariant holds or not.

virtual void printState (::std::ostream &os) const
 This should print out as much of the internal state of a class as would be needed to debug it properly.

virtual void registerFDCond (int fd, const FDCondSet &condbits, const EventPtr &ev)
 Register the event '*ev' to be fired on file descriptor condition true.

virtual void freeFD (int fd)
 Removes all entries associated with a particular file descriptor.

virtual void onSignal (int signo, const EventPtr &e)
 On the given signal, post the given event.

virtual void clearSignal (int signo, const EventPtr &e)
 Stop posting the given event for the given signal.

virtual void clearSignal (int signo)
 Stop posting any events for the given signal.

virtual absolute_t currentTime () const
 Uses the POSIX gettimeofday call.

virtual void doPoll (bool wait=false)
 Actually call the UNIX poll system call, and dispatch resulting events.


Static Public Attributes

const UNEVT_ClassIdent identifier
 Globally unique identifier for this class.


Protected Methods

virtual const lcore::ClassIdent * i_GetIdent () const
 Returns the class identifier for the class the object actually is.


Detailed Description

Manages events associated with various file descriptors and/or signals. This is an implementation of UnixEventRegistry that uses the poll(2) system call to find out about events.

Definition at line 33 of file UnixEventPoll.h.


Member Function Documentation

virtual int strmod::unievent::UnixEventPoll::AreYouA const lcore::ClassIdent &    cid const [inline, virtual]
 

Asks if a class is of a particular type, or publicly derived from that type.

Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.

Parameters:
cid Usually <class>::identifier for the class you want to ask if the object is an instance of.

Reimplemented from strmod::lcore::Debugable.

Definition at line 46 of file UnixEventPoll.h.

void strmod::unievent::UnixEventPoll::clearSignal int    signo [virtual]
 

Stop posting any events for the given signal.

Parameters:
signo The signal to stop posting events for.
This function should be avoided as you may interfere unkowingly with other parts of the program that are still depending on their events being posted when the signal happens.

Implements strmod::unievent::UnixEventRegistry.

Definition at line 223 of file UnixEventPoll.cxx.

void strmod::unievent::UnixEventPoll::clearSignal int    signo,
const EventPtr   e
[virtual]
 

Stop posting the given event for the given signal.

Parameters:
signo The signal to stop posting the event for.
ev The event to stop posting.

Implements strmod::unievent::UnixEventRegistry.

Definition at line 203 of file UnixEventPoll.cxx.

virtual const lcore::ClassIdent* strmod::unievent::UnixEventPoll::i_GetIdent   const [inline, protected, virtual]
 

Returns the class identifier for the class the object actually is.

Should always be overridden in any class that has a static identifier member.

Reimplemented from strmod::lcore::Debugable.

Definition at line 75 of file UnixEventPoll.h.

bool strmod::unievent::UnixEventPoll::invariant   const [virtual]
 

This should ALWAYS return true. It says whether the class invariant holds or not.

Your class invariant should be as strict as possible. The class invariant is used to detect when the class goes into a bad state, so all possible bad states should be caught by the invariant.

Implements strmod::lcore::Debugable.

Definition at line 380 of file UnixEventPoll.cxx.

void strmod::unievent::UnixEventPoll::onSignal int    signo,
const EventPtr   e
[virtual]
 

On the given signal, post the given event.

Parameters:
signo The number of the signal to post an event for.
ev The event to post.

Implements strmod::unievent::UnixEventRegistry.

Definition at line 161 of file UnixEventPoll.cxx.


Member Data Documentation

const UNEVT_ClassIdent strmod::unievent::UnixEventPoll::identifier [static]
 

Globally unique identifier for this class.

Every class that might need to be identified should have a public static const identifier object in it.

Reimplemented from strmod::lcore::Debugable.


The documentation for this class was generated from the following files:
Generated on Wed Jan 29 00:32:58 2003 for libNet by doxygen1.3-rc1