Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
MembershipBookkeeping Class Reference

Controls the group membership in the current session. More...

#include <iqueue.h>

Inheritance diagram for MembershipBookkeeping:
Inheritance graph
[legend]
Collaboration diagram for MembershipBookkeeping:
Collaboration graph
[legend]

Data Structures

struct  IncomingRTPPktLink
 Incoming RTP data packets control structure within the incoming packet queue class. More...
 
struct  SyncSourceLink
 Synchronization Source internal handler within the incoming packets queue. More...
 

Public Member Functions

size_t getDefaultMembersHashSize ()
 
void setLink (SyncSource &source, void *link)
 
void setParticipant (SyncSource &source, Participant &p)
 
void setState (SyncSource &source, SyncSource::State ns)
 
void setSender (SyncSource &source, bool active)
 
void setDataTransportPort (SyncSource &source, tpport_t p)
 
void setControlTransportPort (SyncSource &source, tpport_t p)
 
void setNetworkAddress (SyncSource &source, InetAddress addr)
 
void setSDESItem (Participant *part, SDESItemType item, const std::string &val)
 
void setPRIVPrefix (Participant *part, const std::string val)
 
void addParticipant (RTPApplication &app, Participant &part)
 
void removeParticipant (RTPApplication &app, RTPApplication::ParticipantLink *pl)
 
ConflictingTransportAddresssearchDataConflict (InetAddress na, tpport_t dtp)
 
ConflictingTransportAddresssearchControlConflict (InetAddress na, tpport_t ctp)
 
void updateConflict (ConflictingTransportAddress &ca)
 
void addConflict (const InetAddress &na, tpport_t dtp, tpport_t ctp)
 

Protected Member Functions

 MembershipBookkeeping (uint32 initialSize=defaultMembersHashSize)
 The initial size is a hint to allocate the resources needed in order to keep the members' identifiers and associated information. More...
 
virtual ~MembershipBookkeeping ()
 Purges all RTPSource structures created during the session, as well as the hash table and the list of sources. More...
 
SyncSourceLinkgetLink (const SyncSource &source) const
 
bool isMine (const SyncSource &source) const
 Get whether a synchronization source is recorded in this membership controller. More...
 
bool isRegistered (uint32 ssrc)
 Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier. More...
 
SyncSourceLinkgetSourceBySSRC (uint32 ssrc, bool &created)
 Get the description of a source by its ssrc identifier. More...
 
bool BYESource (uint32 ssrc)
 Mark the source identified by ssrc as having sent a BYE packet. More...
 
bool removeSource (uint32 ssrc)
 Remove the description of the source identified by ssrc More...
 
SyncSourceLinkgetFirst ()
 
SyncSourceLinkgetLast ()
 
uint32 getMembersCount ()
 
void setMembersCount (uint32 n)
 
uint32 getSendersCount ()
 

Protected Attributes

ConflictingTransportAddressfirstConflict
 
ConflictingTransportAddresslastConflict
 

Static Protected Attributes

static const size_t defaultMembersHashSize
 
static const uint32 SEQNUMMOD
 

Private Member Functions

 MembershipBookkeeping (const MembershipBookkeeping &o)
 
MembershipBookkeepingoperator= (const MembershipBookkeeping &o)
 
void endMembers ()
 Purge all RTPSource structures, the hash table and the list of sources. More...
 
void increaseMembersCount ()
 
void decreaseMembersCount ()
 
uint32 getMembersCount () const
 
void setSendersCount (uint32 n)
 
void increaseSendersCount ()
 
void decreaseSendersCount ()
 
uint32 getSendersCount () const
 

Private Attributes

uint32 sourceBucketsNum
 
SyncSourceLink ** sourceLinks
 
SyncSourceLinkfirst
 
SyncSourceLinklast
 

Detailed Description

Controls the group membership in the current session.

For now, this class implements only a hash table of members, but its design and relation with other classes is intented to support group membership sampling in case scalability problems arise.

Author
Federico Montesino Pouzols fedem.nosp@m.p@al.nosp@m.tern..nosp@m.org

Definition at line 301 of file iqueue.h.

Constructor & Destructor Documentation

MembershipBookkeeping::MembershipBookkeeping ( uint32  initialSize = defaultMembersHashSize)
protected

The initial size is a hint to allocate the resources needed in order to keep the members' identifiers and associated information.

Although ccRTP will reallocate resources when it becomes necessary, a good hint may save a lot of unpredictable time penalties.

Parameters
initialSizean estimation of how many participants the session will consist of.
virtual MembershipBookkeeping::~MembershipBookkeeping ( )
inlineprotectedvirtual

Purges all RTPSource structures created during the session, as well as the hash table and the list of sources.

Definition at line 334 of file iqueue.h.

MembershipBookkeeping::MembershipBookkeeping ( const MembershipBookkeeping o)
private

Member Function Documentation

void ConflictHandler::addConflict ( const InetAddress na,
tpport_t  dtp,
tpport_t  ctp 
)
inherited
void ApplicationHandler::addParticipant ( RTPApplication app,
Participant part 
)
inlineinherited

Definition at line 212 of file iqueue.h.

bool MembershipBookkeeping::BYESource ( uint32  ssrc)
protected

Mark the source identified by ssrc as having sent a BYE packet.

It is not deleted until a timeout expires, so that in case some packets from this source arrive a bit later the source is not inserted again in the table of known sources.

Returns
true if the source had been previously identified. false if it was not in the table of known sources.
void Members::decreaseMembersCount ( )
inlineinherited

Definition at line 82 of file iqueue.h.

void Members::decreaseSendersCount ( )
inlineinherited

