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
const RTPSourcegetOrCreateSource (uint32 ssrc)

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 ()
void endMembers ()
RTPSourcegetSourceBySSRC (uint32 ssrc, bool create=false)
bool removeSource (uint32 ssrc)
const RTPSourceNullSource () const

Static Protected Attributes

const RTPSource dummysource

Private Methods

 MembershipControl (const MembershipControl &o)
MembershipControl& operator= (const MembershipControl &o)

Private Attributes

uint32 SOURCE_BUCKETS
RTPSource** sources
RTPSourcefirst
RTPSourcelast

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(s):
Federico Montesino Pouzols <p5087@quintero.fie.us.es>

Definition at line 671 of file rtp.h.


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.

MembershipControl::~MembershipControl ( ) [protected, virtual]
 

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

MembershipControl::MembershipControl ( const MembershipControl & o ) [private]
 


Member Function Documentation

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

Definition at line 760 of file rtp.h.

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

Definition at line 695 of file rtp.h.

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.

Definition at line 683 of file rtp.h.

Referenced by RTPQueue::getSource().

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

Referenced by getOrCreateSource().

MembershipControl& MembershipControl::operator= ( const MembershipControl & o ) [private]
 

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

uint32 MembershipControl::SOURCE_BUCKETS [private]
 

Definition at line 774 of file rtp.h.

const RTPSource MembershipControl::dummysource [static, protected]
 

Definition at line 764 of file rtp.h.

RTPSource * MembershipControl::first [private]
 

Definition at line 777 of file rtp.h.

RTPSource * MembershipControl::last [private]
 

Definition at line 777 of file rtp.h.

RTPSource ** MembershipControl::sources [private]
 

Definition at line 775 of file rtp.h.


The documentation for this class was generated from the following file:
Generated at Fri Oct 5 10:28:26 2001 for ccRTP by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001