WTFIT
Public Types | Public Member Functions | Protected Attributes | List of all members
wtfit::Debug Class Reference

Minimalist debugging class. More...

#include <Debug.h>

Inheritance diagram for wtfit::Debug:
wtfit::CommandLineParser wtfit::CommandLineParser::CommandLineArgument wtfit::FiberSurface wtfit::Geometry wtfit::JacobiSet< dataTypeU, dataTypeV > wtfit::OneSkeleton wtfit::ReebSpace wtfit::ScalarFieldCriticalPoints< dataType > wtfit::ThreeSkeleton wtfit::TwoSkeleton wtfit::UnionFind wtfit::Wrapper wtfit::ZeroSkeleton

Public Types

enum  debugPriority {
  fatalMsg, timeMsg, memoryMsg, infoMsg,
  detailedInfoMsg, advancedInfoMsg
}
 

Public Member Functions

 Debug ()
 
virtual ~Debug ()
 
virtual const int dMsg (ostream &stream, string msg, const int &debugLevel=infoMsg) const
 
const int err (const string msg, const int &debugLevel=infoMsg) const
 
const int msg (const char *msg, const int &debugLevel=infoMsg) const
 
virtual const int setDebugLevel (const int &debugLevel)
 
int setThreadNumber (const int threadNumber)
 
int setWrapper (const Wrapper *wrapper)
 

Protected Attributes

bool lastObject_
 
int debugLevel_
 
int threadNumber_
 
Wrapperwrapper_
 

Detailed Description

Minimalist debugging class.

Author
Julien Tierny julie.nosp@m.n.ti.nosp@m.erny@.nosp@m.lip6.nosp@m..fr
Date
February 2011.

Debug provides a few mechanisms to handle debugging messages at a global and local scope, time and memory measurements, etc. Each wtfit class should inheritate from it.

Member Enumeration Documentation

Enumerator
fatalMsg 
timeMsg 
memoryMsg 
infoMsg 
detailedInfoMsg 
advancedInfoMsg 

Constructor & Destructor Documentation

Debug::Debug ( )
Debug::~Debug ( )
virtual

Member Function Documentation

const int Debug::dMsg ( ostream &  stream,
string  msg,
const int &  debugLevel = infoMsg 
) const
virtual

Send a debug message to a stream with a priority debugLevel (lower means higher priority). If the global debug level for the program is set to 0, the program should be completely quiet. So the '0' priority should only be reserved for fatal errors.

Parameters
streamOutput stream.
msgDebug message (can contain std::endl characters).
debugLevelPriority of the message.
Returns
Returns 0 upon success, negative values otherwise.
See also
msg(), err()
const int Debug::err ( const string  msg,
const int &  debugLevel = infoMsg 
) const

Wrapper for dMsg() that sends a debug message to the standard error output stream.

Returns
Returns 0 upon success, negative values otherwise.
See also
dMsg(), msg()
const int Debug::msg ( const char *  msg,
const int &  debugLevel = infoMsg 
) const

Wrapper for dMsg() that sends a debug message to the standard output stream.

Returns
Returns 0 upon success, negative values otherwise.
See also
dMsg(), msg()
const int Debug::setDebugLevel ( const int &  debugLevel)
virtual

Set the debug level of a particular object. The global variable globalDebugLevel_ will over-ride this setting if it has a lower value.

Returns
Returns 0 upon success, negative values otherwise.
int wtfit::Debug::setThreadNumber ( const int  threadNumber)
inline
int Debug::setWrapper ( const Wrapper wrapper)

Specify a pointer to a calling object that wraps the current class deriving from wtfit::Debug.

This function is useful to pass the execution context (debug level, number of threads, etc.) from a wrapper to a baseCode object.

Parameters
wrapperPointer to the wrapping object.
Returns
Returns 0 upon success, negative values otherwise.
See also
vtkBlank

Member Data Documentation

int wtfit::Debug::debugLevel_
mutableprotected
bool wtfit::Debug::lastObject_
protected
int wtfit::Debug::threadNumber_
mutableprotected
Wrapper* wtfit::Debug::wrapper_
protected

The documentation for this class was generated from the following files: