|
|
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
~JBStreamSet ()
| ~JBStreamSet |
[virtual]
Destructor. Delete the owned streams. Remove from owner
inline ObjList& clients ()
| clients |
Retrieve the list of clients. Make sure the set is locked before calling this method
Returns: The list of clients
bool add (JBStream* client)
| add |
[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
Parameters:
client | The stream to append |
Returns: True on success, false if there is no more room in this set
bool remove (JBStream* client, bool delObj = true)
| remove |
[virtual]
Remove a stream from set
Parameters:
client | The stream to remove |
delObj | True to release the stream, false to remove it from list without releasing it |
Returns: True on success, false if not found
unsigned int dropAll (const JabberID& local = JabberID::empty(),
const JabberID& remote = JabberID::empty(),
XMPPError::Type error = XMPPError::NoError, const char* reason = 0)
| dropAll |
Terminate all streams matching local/remote jid
Parameters:
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 |
Returns: The number of streams terminated
void run ()
| run |
Process the list. Returns as soon as there are no more streams in the list
bool start ()
| start |
[virtual]
Start running
Returns: True on success
void stop ()
| stop |
[virtual]
Stop running
JBStreamSet (JBStreamSetList* owner)
| JBStreamSet |
[protected]
Constructor
Parameters:
owner | The list owning this set |
bool process (JBStream& stream)
| process |
[protected pure virtual]
This method is called from run() with the list unlocked and stream's reference counter increased. A specialized processor must implement this method
Parameters:
stream | The stream to process |
Returns: True if something was processed
bool m_changed | m_changed |
[protected]
bool m_exiting | m_exiting |
[protected]
JBStreamSetList* m_owner | m_owner |
[protected]
ObjList m_clients | m_clients |
[protected]
Generated by: paulc on bussard on Fri Apr 1 18:17:10 2011, using kdoc 2.0a54. |