reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::FiniteFifo< Msg > Class Template Reference

A templated, threadsafe message-queue class with a fixed size. More...

#include <FiniteFifo.hxx>

Inheritance diagram for resip::FiniteFifo< Msg >:
[legend]

Public Member Functions

 FiniteFifo (unsigned int maxSize)
 
virtual ~FiniteFifo ()
 
bool add (Msg *msg)
 
Msg * getNext ()
 Returns the first message available.
 
Msg * getNext (int ms)
 Returns the next message available.
 
- Public Member Functions inherited from resip::AbstractFifo< Msg * >
 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.
 

Additional Inherited Members

- Protected Types inherited from resip::AbstractFifo< Msg * >
typedef std::deque< Msg * > Messages
 
- Protected Member Functions inherited from resip::AbstractFifo< Msg * >
Msg * getNext ()
 Returns the first message available.
 
bool getNext (int ms, Msg * &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 Msg * &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 inherited from resip::AbstractFifo< Msg * >
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
 

Detailed Description

template<class Msg>
class resip::FiniteFifo< Msg >

A templated, threadsafe message-queue class with a fixed size.

Deprecated:
Todo:
remove class

Definition at line 20 of file FiniteFifo.hxx.

Constructor & Destructor Documentation

◆ FiniteFifo()

template<class Msg >
resip::FiniteFifo< Msg >::FiniteFifo ( unsigned int  maxSize)

Definition at line 57 of file FiniteFifo.hxx.

◆ ~FiniteFifo()

template<class Msg >
resip::FiniteFifo< Msg >::~FiniteFifo ( )
virtual

Definition at line 64 of file FiniteFifo.hxx.

Member Function Documentation

◆ add()

template<class Msg >
bool resip::FiniteFifo< Msg >::add ( Msg *  msg)

Definition at line 76 of file FiniteFifo.hxx.

◆ getNext() [1/2]

template<class Msg >
Msg * resip::FiniteFifo< Msg >::getNext ( )

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 93 of file FiniteFifo.hxx.

◆ getNext() [2/2]

template<class Msg >
Msg * resip::FiniteFifo< Msg >::getNext ( int  ms)

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 100 of file FiniteFifo.hxx.


The documentation for this class was generated from the following file: