Logo
~Sockets~
~Examples~
~Contact~


IEventOwner Class Reference
[EventTimer event handling]

Any class that wants to use timer events inherits this. More...

#include <IEventOwner.h>

Collaboration diagram for IEventOwner:

List of all members.


Public Member Functions

 IEventOwner (IEventHandler &h)
virtual ~IEventOwner ()
long AddEvent (long sec, long usec)
 Schedule event.
void ClearEvents ()
 Clear all events scheduled by this owner.
void RemoveEvent (long eid)
 Remove one event scheduled by this owner.
virtual void OnEvent (int)=0
 Event callback will fire when time is up.
IEventHandlerGetEventHandler ()
void SetHandlerInvalid (bool x=true)

Private Attributes

IEventHandlerm_event_handler
bool m_handler_invalid

Detailed Description

Any class that wants to use timer events inherits this.

Definition at line 45 of file IEventOwner.h.


Constructor & Destructor Documentation

IEventOwner::IEventOwner ( IEventHandler h  ) 

Definition at line 40 of file IEventOwner.cpp.

00040                                          : m_event_handler(h), m_handler_invalid(false)
00041 {
00042 }

IEventOwner::~IEventOwner (  )  [virtual]

Definition at line 45 of file IEventOwner.cpp.

References IEventHandler::ClearEvents(), m_event_handler, and m_handler_invalid.

00046 {
00047         if (!m_handler_invalid)
00048         {
00049                 m_event_handler.ClearEvents(this);
00050         }
00051 }


Member Function Documentation

long IEventOwner::AddEvent ( long  sec,
long  usec 
)

Schedule event.

Parameters:
sec Seconds until event
usec Microseconds until event
Returns:
Event ID

Definition at line 60 of file IEventOwner.cpp.

References IEventHandler::AddEvent(), and m_event_handler.

00061 {
00062         return m_event_handler.AddEvent(this, sec, usec);
00063 }

void IEventOwner::ClearEvents (  ) 

Clear all events scheduled by this owner.

Definition at line 66 of file IEventOwner.cpp.

References IEventHandler::ClearEvents(), and m_event_handler.

00067 {
00068         m_event_handler.ClearEvents(this);
00069 }

void IEventOwner::RemoveEvent ( long  eid  ) 

Remove one event scheduled by this owner.

Parameters:
eid Event ID to remove

Definition at line 72 of file IEventOwner.cpp.

References m_event_handler, and IEventHandler::RemoveEvent().

00073 {
00074         m_event_handler.RemoveEvent(this, eid);
00075 }

virtual void IEventOwner::OnEvent ( int   )  [pure virtual]

Event callback will fire when time is up.

IEventHandler & IEventOwner::GetEventHandler (  ) 

Definition at line 54 of file IEventOwner.cpp.

References m_event_handler.

00055 {
00056         return m_event_handler;
00057 }

void IEventOwner::SetHandlerInvalid ( bool  x = true  )  [inline]

Definition at line 65 of file IEventOwner.h.

00065 { m_handler_invalid = x; }


Member Data Documentation

Definition at line 69 of file IEventOwner.h.

Referenced by ~IEventOwner().


The documentation for this class was generated from the following files:
Page, code, and content Copyright (C) 2007 by Anders Hedström
Generated for C++ Sockets by  doxygen 1.4.4