Definition at line 98 of file iqueue.h.

void MembershipBookkeeping::endMembers ( )
private

Purge all RTPSource structures, the hash table and the list of sources.

size_t MembershipBookkeeping::getDefaultMembersHashSize ( )
inline

Definition at line 309 of file iqueue.h.

SyncSourceLink* MembershipBookkeeping::getFirst ( void  )
inlineprotected

Definition at line 836 of file iqueue.h.

SyncSourceLink* MembershipBookkeeping::getLast ( void  )
inlineprotected

Definition at line 839 of file iqueue.h.

SyncSourceLink* MembershipBookkeeping::getLink ( const SyncSource source) const
inlineprotected

Definition at line 339 of file iqueue.h.

uint32 Members::getMembersCount ( ) const
inlineinherited

Definition at line 86 of file iqueue.h.

uint32 MembershipBookkeeping::getMembersCount ( )
inlineprotected

Definition at line 843 of file iqueue.h.

uint32 Members::getSendersCount ( ) const
inlineinherited

Definition at line 102 of file iqueue.h.

uint32 MembershipBookkeeping::getSendersCount ( )
inlineprotected

Definition at line 851 of file iqueue.h.

SyncSourceLink* MembershipBookkeeping::getSourceBySSRC ( uint32  ssrc,
bool &  created 
)
protected

Get the description of a source by its ssrc identifier.

Parameters
ssrcSSRC identifier, in host order.
createdwhether a new source has been created.
Returns
Pointer to the SyncSource object identified by ssrc.
void Members::increaseMembersCount ( )
inlineinherited

Definition at line 78 of file iqueue.h.

void Members::increaseSendersCount ( )
inlineinherited

Definition at line 94 of file iqueue.h.

bool MembershipBookkeeping::isMine ( const SyncSource source) const
inlineprotected

Get whether a synchronization source is recorded in this membership controller.

Definition at line 345 of file iqueue.h.

bool MembershipBookkeeping::isRegistered ( uint32  ssrc)
protected

Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier.

MembershipBookkeeping& MembershipBookkeeping::operator= ( const MembershipBookkeeping o)
private
void ApplicationHandler::removeParticipant ( RTPApplication app,
RTPApplication::ParticipantLink pl 
)
inlineinherited

Definition at line 216 of file iqueue.h.

bool MembershipBookkeeping::removeSource ( uint32  ssrc)
protected

Remove the description of the source identified by ssrc

Returns
whether the source has been actually removed or it did not exist.
ConflictingTransportAddress* ConflictHandler::searchControlConflict ( InetAddress  na,
tpport_t  ctp 
)
inherited
Parameters
naInet network address.
ctpData transport port.
ConflictingTransportAddress* ConflictHandler::searchDataConflict ( InetAddress  na,
tpport_t  dtp 
)
inherited
Parameters
naInet network address.
dtpData transport port.
void SyncSourceHandler::setControlTransportPort ( SyncSource source,
tpport_t  p 
)
inlineinherited

Definition at line 161 of file iqueue.h.

void SyncSourceHandler::setDataTransportPort ( SyncSource source,
tpport_t  p 
)
inlineinherited

Definition at line 157 of file iqueue.h.

void SyncSourceHandler::setLink ( SyncSource source,
void *  link 
)
inlineinherited

Definition at line 141 of file iqueue.h.

void MembershipBookkeeping::setMembersCount ( uint32  n)
inlineprotected

Definition at line 847 of file iqueue.h.

void SyncSourceHandler::setNetworkAddress ( SyncSource source,
InetAddress  addr 
)
inlineinherited

Definition at line 165 of file iqueue.h.

void SyncSourceHandler::setParticipant ( SyncSource source,
Participant p 
)
inlineinherited

Definition at line 145 of file iqueue.h.

void ParticipantHandler::setPRIVPrefix ( Participant part,
const std::string  val 
)
inlineinherited

Definition at line 191 of file iqueue.h.

void ParticipantHandler::setSDESItem ( Participant part,
SDESItemType  item,
const std::string &  val 
)
inlineinherited

Definition at line 186 of file iqueue.h.

void SyncSourceHandler::setSender ( SyncSource source,
bool  active 
)
inlineinherited

Definition at line 153 of file iqueue.h.

void Members::setSendersCount ( uint32  n)
inlineinherited

Definition at line 90 of file iqueue.h.

void SyncSourceHandler::setState ( SyncSource source,
SyncSource::State  ns 
)
inlineinherited

Definition at line 149 of file iqueue.h.

void ConflictHandler::updateConflict ( ConflictingTransportAddress ca)
inlineinherited

Definition at line 276 of file iqueue.h.

Field Documentation

const size_t MembershipBookkeeping::defaultMembersHashSize
staticprotected

Definition at line 854 of file iqueue.h.

SyncSourceLink* MembershipBookkeeping::first
private

Definition at line 874 of file iqueue.h.

ConflictingTransportAddress* ConflictHandler::firstConflict
protectedinherited

Definition at line 288 of file iqueue.h.

SyncSourceLink * MembershipBookkeeping::last
private

Definition at line 874 of file iqueue.h.

ConflictingTransportAddress * ConflictHandler::lastConflict
protectedinherited

Definition at line 288 of file iqueue.h.

const uint32 MembershipBookkeeping::SEQNUMMOD
staticprotected

Definition at line 855 of file iqueue.h.

uint32 MembershipBookkeeping::sourceBucketsNum
private

Definition at line 871 of file iqueue.h.

SyncSourceLink** MembershipBookkeeping::sourceLinks
private

Definition at line 872 of file iqueue.h.


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