46 DL((
REACT,
"Searching for Timer: 0x%x\n",
dynamic_cast<void*
> (
eh_)));
53 DL((
REACT,
"Found Timer: 0x%x in slot: %d\n",
54 dynamic_cast<void*
>(
eh_),
i));
97 if (
tp->getExpirationTime () >
tv_) {
109 DL((
REACT,
"Expired %s [t=%s] timer!\n",
110 tp->get_id ().c_str (),
111 tp->getExpirationTime ().fmtString ().c_str ()));
119 tp->rescheduleExpirationTime ();
130 DL((
TRACE,
"Expired total of %d timer(s).\n",
cnt));
141 const std::string&
name_)
143 trace(
"TimerQueue::insert");
154 trace(
"TimerQueue::dump");
157 DL((
REACT,
"Queue is empty\n"));
160 for (
size_t i = 0;
i <
m_queue.size (); ) {
#define trace(s)
trace() is used to trace function call chain in C++ program.
#define DL(X)
A macro for writing debug message to the Logger.
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
TimerQueue class represents the queue of Timers that application can install for Reactor to dispatch.
A wrapper class to provide AutoPtr with reference semantics.
PriorityQueue< Timer *, TimerCompare > m_queue
Timer queue itself.
int expire(const TimeVal &tv_)
Traverse the queue, triggering all timers that are past argument timeval.
void dump(void)
Dump Queue information to the log file.
int remove(EventHandler *eh_)
Cancel all timers for the EventHandler eh_.
TimerId insert(EventHandler *eh_, const TimeVal &tv_, const TimeVal &delta_, const std::string &name_)
Add timer (EventHandler object) to the queue to be dispatch at the time specified.
unsigned long TimerId
Timer Id is used in handle_timeout() calls.
@ REACT
Class Reactor/PrioriyQueue messages
@ TRACE
Function call trace
@ REACTTRACE
Extended Reactor/PrioriyQueue messages