|
Yate
|
A set of streams to be processed in an uniform way. More...
#include <yatejabber.h>
Public Member Functions | |
| virtual | ~JBStreamSet () |
| ObjList & | clients () |
| virtual bool | add (JBStream *client) |
| virtual bool | remove (JBStream *client, bool delObj=true) |
| unsigned int | dropAll (const JabberID &local=JabberID::empty(), const JabberID &remote=JabberID::empty(), XMPPError::Type error=XMPPError::NoError, const char *reason=0) |
| void | run () |
| virtual bool | start () |
| virtual void | stop () |
Public Member Functions inherited from GenObject | |
| GenObject () | |
| virtual | ~GenObject () |
| virtual bool | alive () const |
| virtual void | destruct () |
| virtual const String & | toString () const |
| virtual const String & | traceId () const |
| virtual void * | getObject (const String &name) const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Public Member Functions inherited from Mutex | |
| Mutex (bool recursive=false, const char *name=0) | |
| Mutex (const Mutex &original) | |
| ~Mutex () | |
| Mutex & | operator= (const Mutex &original) |
| virtual bool | lock (long maxwait=-1) |
| virtual bool | unlock () |
| virtual bool | locked () const |
| const char * | owner () const |
| bool | recursive () const |
Public Member Functions inherited from Lockable | |
| virtual | ~Lockable () |
| virtual bool | check (long maxwait=-1) |
| virtual bool | unlockAll () |
Protected Member Functions | |
| JBStreamSet (JBStreamSetList *owner) | |
| virtual bool | process (JBStream &stream)=0 |
Protected Attributes | |
| bool | m_changed |
| bool | m_exiting |
| JBStreamSetList * | m_owner |
| ObjList | m_clients |
Friends | |
| class | JBStreamSetList |
Additional Inherited Members | |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Static Public Member Functions inherited from Mutex | |
| static int | count () |
| static int | locks () |
| static bool | efficientTimedLock () |
Static Public Member Functions inherited from Lockable | |
| static void | wait (unsigned long maxwait) |
| static unsigned long | wait () |
| static void | startUsingNow () |
| static void | enableSafety (bool safe=true) |
| static bool | safety () |
A set of streams to be processed in an uniform way.
This class holds a set of streams to be processed in an uniform way. This is a base class for specialized stream list processors. Its process() method should be called in its own thread
|
virtual |
Destructor. Delete the owned streams. Remove from owner
|
protected |
Constructor
| owner | The list owning this set |
References Mutex::owner().
Referenced by JBStreamSetProcessor::JBStreamSetProcessor(), and process().
|
virtual |
Add a stream to the set. The stream's reference counter will be increased. This method doesn't check if the stream is already added
| client | The stream to append |
|
inline |
Retrieve the list of clients. Make sure the set is locked before calling this method
| unsigned int dropAll | ( | const JabberID & | local = JabberID::empty(), |
| const JabberID & | remote = JabberID::empty(), | ||
| XMPPError::Type | error = XMPPError::NoError, | ||
| const char * | reason = 0 ) |
Terminate all streams matching local/remote jid
| local | Optional local jid to match |
| remote | Optional remote jid to match |
| error | Optional error to be sent to the client |
| reason | Optional error text to be sent to the client |
References JabberID::empty().
|
protectedpure virtual |
This method is called from run() with the list unlocked and stream's reference counter increased. A specialized processor must implement this method
| stream | The stream to process |
Implemented in JBStreamSetProcessor, and JBStreamSetReceive.
References JBStreamSet().
|
virtual |
Remove a stream from set
| client | The stream to remove |
| delObj | True to release the stream, false to remove it from list without releasing it |
| void run | ( | ) |
Process the list. Returns as soon as there are no more streams in the list
|
virtual |
Start running
|
virtual |
Stop running