![]() |
IEventOwner Class ReferenceAny class that wants to use timer events inherits this.
More...
|
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. | |
IEventHandler & | GetEventHandler () |
void | SetHandlerInvalid (bool x=true) |
Private Attributes | |
IEventHandler & | m_event_handler |
bool | m_handler_invalid |
Definition at line 45 of file IEventOwner.h.
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 }
long IEventOwner::AddEvent | ( | long | sec, | |
long | usec | |||
) |
Schedule event.
sec | Seconds until event | |
usec | Microseconds until event |
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.
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] |
IEventHandler& IEventOwner::m_event_handler [private] |
Definition at line 68 of file IEventOwner.h.
Referenced by AddEvent(), ClearEvents(), GetEventHandler(), RemoveEvent(), and ~IEventOwner().
bool IEventOwner::m_handler_invalid [private] |