DGtal
1.0.beta
|
#include <DGtal/base/Trace.h>
Public Member Functions | |
Trace (TraceWriter &writer) | |
~Trace () | |
void | reset () |
void | beginBlock (const std::string &keyword="") |
double | endBlock () |
std::ostream & | info () |
std::ostream & | warning () |
std::ostream & | error () |
std::ostream & | emphase () |
void | progressBar (const double currentValue, const double maximalValue) |
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 |
int | myProgressBarCurrent |
unsigned int | myProgressBarRotation |
bool | myStyle |
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.
DGtal::Trace::Trace | ( | TraceWriter & | writer | ) |
Constructor.
writer | the output writer that will receive the traces. |
DGtal::Trace::~Trace | ( | ) |
Destructor.
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
void DGtal::Trace::beginBlock | ( | const std::string & | keyword = "" | ) |
Enter a new block and increase the indentation level
keyword | contains a label to the new block |
Referenced by DGtal::VoxelComplex< KSpace, FixtureObject >::criticalCliques(), DGtal::testImplicitDigitalSurface(), and DGtal::testLightImplicitDigitalSurface().
std::ostream& DGtal::Trace::emphase | ( | ) |
Create a string with an indentation prefix for an emphased trace.
double DGtal::Trace::endBlock | ( | ) |
Leave a current block, decrease the indentation level and display the associate keyword
Referenced by DGtal::VoxelComplex< KSpace, FixtureObject >::criticalCliques(), DGtal::testImplicitDigitalSurface(), and DGtal::testLightImplicitDigitalSurface().
std::ostream& DGtal::Trace::error | ( | ) |
Create a string with an indentation prefix for an error trace. the string is postfixed by the keyword "[ERR]"
Referenced by DGtal::ImageFactoryFromHDF5< TImageContainer >::flushImage(), DGtal::Shortcuts< TKSpace >::getKSpace(), DGtal::GenericReader< TContainer, Tdim, TValue >::importWithColorFunctor(), DGtal::GenericReader< TContainer, 2, TValue >::importWithColorFunctor(), DGtal::GenericReader< TContainer, 2, DGtal::uint32_t >::importWithColorFunctor(), DGtal::GenericReader< TContainer, Tdim, TValue >::importWithValueFunctor(), DGtal::GenericReader< TContainer, 3, TValue >::importWithValueFunctor(), DGtal::GenericReader< TContainer, 3, DGtal::uint32_t >::importWithValueFunctor(), DGtal::GenericReader< TContainer, 2, TValue >::importWithValueFunctor(), DGtal::GenericReader< TContainer, 2, DGtal::uint32_t >::importWithValueFunctor(), DGtal::Shortcuts< TKSpace >::makeImplicitShape3D(), DGtal::Shortcuts< TKSpace >::makeLightDigitalSurface(), DGtal::functors::BasicDomainSubSampler< TDomain, TInteger, TValue >::operator()(), and DGtal::ImageFactoryFromHDF5< TImageContainer >::requestImage().
std::ostream& DGtal::Trace::info | ( | ) |
Create a string with an indentation prefix for a normal trace.
Referenced by DGtal::VoxelComplex< KSpace, FixtureObject >::criticalCliques(), DGtal::functors::SphereFittingEstimator< TSurfel, TEmbedder, TNormalVectorEstimatorCache >::eval(), DGtal::ShortcutsGeometry< TKSpace >::getCTrivialNormalVectors(), DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors(), DGtal::ShortcutsGeometry< TKSpace >::getVCMNormalVectors(), DGtal::TiledImage< TImageContainer, TImageFactory, TImageCacheReadPolicy, TImageCacheWritePolicy >::operator()(), DGtal::functors::SphereFittingEstimator< TSurfel, TEmbedder, TNormalVectorEstimatorCache >::pushSurfel(), HodgeTester< Calculus, order >::test(), DerivativeTester< Calculus, order >::test(), DGtal::testImplicitDigitalSurface(), and DGtal::testLightImplicitDigitalSurface().
bool DGtal::Trace::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Assignment.
other | the object to copy. |
void DGtal::Trace::progressBar | ( | const double | currentValue, |
const double | maximalValue | ||
) |
Display a progress bar in the terminal.
currentValue | current step of the progress bar |
maximalValue | expected maximal value (must be >0) |
Referenced by DGtal::functions::generateSimplicityTable(), and DGtal::functions::generateVoxelComplexTable().
void DGtal::Trace::reset | ( | ) |
Reset all the variables of the Trace object (indentation level and keyword stack)
void DGtal::Trace::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
std::ostream& DGtal::Trace::warning | ( | ) |
Create a string with an indentation prefix for a warning trace. the string is postfixed by the keyword "[WRNG]"
Referenced by DGtal::ConstImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV >::ConstImageAdapter(), DGtal::ShortcutsGeometry< TKSpace >::getVCMNormalVectors(), DGtal::ShortcutsGeometry< TKSpace >::getVectorsAngleDeviation(), DGtal::Image< TImageContainer >::Image(), DGtal::ImageAdapter< TImageContainer, TNewDomain, TFunctorD, TNewValue, TFunctorV, TFunctorVm1 >::ImageAdapter(), DGtal::Shortcuts< TKSpace >::makeIdxDigitalSurface(), DGtal::Shortcuts< TKSpace >::makeLightDigitalSurface(), DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::operator()(), 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 |
|
private |
|
private |
|
private |