# class JBStreamSetList | A list of stream sets. More...
Full name | `TelEngine::JBStreamSetList`
Definition | `#include <libs/yjabber/yatejabber.h>`
Inherits | TelEngine::Mutex [public ], TelEngine::RefObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- JBStreamSetList (JBEngine* engine, unsigned int max, unsigned int sleepMs, const char* name)
- inline ObjList& sets ()
- virtual ~JBStreamSetList ()
- inline unsigned int maxStreams () const
- inline unsigned int streamCount () const
- inline JBEngine* engine () const
- bool add (JBStream* client)
- void remove (JBStream* client, bool delObj = true)
- void stop (JBStreamSet* set = 0, bool waitTerminate = true)
- virtual const String& toString () const

#### Protected Methods

- virtual void destroyed ()
- void remove (JBStreamSet* set)
- virtual JBStreamSet* build ()

#### Protected Members

- JBEngine* m_engine
- String m_name
- unsigned int m_max
- unsigned int m_sleepMs
- ObjList m_sets

## Detailed Description

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

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

Constructor

Parameters:

engine | Engine owning this list
max | Maximum streams per set (0 for maximum possible)
sleepMs | Time to sleep when idle
name | List name (for debugging purposes)

inline ObjList& sets () | ### sets

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

Returns: The stream set list

~JBStreamSetList () | ### ~JBStreamSetList

[virtual]

Destructor

inline unsigned int maxStreams () | ### maxStreams

[const]

Retrieve the maximum number of streams per set

Returns: The maximum number of streams per set

inline unsigned int streamCount () | ### streamCount

[const]

Retrieve the number of streams in all sets

Returns: The number of streams in all sets

inline JBEngine* engine () | ### engine

[const]

Retrieve the engine owning this list

Returns: The engine owning this list

bool add (JBStream* client) | ### add

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

Parameters:

client | The stream to add

Returns: True on success

void remove (JBStream* client, bool delObj = true) | ### remove

Remove a stream from list

Parameters:

client | The stream to remove
delObj | True to release the stream, false to remove it from list without releasing it

void stop (JBStreamSet* set = 0, bool waitTerminate = true) | ### stop

Stop one set or all sets

Parameters:

set | The set to stop, 0 to stop all
waitTerminate | True to wait for all streams to terminate

const String& toString () | ### toString

[const virtual]

Get the string representation of this list

Returns: The list name

Reimplemented from GenObject.

void destroyed () | ### destroyed

[protected virtual]

Stop all sets. Release memory

Reimplemented from RefObject.

void remove (JBStreamSet* set) | ### remove

[protected]

Remove a set from list without deleting it

Parameters:

set | The set to remove

JBStreamSet* build () | ### build

[protected virtual]

Build a specialized stream set. Descendants must override this method

Returns: JBStreamSet pointer or 0

JBEngine* m_engine | ### m_engine

[protected]

String m_name | ### m_name

[protected]

unsigned int m_max | ### m_max

[protected]

unsigned int m_sleepMs | ### m_sleepMs

[protected]

ObjList m_sets | ### m_sets

[protected]

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.