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 () |
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 |
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 ~JBStreamSet | ( | ) | [virtual] |
Destructor. Delete the owned streams. Remove from owner
JBStreamSet | ( | JBStreamSetList * | owner | ) | [protected] |
Constructor
owner | The list owning this set |
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 |
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 |
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 JBStreamSetReceive, and JBStreamSetProcessor.
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 bool start | ( | ) | [virtual] |
Start running
virtual void stop | ( | ) | [virtual] |
Stop running