YANE-Framework 1.1.0
Public Member Functions | Protected Member Functions | Protected Attributes

yane::Utils::DebugMaster Class Reference

DebugMaster base class. More...

Inheritance diagram for yane::Utils::DebugMaster:
Collaboration diagram for yane::Utils::DebugMaster:

List of all members.

Public Member Functions

virtual void addDebugInfo (std::string clientname, std::string message, std::string dataname, void *data, int datasize, int datatype, int level)=0
 Add some messages and/or data.
 DebugMaster (RTClock *clock)
virtual int level ()
 Get current level.
virtual DebugClientnewClient (const char *clientname)
 Creates new DebugClient.
virtual void setLevel (int level)
 Sets a new level.
virtual ~DebugMaster ()

Protected Member Functions

virtual std::string formatData (void *data, int datalength, int datatype, int margin, int textwidth, int doubleprec, bool doublesci)
 Format appended data.

Protected Attributes


Detailed Description

Class to use and create the DebugMaster. A DebugMaster is used to debug data or output messages. Usually there is one DebugMaster in every program and at least (usually more than) one DebugClient. This class is used as following:

Constructor & Destructor Documentation

LIB_EXPORT yane::Utils::DebugMaster::DebugMaster ( RTClock clock)

This creates the DebugMaster object.

clockClock the current program is using.
LIB_EXPORT yane::Utils::DebugMaster::~DebugMaster ( ) [virtual]

Destroys the object.

Member Function Documentation

virtual void yane::Utils::DebugMaster::addDebugInfo ( std::string  clientname,
std::string  message,
std::string  dataname,
void *  data,
int  datasize,
int  datatype,
int  level 
) [pure virtual]

Add some messages and/or data. Needs to be overwritten to provide your own functionality.

clientnameClient from which the debug message was forwarded.
messageDebug message
datanameName of the data
dataPointer to the data
datasizeSize of the data
datatypeType of the data
levelDebug level of the data

Implemented in yane::Utils::DebugMasterTextStream.

LIB_EXPORT string yane::Utils::DebugMaster::formatData ( void *  data,
int  datalength,
int  datatype,
int  margin,
int  textwidth,
int  doubleprec,
bool  doublesci 
) [protected, virtual]

Formats the appended data of a debug message.

dataPointer to the appended data.
datalengthLength of the data.
datatypeType of the data.
marginSpace after which the message starts.
textwidthWidth after which a line is wrapped.
doubleprecPrecision of a double.
doublesciWether fixed or scientific is used.
Formated string Mutex this object is using.
LIB_EXPORT int yane::Utils::DebugMaster::level ( ) [virtual]

Get the current level

Current debug level
LIB_EXPORT yane::Utils::DebugClient * yane::Utils::DebugMaster::newClient ( const char *  clientname) [virtual]

Creates new DebugClient with current master as master.

clientnameName of the client which is displayed in the debug messages.
LIB_EXPORT void yane::Utils::DebugMaster::setLevel ( int  level) [virtual]

Sets a new level

levelNew debug level

Member Data Documentation

Current debug level.

Clock this object is using.