AURobotServers  4
Public Member Functions | Protected Attributes | List of all members
UEvents Class Reference

#include <uevents.h>

Public Member Functions

unsigned long add (const char *key, EVENT_CALL onEvent, void *obj)
 
void del (unsigned long serial)
 
UEventTrapgetEvent (const char *key, UEventTrap *fromEvent)
 
 UEvents (int maxEventTraps)
 
 ~UEvents ()
 

Protected Attributes

UEventTrapevents
 
int eventsCnt
 
unsigned int eventSerial
 
int eventsMax
 

Detailed Description

List of events

Author
Christian Andersen

Constructor & Destructor Documentation

UEvents::UEvents ( int  maxEventTraps)

Constructor

References events, eventsCnt, eventSerial, and eventsMax.

UEvents::~UEvents ( )

Destructor

References events.

Member Function Documentation

unsigned long UEvents::add ( const char *  key,
EVENT_CALL  onEvent,
void *  obj 
)

Add event trap Takes a event trigger key, a function to call, and an object to use as first parameter in the call. Returns a serial number for the trap, so that it can be deleted using this key. If no more space the returned serial is 0;

References events, eventsCnt, eventSerial, eventsMax, UEventTrap::isValid(), maxi(), and UEventTrap::set().

Referenced by UClientHandler::addDataTrap().

void UEvents::del ( unsigned long  serial)

Delete a trap (mark as invalid)

References events, eventsCnt, UEventTrap::getID(), UEventTrap::isValid(), and UEventTrap::setInvalid().

Referenced by UClientHandler::delDataTrap().

UEventTrap * UEvents::getEvent ( const char *  key,
UEventTrap fromEvent 
)

Get a pointer to event compatible with this key If 'fromEvent != NULL, then the next event after fromEvent is found. Returns NULL if no event is found.

References events, eventsCnt, UEventTrap::isThis(), and UEventTrap::isValid().

Referenced by UClientHandler::gotNewData().

Member Data Documentation

UEventTrap* UEvents::events
protected

Events

Referenced by add(), del(), getEvent(), UEvents(), and ~UEvents().

int UEvents::eventsCnt
protected

Number of active events

Referenced by add(), del(), getEvent(), and UEvents().

unsigned int UEvents::eventSerial
protected

Event serial number

Referenced by add(), and UEvents().

int UEvents::eventsMax
protected

Maximum number of events allocated

Referenced by add(), and UEvents().


The documentation for this class was generated from the following files: