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

yane::Utils::DebugMasterTextStream Class Reference

DebugMaster that writes to a textstream. More...

Inheritance diagram for yane::Utils::DebugMasterTextStream:
[legend]
Collaboration diagram for yane::Utils::DebugMasterTextStream:
[legend]

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)
 Add some messages and/or data.
 DebugMasterTextStream (RTClock *clock, std::ostream *textstream, int textwidth=80)
 Constructor.
virtual int level ()
 Get current level.
virtual DebugClientnewClient (const char *clientname)
 Creates new DebugClient.
virtual void setLevel (int level)
 Sets a new level.

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

RTClock_clock
Mutex_mutex
int _textwidth

Detailed Description

See also:
DebugMaster This class extends DebugMaster and adds the functionality to write to a textstream.The output looks like the following:

Without appended data:
                 0.000365 | [Client name] Message
With appended data:
                 0.000365 | [Client name] Message
                 ------------------------------ DATA: Dataname -------------------------------
                 Data

Constructor & Destructor Documentation

LIB_EXPORT yane::Utils::DebugMasterTextStream::DebugMasterTextStream ( RTClock clock,
std::ostream *  textstream,
int  textwidth = 80 
)

This creates the DebugMasterTextStream object.

Parameters:
clockClock the current program is using.
textstreamTextstream the data is written into.
textwidthWidth after which a line is wrapped.

Member Function Documentation

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

Overwrites the addDebugInfo class from DebugMaster to write the data to a textstream.

Parameters:
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

Implements yane::Utils::DebugMaster.

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

Formats the appended data of a debug message.

Parameters:
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.
Returns:
Formated string Mutex this object is using.
LIB_EXPORT int yane::Utils::DebugMaster::level ( ) [virtual, inherited]

Get the current level

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

Creates new DebugClient with current master as master.

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

Sets a new level

Parameters:
levelNew debug level

Member Data Documentation

RTClock* yane::Utils::DebugMaster::_clock [protected, inherited]

Current debug level.

Mutex* yane::Utils::DebugMaster::_mutex [protected, inherited]

Clock this object is using.

< Width after which a line is wrapped. Textstream this object is using.