|
reSIProcate/stack
9694
|
This class takes a fifo as a place to where you can write your stuff. When using this in the main loop, call process() on this. During Transaction processing, TimerMessages and SIP messages are generated. More...
#include <TimerQueue.hxx>

Public Member Functions | |
| virtual void | processTimer (const T &timer)=0 |
| virtual | ~TimerQueue () |
| deletes the message associated with the timer as well. | |
| unsigned int | msTillNextTimer () |
| provides the time in milliseconds before the next timer will fire | |
| virtual UInt64 | process () |
| 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 |
| std::ostream & | encode (std::ostream &str) const |
| EncodeStream & | encode (EncodeStream &str) const |
Protected Types | |
| typedef std::vector< T, std::allocator< T > > | TimerVector |
Protected Attributes | |
| std::priority_queue< T, TimerVector, std::greater< T > > | mTimers |
This class takes a fifo as a place to where you can write your stuff. When using this in the main loop, call process() on this. During Transaction processing, TimerMessages and SIP messages are generated.
!dcm! - refactor, templatize
.dlb. timer wheel for transaction-bound timers and a heap for everything longer.
Definition at line 39 of file TimerQueue.hxx.
typedef std::vector<T, std::allocator<T> > resip::TimerQueue< T >::TimerVector [protected] |
Definition at line 154 of file TimerQueue.hxx.
| virtual resip::TimerQueue< T >::~TimerQueue | ( | ) | [inline, virtual] |
deletes the message associated with the timer as well.
Definition at line 49 of file TimerQueue.hxx.
| bool resip::TimerQueue< T >::empty | ( | ) | const [inline] |
Definition at line 119 of file TimerQueue.hxx.
{
return mTimers.empty();
}
| std::ostream& resip::TimerQueue< T >::encode | ( | std::ostream & | str | ) | const [inline] |
Definition at line 125 of file TimerQueue.hxx.
| EncodeStream& resip::TimerQueue< T >::encode | ( | EncodeStream & | str | ) | const [inline] |
Definition at line 139 of file TimerQueue.hxx.
| unsigned int resip::TimerQueue< T >::msTillNextTimer | ( | ) | [inline] |
provides the time in milliseconds before the next timer will fire
| 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 64 of file TimerQueue.hxx.
Referenced by resip::TransactionController::getTimeTillNextProcessMS(), resip::SipStack::getTimeTillNextProcessMS(), main(), and resip::TransactionController::process().
| virtual UInt64 resip::TimerQueue< T >::process | ( | ) | [inline, virtual] |
gets the set of timers that have fired, and inserts TimerMsg into the state machine fifo and application messages into the TU fifo
Definition at line 96 of file TimerQueue.hxx.
Referenced by main(), resip::TransactionController::process(), and resip::SipStack::processTimers().
{
if (!mTimers.empty())
{
UInt64 now=Timer::getTimeMs();
while (!mTimers.empty() && !(mTimers.top().getWhen() > now))
{
processTimer(mTimers.top());
mTimers.pop();
}
if(!mTimers.empty())
{
return mTimers.top().getWhen();
}
}
return 0;
}
| virtual void resip::TimerQueue< T >::processTimer | ( | const T & | timer | ) | [pure virtual] |
Implemented in resip::TransactionTimerQueue, resip::TuSelectorTimerQueue, and resip::BaseTimeLimitTimerQueue.
Referenced by resip::TimerQueue< TransactionTimer >::process().
| int resip::TimerQueue< T >::size | ( | ) | const [inline] |
Definition at line 115 of file TimerQueue.hxx.
Referenced by resip::SipStack::dump(), and resip::TransactionController::getTimerQueueSize().
{
return (int)mTimers.size();
}
std::priority_queue<T, TimerVector, std::greater<T> > resip::TimerQueue< T >::mTimers [protected] |
Definition at line 155 of file TimerQueue.hxx.
Referenced by resip::TimerQueue< TransactionTimer >::empty(), resip::TimerQueue< TransactionTimer >::encode(), resip::TimerQueue< TransactionTimer >::msTillNextTimer(), resip::TimerQueue< TransactionTimer >::process(), resip::TimerQueue< TransactionTimer >::size(), and resip::TimerQueue< TransactionTimer >::~TimerQueue().
1.7.5.1