sipXcallLib home page


Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
CSeqManager Class Reference

CSeqManager manages the CSeq number space for a dialog. More...

#include <CSeqManager.h>

Public Member Functions

 CSeqManager ()
 Default constructor. More...
 
virtual ~CSeqManager ()
 Destructor. More...
 
bool startTransaction (const char *szIdentifier, int &iCSeq)
 startTransaction notes that a transaction has been started and will return FALSE if any other transaction was already started. More...
 
bool endTransaction (const char *szIdentifier)
 endTransaction marks the end of a transaction. More...
 
void dumpState (UtlString &state)
 Dump state into specified string. More...
 
int getCSeqNumber (const char *szIdentifier)
 Get the current csequence number. More...
 
bool isInTransaction (const char *szIdentifier)
 Is the specified identifer in a transaction already? More...
 

Protected Member Functions

CSEQ_CONTEXTgetContext (const char *szIdentifier)
 Gets the context for the specified identifier. More...
 

Protected Attributes

UtlHashMap mHashMap
 
UtlRandom mRandomGenerator
 
OsMutex mGuard
 
int miCSeq
 

Private Member Functions

 CSeqManager (const CSeqManager &rCSeqManager)
 Disabled copy constructor. More...
 
CSeqManageroperator= (const CSeqManager &rhs)
 Disabled assignment operator. More...
 

Detailed Description

CSeqManager manages the CSeq number space for a dialog.

It keeps track of multiple identifiers to handle overlapping transactions (e.g. send a NOTIFY while an INFO transaction is still outstanding).

Constructor & Destructor Documentation

Default constructor.

~CSeqManager ( )
virtual

Destructor.

CSeqManager ( const CSeqManager rCSeqManager)
private

Disabled copy constructor.

Member Function Documentation

void dumpState ( UtlString &  state)

Dump state into specified string.

bool endTransaction ( const char *  szIdentifier)

endTransaction marks the end of a transaction.

CSEQ_CONTEXT * getContext ( const char *  szIdentifier)
protected

Gets the context for the specified identifier.

If no context is available, one is created.

int getCSeqNumber ( const char *  szIdentifier)

Get the current csequence number.

bool isInTransaction ( const char *  szIdentifier)

Is the specified identifer in a transaction already?

CSeqManager& operator= ( const CSeqManager rhs)
private

Disabled assignment operator.

bool startTransaction ( const char *  szIdentifier,
int &  iCSeq 
)

startTransaction notes that a transaction has been started and will return FALSE if any other transaction was already started.

It is assumed that if startTransaction fails (returns false), the developer will try to start the transaction again later. This method will increase the CSeq number regardless of success.

Member Data Documentation

OsMutex mGuard
protected
UtlHashMap mHashMap
protected
int miCSeq
protected
UtlRandom mRandomGenerator
protected