|
reSIProcate
SIP stack, Dialog Usage Manager and related libraries
|
The base class from which various templated Fifo classes are derived. More...
#include <AbstractFifo.hxx>
Public Member Functions | |
| AbstractFifo () | |
| Constructor. | |
| virtual | ~AbstractFifo () |
| bool | empty () const |
| is the queue empty? | |
| virtual unsigned int | size () const |
| get the current size of the fifo. | |
| bool | messageAvailable () const |
| is a message available? | |
| virtual time_t | getTimeDepth () const |
| computes the time delta between the oldest and newest queue members | |
| virtual size_t | getCountDepth () const |
| Returns the number of elements in the FIFO. | |
| virtual time_t | expectedWaitTimeMilliSec () const |
| Returns the expected time it will take to service all messages currently in the queue (in milli-seconds) | |
| virtual time_t | averageServiceTimeMicroSec () const |
| Returns the average time it takes for individual messages to be serviced (in micro-seconds) | |
| virtual void | clear () |
| remove all elements in the queue (or not) | |
Public Member Functions inherited from resip::FifoStatsInterface | |
| FifoStatsInterface () | |
| virtual | ~FifoStatsInterface () |
| uint8_t | getRole () const |
| void | setRole (uint8_t role) |
| void | setDescription (const resip::Data &description) |
| Sets the description for this fifo. | |
| virtual const resip::Data & | getDescription () const |
| Gets the description for this fifo. | |
Protected Types | |
| typedef std::deque< T > | Messages |
Protected Member Functions | |
| T | getNext () |
| Returns the first message available. | |
| bool | getNext (int ms, T &toReturn) |
| Returns the next message available. | |
| void | getMultiple (Messages &other, unsigned int max) |
| bool | getMultiple (int ms, Messages &other, unsigned int max) |
| size_t | add (const T &item) |
| size_t | addMultiple (Messages &items) |
| virtual void | onFifoPolled () |
| virtual void | onMessagePopped (unsigned int num=1) |
| Called when a message (or messages) are removed from this fifo. | |
| virtual void | onMessagePushed (int num) |
Protected Attributes | |
| Messages | mFifo |
| container for FIFO items | |
| Mutex | mMutex |
| access serialization lock | |
| Condition | mCondition |
| condition for waiting on new queue items | |
| uint64_t | mLastSampleTakenMicroSec |
| uint32_t | mCounter |
| uint32_t | mAverageServiceTimeMicroSec |
| uint32_t | mSize |
Protected Attributes inherited from resip::FifoStatsInterface | |
| Data | mDescription |
| uint8_t | mRole |
The base class from which various templated Fifo classes are derived.
(aka template hoist) AbstractFifo's get operations are all threadsafe; AbstractFifo does not define any put operations (these are defined in subclasses).
Definition at line 125 of file AbstractFifo.hxx.
|
protected |
Definition at line 299 of file AbstractFifo.hxx.
|
inline |
Constructor.
| maxSize | max number of messages to keep |
Definition at line 132 of file AbstractFifo.hxx.
|
inlinevirtual |
Definition at line 140 of file AbstractFifo.hxx.
|
inlineprotected |
Definition at line 381 of file AbstractFifo.hxx.
|
inlineprotected |
Definition at line 390 of file AbstractFifo.hxx.
|
inlinevirtual |
Returns the average time it takes for individual messages to be serviced (in micro-seconds)
Implements resip::FifoStatsInterface.
Definition at line 198 of file AbstractFifo.hxx.
|
inlinevirtual |
remove all elements in the queue (or not)
Reimplemented in resip::Fifo< Msg >, resip::Fifo< repro::ResponseInfo >, resip::Fifo< resip::DnsStub::Command >, resip::Fifo< resip::DtlsMessage >, resip::Fifo< resip::SendData >, resip::Fifo< resip::TimerMessage >, resip::Fifo< resip::TransactionMessage >, resip::Fifo< resip::TransactionUserMessage >, resip::Fifo< resip::Transport >, resip::Fifo< T >, resip::TimeLimitFifo< Msg >, resip::TimeLimitFifo< FifoEvent >, resip::TimeLimitFifo< proton::message >, resip::TimeLimitFifo< ReceivedData >, resip::TimeLimitFifo< resip::ApplicationMessage >, resip::TimeLimitFifo< resip::Data >, and resip::TimeLimitFifo< resip::Message >.
Definition at line 204 of file AbstractFifo.hxx.
|
inline |
is the queue empty?
Definition at line 148 of file AbstractFifo.hxx.
|
inlinevirtual |
Returns the expected time it will take to service all messages currently in the queue (in milli-seconds)
Implements resip::FifoStatsInterface.
Definition at line 193 of file AbstractFifo.hxx.
|
inlinevirtual |
Returns the number of elements in the FIFO.
Implements resip::FifoStatsInterface.
Reimplemented in resip::TimeLimitFifo< Msg >, resip::TimeLimitFifo< FifoEvent >, resip::TimeLimitFifo< proton::message >, resip::TimeLimitFifo< ReceivedData >, resip::TimeLimitFifo< resip::ApplicationMessage >, resip::TimeLimitFifo< resip::Data >, and resip::TimeLimitFifo< resip::Message >.
Definition at line 188 of file AbstractFifo.hxx.
|
inlineprotected |
Definition at line 328 of file AbstractFifo.hxx.
|
inlineprotected |
Definition at line 301 of file AbstractFifo.hxx.
|
inlineprotected |
Returns the first message available.
Returns the first message available. It will wait if no messages are available. If a signal interrupts the wait, it will retry the wait. Signals can therefore not be caught via getNext. If you need to detect a signal, use block prior to calling getNext.
Definition at line 216 of file AbstractFifo.hxx.
|
inlineprotected |
Returns the next message available.
Returns the next message available. Will wait up to ms milliseconds if no information is available. If the specified time passes or a signal interrupts the wait, this method returns 0. This interface provides no mechanism to distinguish between timeout and interrupt.
Definition at line 245 of file AbstractFifo.hxx.
|
inlinevirtual |
computes the time delta between the oldest and newest queue members
Implements resip::FifoStatsInterface.
Reimplemented in resip::TimeLimitFifo< Msg >, resip::TimeLimitFifo< FifoEvent >, resip::TimeLimitFifo< proton::message >, resip::TimeLimitFifo< ReceivedData >, resip::TimeLimitFifo< resip::ApplicationMessage >, resip::TimeLimitFifo< resip::Data >, and resip::TimeLimitFifo< resip::Message >.
Definition at line 183 of file AbstractFifo.hxx.
|
inline |
is a message available?
| true | if a message is available and false otherwise |
Definition at line 172 of file AbstractFifo.hxx.
|
inlineprotectedvirtual |
Definition at line 428 of file AbstractFifo.hxx.
|
inlineprotectedvirtual |
Called when a message (or messages) are removed from this fifo.
Used to drive service time calculations.
Definition at line 466 of file AbstractFifo.hxx.
|
inlineprotectedvirtual |
Definition at line 472 of file AbstractFifo.hxx.
|
inlinevirtual |
get the current size of the fifo.
Definition at line 161 of file AbstractFifo.hxx.
|
mutableprotected |
Definition at line 422 of file AbstractFifo.hxx.
|
protected |
condition for waiting on new queue items
Definition at line 418 of file AbstractFifo.hxx.
|
mutableprotected |
Definition at line 421 of file AbstractFifo.hxx.
|
protected |
container for FIFO items
Definition at line 414 of file AbstractFifo.hxx.
|
mutableprotected |
Definition at line 420 of file AbstractFifo.hxx.
|
mutableprotected |
access serialization lock
Definition at line 416 of file AbstractFifo.hxx.
|
protected |
Definition at line 426 of file AbstractFifo.hxx.