32 MCS_DEBUG_SETUP(0,
"LocalThread");
33 Log(
MCS_OK( MSG_THREAD_CREATE,
"LocalThread" ));
41 Log(
MCS_OK( MSG_THREAD_DESTROY,
"LocalThread" ));
49 MCS_DEBUG_ENTER(<< this->
id());
53 if (client[i]->userID() == userid) {
60 MCS_DEBUG_LEAVE(<< this->
id());
69 MCS_DEBUG_ENTER(<< this->
id());
73 userid = d.getDestID();
75 if (userid == MCS_ID_LOCAL)
86 MCS_DEBUG_LEAVE(<< this->
id());
void(* cbwa_log)()
Pointer to a void callback function without arguments, called by hk_log().
RetValue Log(Event e)
Logging facility.
void(* cb_log)(UserThread *p, Event e)
Pointer to a callback function, called by hk_log().
Base class for MCS threaded objects.
The server side client thread.
Main server class for a MCS-based application.
void dataDispatcher()
Dispatch Data objects in the "send" vector to UserThread object's "send" vectors. ...
Record dispatch
Record of Data objects to be sent to various threads.
Hold informations about an event.
static Env * env
Pointer to the actual Env object, this can be seen in all threaded object.
Thread * parent()
Returns the address of the parent.
void sleep_ms(unsigned int millisec)
A millisecond resolution sleep function.
int max_users
How many clients can be connected at the same time.
virtual void hk_log(UserThread *p, Event e)
Virtual method called each time the BaseThread.Log() method is executed.
void wakeUpClient(Event *e=NULL)
Send a message to the client.
UserThread ** serverClients()
Returns the Server.pClient variable.
RetValue type()
Return the event type.
virtual void run()
Thread body.
Main include file for all MCS based applications.
void addField(Data *d)
Wrapper around Dynamic_Array.push.
#define MCS_STATE_RUNNING
Thread state: the separate thread is executing the run() method.
~LocalThread()
Destructor.
#define MCS_WARN(A, rest...)
Facility to easily pass all necessary parameter to an Event constructor.
A general purpose data type.
Record recv
Record of Data objects received from the client or other threads.
#define MCS_OK(A, rest...)
Facility to easily pass all necessary parameter to an Event constructor.
Record recv
Record of Data objects received from other threads.
A class to create separate threads.
bool userID2clientID(int userid, int *cid)
Search for a client ID (CID) associated with a destination ID.
int count()
Wrapper around Dynamic_Array.count.
int state()
Return the state of the thread.
LocalThread(const LocalThread &)
Declared to avoid using of default copy constructor.
Namespace for MCS library.