DGtal
0.6.devel
|
#include <Trace.h>
Public Member Functions | |
Trace (TraceWriter &writer) | |
~Trace () | |
void | reset () |
void | beginBlock (const std::string &keyword="") |
long | endBlock () |
std::ostream & | info () const |
std::ostream & | warning () const |
std::ostream & | error () const |
std::ostream & | emphase () const |
void | progressBar (const double currentValue, const double maximalValue) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Member Functions | |
Trace (const Trace &other) | |
Trace & | operator= (const Trace &other) |
Private Attributes | |
unsigned int | myCurrentLevel |
std::string | myCurrentPrefix |
std::stack< std::string > | myKeywordStack |
TraceWriter & | myWriter |
std::stack< Clock * > | myClockStack |
implementation of basic methods to trace out messages with indentation levels.
Description of class 'Trace'
Aim: Trace objects use a TraceWriter to switch between terminal and file outputs. Methods postfixed with "Debug" contain no code if the compilation flag DEBUG is not set.
For usage examples, see the testtrace.cpp file.
|
inline |
Constructor.
writer | the output writer that will receive the traces. |
Constructor.
outputStream | the output stream that will receive the traces. |
|
inline |
Destructor.
Destructor.
We send a last postfixReset to prevent bugs in some TraceWriterTerm terminals.
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
|
inline |
Enter a new block and increase the indentation level
keyword | contains a label to the new block |
Definition at line 117 of file Trace.ih.
References DGtal::Clock::startClock().
Referenced by DGtal::DistanceTransformation< TSpace, TPointPredicate, p, IntegerLong >::computeFirstStep(), DGtal::VoronoiMap< TSpace, TPointPredicate, p >::computeOtherSteps(), DGtal::DistanceTransformation< TSpace, TPointPredicate, p, IntegerLong >::computeOtherSteps(), DGtal::ReverseDistanceTransformation< Image, p, IntegerShort >::computeSteps(), DGtal::testImplicitDigitalSurface(), and DGtal::testLightImplicitDigitalSurface().
|
inline |
|
inline |
Leave a current block, decrease the indentation level and display the associate keyword
Leave a current block, decrease the indentation level and display the associate keyword with ellapsed time in ms.
Definition at line 142 of file Trace.ih.
References DGtal::Clock::stopClock().
Referenced by DGtal::DistanceTransformation< TSpace, TPointPredicate, p, IntegerLong >::computeFirstStep(), DGtal::VoronoiMap< TSpace, TPointPredicate, p >::computeOtherSteps(), DGtal::DistanceTransformation< TSpace, TPointPredicate, p, IntegerLong >::computeOtherSteps(), DGtal::ReverseDistanceTransformation< Image, p, IntegerShort >::computeSteps(), DGtal::testImplicitDigitalSurface(), and DGtal::testLightImplicitDigitalSurface().
|
inline |
Create a string with an indentation prefix for an error trace. the string is postfixed by the keyword "[ERR]"
Create an output message with an indentation prefix for an emphased (bold) trace. The string is postfixed by the keyword "[ERR]"
Definition at line 187 of file Trace.ih.
Referenced by DGtal::Display3D::addPolygon(), DGtal::Display3D::addQuad(), DGtal::Display3D::addTriangle(), DGtal::ImageContainerByHashTree< TDomain, TValue, THashKey >::checkIntegrity(), DGtal::Display3DFactory::draw(), DGtal::MeshWriter< TPoint >::export2OBJ(), DGtal::MeshWriter< TPoint >::export2OFF(), DGtal::ImageContainerByHashTree< TDomain, TValue, THashKey >::getAverageCollisions(), DGtal::ImageContainerByHashTree< TDomain, TValue, THashKey >::ImageContainerByHashTree(), DGtal::LongvolReader< TImageContainer >::importLongvol(), DGtal::MeshReader< TPoint >::importOFFFile(), DGtal::MeshReader< TPoint >::importOFSFile(), DGtal::PNMReader< TImageContainer >::importPGM(), DGtal::PNMReader< TImageContainer >::importPGM3D(), DGtal::RawReader< TImageContainer >::importRaw8(), and DGtal::VolReader< TImageContainer >::importVol().
|
inline |
Create a string with an indentation prefix for a normal trace.
Definition at line 211 of file Trace.ih.
Referenced by DGtal::ImageContainerByHashTree< TDomain, TValue, THashKey >::checkIntegrity(), DGtal::SeparableMetricHelper< Point, IntegerLong, p >::hiddenBy(), DGtal::Viewer3D::keyPressEvent(), DGtal::Board2D::operator<<(), DGtal::operator>>(), DGtal::Viewer3D::postSelection(), DGtal::Board3DTo2D::saveCairo(), DGtal::Viewer3D::sortPolygonFromCamera(), DGtal::Viewer3D::sortQuadFromCamera(), DGtal::Viewer3D::sortSurfelFromCamera(), DGtal::Viewer3D::sortTriangleFromCamera(), DGtal::testImplicitDigitalSurface(), and DGtal::testLightImplicitDigitalSurface().
|
inline |
Assignment.
other | the object to copy. |
|
inline |
Display a progress bar in the terminal.
currentValue | current step of the progress bar |
maximalValue | expected maximal value |
Definition at line 218 of file Trace.ih.
|
inline |
Reset all the variables of the Trace object (indentation level and keyword stack)
Reset all the variables of the Trace object (indentation level and keyword stack).
Definition at line 99 of file Trace.ih.
|
inline |
|
inline |
Create a string with an indentation prefix for a warning trace. the string is postfixed by the keyword "[WRNG]"
Create a string with an indentation prefix for a warning trace. The string is postfixed by the keyword "[WRNG]"
Definition at line 174 of file Trace.ih.
Referenced by DGtal::DistanceTransformation< TSpace, TPointPredicate, p, IntegerLong >::checkTypesValidity(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::ConstImageAdapter(), DGtal::Display3DFactory::drawAsFaces(), DGtal::Image< TImageContainer >::Image(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::ImageAdapter(), DGtal::LongvolReader< TImageContainer >::importLongvol(), DGtal::VolReader< TImageContainer >::importVol(), DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::operator=(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::operator=(), and DGtal::Image< TImageContainer >::operator=().
|
private |
|
private |
|
private |
|
private |
|
private |