YANE-Framework 1.1.0
Public Member Functions | Protected Attributes

yane::Utils::DebugClient Class Reference

DebugClient class. More...

Collaboration diagram for yane::Utils::DebugClient:
[legend]

List of all members.

Public Member Functions

 DebugClient (DebugMaster *master, const std::string &clientname)
 Constructor.
 DebugClient (const DebugClient &input)
 Copy Constructor.
std::string name () const
 Get Name.
DebugClientoperator= (const DebugClient &input)
 assignment operator
void sendDebugInfo (std::string message, std::string dataname="", void *data=0, int datasize=0, int datatype=0, int level=0)
 Adds a debug message and data to the master.
void sendDebugInfo (const char *message, const char *dataname=0, void *data=0, int datasize=0, int datatype=0, int level=0)
 Adds a debug message and data to the master.
virtual void sendDebugMessage (const std::string &message, int debuglevel)
 Submit a debugmessage.
virtual void sendDebugMessageDouble (const std::string &message, const std::string &varname, int length, double *data, int debuglevel)
 Submit a debugmessage with doublevalued data.
virtual void sendDebugMessageInt (const std::string &message, const std::string &varname, int length, int *data, int debuglevel)
 Submit a debugmessage with integervalued data.
virtual void sendDebugMessageString (const std::string &message, const std::string &varname, const char *data, int debuglevel)
 Submit a debugmessage with textstring data.
 ~DebugClient ()
 Destructor.

Protected Attributes

DebugMaster_master

Detailed Description

See also:
DebugMaster This class uses a DebugMaster to debug information. Usually this class is used as the following example :
                 RTClock::RTClock *clock = new RTClock::RTClock();
                 DebugMasterConsole::DebugMasterConsole *master = new DebugMasterConsole::DebugMasterConsole(clock, 90);
                 DebugClient::DebugClient *debug = master->newClient("Main");
                 debug->sendDebugInfo("Testmessage", 0, 0, 0, 0, 6);
                 debug->sendDebugInfo("Testmessage");
                 delete clock;
                 delete master;
                 delete debug;
Every program has usually only one DebugMaster and more than one DebugClient (e.g. threads have their own DebugClient, ...).

Constructor & Destructor Documentation

LIB_EXPORT yane::Utils::DebugClient::DebugClient ( DebugMaster master,
const std::string &  clientname 
)

Creates a new DebugClient object. You should use master->newClient instead.

Parameters:
masterAssociated master
clientnameName of the client, is shown in the debug messages.
LIB_EXPORT yane::Utils::DebugClient::DebugClient ( const DebugClient input)

Creates a new DebugClient object.

Parameters:
inputDebugClient
LIB_EXPORT yane::Utils::DebugClient::~DebugClient ( )

Destroys the object.


Member Function Documentation

LIB_EXPORT std::string yane::Utils::DebugClient::name ( ) const

Returns name of the Client

Returns:
name of the client
LIB_EXPORT yane::Utils::DebugClient & yane::Utils::DebugClient::operator= ( const DebugClient input)

assignment operator

Parameters:
inputDebugClient
Returns:
DebugClient
LIB_EXPORT void yane::Utils::DebugClient::sendDebugInfo ( const char *  message,
const char *  dataname = 0,
void *  data = 0,
int  datasize = 0,
int  datatype = 0,
int  level = 0 
)

Adds a debug message and data to the master. Depending on the master the message is written to file (DebugMasterFile) or Console (DebugMasterConsole).

Parameters:
messageDebug message
datanameName of the data
dataPointer to the data
datasizeSize of the data
datatypeType of the data
levelDebug level
LIB_EXPORT void yane::Utils::DebugClient::sendDebugInfo ( std::string  message,
std::string  dataname = "",
void *  data = 0,
int  datasize = 0,
int  datatype = 0,
int  level = 0 
)

Adds a debug message and data to the master. Depending on the master the message is written to file (DebugMasterFile) or Console (DebugMasterConsole).

Parameters:
messageDebug message
datanameName of the data
dataPointer to the data
datasizeSize of the data
datatypeType of the data
levelDebug level
LIB_EXPORT void yane::Utils::DebugClient::sendDebugMessage ( const std::string &  message,
int  debuglevel 
) [virtual]

Added for convenient handling

Parameters:
messageMessage which is debugged
debuglevelLevel with which the message is debugged.
LIB_EXPORT void yane::Utils::DebugClient::sendDebugMessageDouble ( const std::string &  message,
const std::string &  varname,
int  length,
double *  data,
int  debuglevel 
) [virtual]

Added for convenient handling

Parameters:
messageMessage which is debugged
varnameData name
lengthLength of data array
dataData which is added.
debuglevelLevel with which the message is debugged.
LIB_EXPORT void yane::Utils::DebugClient::sendDebugMessageInt ( const std::string &  message,
const std::string &  varname,
int  length,
int *  data,
int  debuglevel 
) [virtual]

Added for convenient handling

Parameters:
messageMessage which is debugged
varnameData name
lengthLength of data array
dataData which is added.
debuglevelLevel with which the message is debugged.
LIB_EXPORT void yane::Utils::DebugClient::sendDebugMessageString ( const std::string &  message,
const std::string &  varname,
const char *  data,
int  debuglevel 
) [virtual]

Added for convenient handling

Parameters:
messageMessage which is debugged
varnameData name
dataPointer to an additional nullterminated character array, that has to be stored as data
debuglevelLevel with which the message is debugged.

Member Data Documentation

< Master this object is using. Name of the client.