Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

MembershipControl Class Reference

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

#include <cc++/rtp.h>

Inheritance diagram for MembershipControl::

Members RTPQueue QueueRTCPManager RTPDuplex List of all members.

Public Methods

const RTPSourcegetSource (uint32 ssrc) const
 Get the description of a source by its SSRC identifier. More...

const RTPSourcegetOrCreateSource (uint32 ssrc)
 Get the description of a source by its ssrc identifier. More...


Protected Methods

RTPSourceaddNewSource (uint32 ssrc)
 MembershipControl (uint32 initial_size=7)
 The initial size is a hint to allocate the resources needed in order to keep the members' identifiers and associated information. More...

virtual ~MembershipControl ()
 Destructor. More...

void endMembers ()
 Purge all RTPSource structures, the hash table and the list of sources. More...

RTPSourcegetSourceBySSRC (uint32 ssrc, bool create=false)
 Get the description of a source by its ssrc identifier. More...

bool removeSource (uint32 ssrc)
 Remove the description of the source identified by ssrc. More...

const RTPSourceNullSource () const

Static Protected Attributes

const RTPSource dummysource

Detailed Description

Controls the group membership in the current session.

The use of RTCP is feasible in sessions with a few participants. However, when there are thousands or millions of participants, scalability problems impede the use of RTCP. In such situations, group membership sampling (see RFC 2762) is recommended instead of a membership table.

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.

Todo:
implement the reallocation mechanism (e.g., when the number of ssrcs per collision list goes up to 2, make the size approx. four times bigger (0.5 ssrcs per list now. when the number of ssrcs per list goes down to 0.5, decrease four times. Do not use 2 or 0.5, but `2 + something' and `0.5 - somehting'). Always jumping between prime numbers -> provide a table from 7 to many.

Author:
Federico Montesino Pouzols <p5087@quintero.fie.us.es>


Constructor & Destructor Documentation

MembershipControl::MembershipControl uint32   initial_size = 7 [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:
initial_size   an estimation of how many participants the session will consist of.

virtual MembershipControl::~MembershipControl   [protected, virtual]
 

Destructor.

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


Member Function Documentation

const RTPSource& MembershipControl::NullSource   const [inline, protected]
 

RTPSource& MembershipControl::addNewSource uint32   ssrc [protected]
 

Parameters:
ssrc   Synchronization SouRCe identifier
Returns:
the source object just created

void MembershipControl::endMembers   [protected]
 

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

const RTPSource& MembershipControl::getOrCreateSource uint32   ssrc [inline]
 

Get the description of a source by its ssrc identifier.

Parameters:
ssrc   SSRC identifier, int network order.
Returns:
the RTPSource object identified by ssrc
Return values:
a   dummy empty object if create == false and there is no source with the given ssrc identifier

const RTPSource& MembershipControl::getSource uint32   ssrc const [inline]
 

Get the description of a source by its SSRC identifier.

Parameters:
ssrc   SSRC identifier, int network order.
Returns:
the RTPSource object identified by ssrc
Return values:
a   dummy empty object if there is no source with the given ssrc identifier

Reimplemented in RTPQueue.

RTPSource& MembershipControl::getSourceBySSRC uint32   ssrc,
bool   create = false
[protected]
 

Get the description of a source by its ssrc identifier.

Parameters:
ssrc   SSRC identifier, int network order.
create   whether to create a new source if not found
Returns:
the RTPSource object identified by ssrc
Return values:
a   dummy empty object if create == false and there is no source with the given ssrc identifier

bool MembershipControl::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.


Member Data Documentation

const RTPSource MembershipControl::dummysource [static, protected]
 


The documentation for this class was generated from the following file:
Generated at Sat Nov 3 09:44:13 2001 for ccRTP by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001