l4snd::ThreadDictionary Class Reference

Simple helper class to keep nick names of running thread for the log messages. More...

Collaboration diagram for l4snd::ThreadDictionary:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void add (Handle handle, const std::string &nickname="")
 Adds a new thread.
void remove (Handle handle)
 Removes a thread.
unsigned numThreads () const
 Gets the number of registered threads.
std::string getNickname (Handle handle) const
 Gets the nickname of a thread.

Static Public Member Functions

static std::string getCurrentNickname ()
 Gets the nickname of the currently running thread.
static ThreadDictionaryget ()
 Gets the pointer to the dictionary singleton.
static Handle getCurrentHandle ()
 Gets the current thread handle.


Detailed Description

Simple helper class to keep nick names of running thread for the log messages.

Definition at line 48 of file threaddict.h.


Member Function Documentation

void l4snd::ThreadDictionary::add ( Handle  handle,
const std::string &  nickname = "" 
)

Adds a new thread.

Parameters:
handle operating system specific handle
nickname nickname for this handle. If empty, the numerical handle value is taken

Definition at line 59 of file threaddict.cpp.

References l4snd::number().

void l4snd::ThreadDictionary::remove ( Handle  handle  ) 

Removes a thread.

Parameters:
handle operating system specific handle

Definition at line 72 of file threaddict.cpp.

unsigned l4snd::ThreadDictionary::numThreads (  )  const

Gets the number of registered threads.

Returns:
thread count

Definition at line 85 of file threaddict.cpp.

std::string l4snd::ThreadDictionary::getNickname ( Handle  handle  )  const

Gets the nickname of a thread.

Returns:
nickname

Definition at line 94 of file threaddict.cpp.

std::string l4snd::ThreadDictionary::getCurrentNickname (  )  [static]

Gets the nickname of the currently running thread.

Returns:
nickname

Definition at line 120 of file threaddict.cpp.

ThreadDictionary * l4snd::ThreadDictionary::get (  )  [static]

Gets the pointer to the dictionary singleton.

Returns:
pointer to dictionary

Definition at line 126 of file threaddict.cpp.

ThreadDictionary::Handle l4snd::ThreadDictionary::getCurrentHandle (  )  [static]

Gets the current thread handle.

Returns:
thread handle

Definition at line 107 of file threaddict.cpp.


The documentation for this class was generated from the following files:
Generated on Sat Nov 24 14:41:27 2007 for log4sendpp by  doxygen 1.5.3