Yate
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
JBStreamSetList Class Reference

A list of stream sets. More...

#include <yatejabber.h>

Inheritance diagram for JBStreamSetList:
RefObject Mutex GenObject Lockable

List of all members.

Public Member Functions

 JBStreamSetList (JBEngine *engine, unsigned int max, unsigned int sleepMs, const char *name)
ObjListsets ()
virtual ~JBStreamSetList ()
unsigned int maxStreams () const
unsigned int streamCount () const
JBEngineengine () const
bool add (JBStream *client)
void remove (JBStream *client, bool delObj=true)
void stop (JBStreamSet *set=0, bool waitTerminate=true)
virtual const StringtoString () const

Protected Member Functions

virtual void destroyed ()
void remove (JBStreamSet *set)
virtual JBStreamSetbuild ()

Protected Attributes

JBEnginem_engine
String m_name
unsigned int m_max
unsigned int m_sleepMs
ObjList m_sets

Friends

class JBStreamSet

Detailed Description

A list of stream sets.

This class holds a list of stream sets. The purpose is to create a list of threads


Constructor & Destructor Documentation

JBStreamSetList ( JBEngine engine,
unsigned int  max,
unsigned int  sleepMs,
const char *  name 
)

Constructor

Parameters:
engineEngine owning this list
maxMaximum streams per set (0 for maximum possible)
sleepMsTime to sleep when idle
nameList name (for debugging purposes)
virtual ~JBStreamSetList ( ) [virtual]

Destructor


Member Function Documentation

bool add ( JBStream client)

Add a stream to the list. Build a new set if there is no room in existing sets

Parameters:
clientThe stream to add
Returns:
True on success
virtual JBStreamSet* build ( ) [protected, virtual]

Build a specialized stream set. Descendants must override this method

Returns:
JBStreamSet pointer or 0
virtual void destroyed ( ) [protected, virtual]

Stop all sets. Release memory

Reimplemented from RefObject.

JBEngine* engine ( ) const [inline]

Retrieve the engine owning this list

Returns:
The engine owning this list
unsigned int maxStreams ( ) const [inline]

Retrieve the maximum number of streams per set

Returns:
The maximum number of streams per set
void remove ( JBStream client,
bool  delObj = true 
)

Remove a stream from list

Parameters:
clientThe stream to remove
delObjTrue to release the stream, false to remove it from list without releasing it
void remove ( JBStreamSet set) [protected]

Remove a set from list without deleting it

Parameters:
setThe set to remove
ObjList& sets ( ) [inline]

Retrieve the stream set list. Make sure the list is locked before calling this method

Returns:
The stream set list
void stop ( JBStreamSet set = 0,
bool  waitTerminate = true 
)

Stop one set or all sets

Parameters:
setThe set to stop, 0 to stop all
waitTerminateTrue to wait for all streams to terminate
unsigned int streamCount ( ) const [inline]

Retrieve the number of streams in all sets

Returns:
The number of streams in all sets
virtual const String& toString ( ) const [virtual]

Get the string representation of this list

Returns:
The list name

Reimplemented from GenObject.


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