|
reSIProcate/stack
9359
|
This class takes a fifo as a place to where you can write your stuff. More...
#include <TimerQueue.hxx>

Public Member Functions | |
| virtual | ~BaseTimerQueue ()=0 |
| deletes the message associated with the timer as well. | |
| virtual void | process ()=0 |
| gets the set of timers that have fired and inserts TimerMsg into the state machine fifo and application messages into the TU fifo | |
| int | size () const |
| bool | empty () const |
| unsigned int | msTillNextTimer () |
| Give me the time before the next timer will fire in milliseconds. | |
Protected Attributes | |
| std::multiset< Timer > | mTimers |
Friends | |
| EncodeStream & | operator<< (EncodeStream &, const BaseTimerQueue &) |
| std::ostream & | operator<< (std::ostream &strm, const BaseTimerQueue &) |
This class takes a fifo as a place to where you can write your stuff.
In the main loop when using this you need to call process() on this. During Transaction processing, TimerMessages and SIP messages get generated.dcm! - refactor, templatize
Definition at line 31 of file TimerQueue.hxx.
| BaseTimerQueue::~BaseTimerQueue | ( | ) | [pure virtual] |
deletes the message associated with the timer as well.
Definition at line 36 of file TimerQueue.cxx.
References mTimers.
| bool BaseTimerQueue::empty | ( | ) | const |
| unsigned int BaseTimerQueue::msTillNextTimer | ( | ) |
Give me the time before the next timer will fire in milliseconds.
| milliseconds | (time until the next timer will fire) |
| 0 | (implies that timers occur in the past) |
| INT_MAX | (implies that there are no timers) |
Definition at line 50 of file TimerQueue.cxx.
References resip::Timer::getTimeMs(), and mTimers.
Referenced by resip::TransactionController::getTimeTillNextProcessMS(), resip::SipStack::getTimeTillNextProcessMS(), and main().
{
if (!mTimers.empty())
{
UInt64 next = mTimers.begin()->mWhen;
UInt64 now = Timer::getTimeMs();
if (now > next)
{
return 0;
}
else
{
UInt64 ret64 = next - now;
if ( ret64 > UInt64(INT_MAX) )
{
return INT_MAX;
}
else
{
int ret = int(ret64);
return ret;
}
}
}
else
{
return INT_MAX;
}
}

| virtual void resip::BaseTimerQueue::process | ( | ) | [pure virtual] |
gets the set of timers that have fired and inserts TimerMsg into the state machine fifo and application messages into the TU fifo
Implemented in resip::TimerQueue, and resip::BaseTimeLimitTimerQueue.
| int BaseTimerQueue::size | ( | ) | const |
Definition at line 110 of file TimerQueue.cxx.
References mTimers.
Referenced by resip::SipStack::dump(), and resip::TransactionController::getTimerQueueSize().
{
return (int)mTimers.size();
}
| EncodeStream& operator<< | ( | EncodeStream & | , |
| const BaseTimerQueue & | |||
| ) | [friend] |
| std::ostream& operator<< | ( | std::ostream & | strm, |
| const BaseTimerQueue & | |||
| ) | [friend] |
std::multiset<Timer> resip::BaseTimerQueue::mTimers [protected] |
Definition at line 56 of file TimerQueue.hxx.
Referenced by resip::BaseTimeLimitTimerQueue::add(), resip::TimerQueue::add(), empty(), msTillNextTimer(), resip::BaseTimeLimitTimerQueue::process(), resip::TimerQueue::process(), size(), and ~BaseTimerQueue().
1.7.5.1