ccRTP 2.1.2
 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 = 11
 
static const uint32 SEQNUMMOD = (1<<16)
 

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 298 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.

Definition at line 170 of file members.cpp.

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 331 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

Definition at line 75 of file incqueue.cpp.

void ApplicationHandler::addParticipant ( RTPApplication app,
Participant part 
)
inlineinherited

Definition at line 209 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.

Definition at line 282 of file members.cpp.

void Members::decreaseMembersCount ( )
inlineinherited

Definition at line 79 of file iqueue.h.

void Members::decreaseSendersCount ( )
inlineinherited

Definition at line 95 of file iqueue.h.

void MembershipBookkeeping::endMembers ( )
private

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

Definition at line 180 of file members.cpp.

size_t MembershipBookkeeping::getDefaultMembersHashSize ( )
inline

Definition at line 306 of file iqueue.h.

SyncSourceLink* MembershipBookkeeping::getFirst ( )
inlineprotected

Definition at line 836 of file iqueue.h.

SyncSourceLink* MembershipBookkeeping::getLast ( )
inlineprotected

Definition at line 839 of file iqueue.h.

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

Definition at line 336 of file iqueue.h.

uint32 Members::getMembersCount ( ) const
inlineinherited

Definition at line 83 of file iqueue.h.

uint32 MembershipBookkeeping::getMembersCount ( )
inlineprotected

Definition at line 843 of file iqueue.h.

uint32 Members::getSendersCount ( ) const
inlineinherited

Definition at line 99 of file iqueue.h.

uint32 MembershipBookkeeping::getSendersCount ( )
inlineprotected

Definition at line 851 of file iqueue.h.

MembershipBookkeeping::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.

Definition at line 226 of file members.cpp.

void Members::increaseMembersCount ( )
inlineinherited

Definition at line 75 of file iqueue.h.

void Members::increaseSendersCount ( )
inlineinherited

Definition at line 91 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 342 of file iqueue.h.

bool MembershipBookkeeping::isRegistered ( uint32  ssrc)
protected

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

Definition at line 205 of file members.cpp.

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

Definition at line 213 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.

Definition at line 295 of file members.cpp.

ConflictHandler::ConflictingTransportAddress * ConflictHandler::searchControlConflict ( InetAddress  na,
tpport_t  ctp 
)
inherited
Parameters
naInet network address.
ctpData transport port.

Definition at line 64 of file incqueue.cpp.

ConflictHandler::ConflictingTransportAddress * ConflictHandler::searchDataConflict ( InetAddress  na,
tpport_t  dtp 
)
inherited
Parameters
naInet network address.
dtpData transport port.

Definition at line 54 of file incqueue.cpp.

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

Definition at line 158 of file iqueue.h.

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

Definition at line 154 of file iqueue.h.

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

Definition at line 138 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 162 of file iqueue.h.

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

Definition at line 142 of file iqueue.h.

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

Definition at line 188 of file iqueue.h.

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

Definition at line 183 of file iqueue.h.

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

Definition at line 150 of file iqueue.h.

void Members::setSendersCount ( uint32  n)
inlineinherited

Definition at line 87 of file iqueue.h.

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

Definition at line 146 of file iqueue.h.

void ConflictHandler::updateConflict ( ConflictingTransportAddress ca)
inlineinherited

Definition at line 273 of file iqueue.h.

Field Documentation

const size_t MembershipBookkeeping::defaultMembersHashSize = 11
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 285 of file iqueue.h.

SyncSourceLink * MembershipBookkeeping::last
private

Definition at line 874 of file iqueue.h.

ConflictingTransportAddress * ConflictHandler::lastConflict
protectedinherited

Definition at line 285 of file iqueue.h.

const uint32 MembershipBookkeeping::SEQNUMMOD = (1<<16)
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 files: