Yate
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

JBThread Class Reference

A Jabber thread that can be added to a list of threads. More...

#include <yatejabber.h>

Inheritance diagram for JBThread:
GenObject

List of all members.

Public Types

enum  Type {
  StreamConnect, EngineReceive, EngineProcess, Presence,
  Jingle, Message
}

Public Member Functions

virtual ~JBThread ()
Type type () const
virtual void cancelThread (bool hard=false)=0

Static Public Member Functions

static bool start (Type type, JBThreadList *list, void *client, int sleep=0, int prio=Thread::Normal)

Protected Member Functions

 JBThread (Type type, JBThreadList *owner, void *client, int sleep=2)
void runClient ()
void * client ()

Detailed Description

A Jabber thread that can be added to a list of threads.

This class holds encapsulates a private library thread


Member Enumeration Documentation

enum Type

Thread type enumeration. Used to do a specific client processing


Constructor & Destructor Documentation

virtual ~JBThread ( ) [virtual]

Destructor. Remove itself from the owner's list

JBThread ( Type  type,
JBThreadList owner,
void *  client,
int  sleep = 2 
) [protected]

Constructor. Append itself to the owner's list

Parameters:
typeThread type
ownerThe list owning this thread
clientThe client to process
sleepTime to sleep if there is nothing to do

Member Function Documentation

virtual void cancelThread ( bool  hard = false) [pure virtual]

Cancel (terminate) this thread

Parameters:
hardKill the thread the hard way rather than just setting an exit check marker
void* client ( ) [inline, protected]

Get the stream's client

Returns:
The stream's client
void runClient ( ) [protected]

Process the client

static bool start ( Type  type,
JBThreadList list,
void *  client,
int  sleep = 0,
int  prio = Thread::Normal 
) [static]

Create and start a private thread

Parameters:
typeThread type
listThe list owning this thread
clientThe client to process
sleepTime to sleep if there is nothing to do, zero to use platform default
prioThread priority, defaults to Normal
Returns:
False if failed to start the requested thread
Type type ( ) const [inline]

Get the type of this thread

Returns:
Thread type as enumeration

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