TTK
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ttk::Debug Class Reference

Minimalist debugging class. More...

#include <Debug.h>

Inheritance diagram for ttk::Debug:
ttk::BaseClass Octree ttk::Arc ttk::ArrayPreconditioning ttk::AssignmentAuction< dataType > ttk::AssignmentExhaustive< dataType > ttk::AssignmentMunkres< dataType > ttk::AssignmentSolver< dataType > ttk::BarycentricSubdivision ttk::BottleneckDistance ttk::CinemaImaging ttk::CinemaQuery ttk::CommandLineParser ttk::CommandLineParser::CommandLineArgument ttk::CompactTriangulationPreconditioning ttk::ConnectedComponents ttk::ContinuousScatterPlot ttk::ContourAroundPoint ttk::ContourTreeAlignment ttk::ContourTreeSimplificationMetric ttk::DepthImageBasedGeometryApproximation ttk::DimensionReduction ttk::DiscreteMorseSandwich ttk::DistanceField ttk::EigenField ttk::FiberSurface ttk::GabowTarjan ttk::GaussianPointCloud ttk::Graph ttk::HarmonicField ttk::HelloWorld ttk::Icosphere ttk::IntegralLines ttk::JacobiSet ttk::KDTree< dataType > ttk::LDistance ttk::LDistanceMatrix ttk::LowestCommonAncestor ttk::MandatoryCriticalPoints ttk::ManifoldCheck ttk::MergeTreeBarycenter ttk::MergeTreeBase ttk::MergeTreeClustering< dataType2 > ttk::MergeTreeDistance ttk::MergeTreeDistanceMatrix ttk::MergeTreeTemporalReductionDecoding ttk::MergeTreeTemporalReductionEncoding ttk::MergeTreeVisualization ttk::MeshGraph ttk::MetricDistortion ttk::MorphologicalOperators ttk::MorseSmaleComplex ttk::MorseSmaleQuadrangulation ttk::MultiresTopology ttk::MultiresTriangulation ttk::Node ttk::OneSkeleton ttk::PDBarycenter< dataType > ttk::PDClustering< dataType > ttk::PDFBounds< dataType > ttk::PDFHistograms ttk::PersistenceCurve ttk::PersistenceDiagram ttk::PersistenceDiagramAuction< dataType > ttk::PersistenceDiagramAuctionActor< dataType > ttk::PersistenceDiagramBarycenter< dataType > ttk::PersistenceDiagramClustering ttk::PersistenceDiagramDistanceMatrix ttk::PersistentSimplexPairs ttk::PlanarGraphLayout ttk::ProgramBase ttk::ProjectionFromTable ttk::QuadrangulationSubdivision ttk::RangeDrivenOctree ttk::RangeMinimumQuery< DataType > ttk::ReebSpace ttk::RipsComplex ttk::ScalarFieldCriticalPoints ttk::ScalarFieldSmoother ttk::SubLevelSetTree ttk::SurfaceGeometrySmoother ttk::ThreeSkeleton ttk::TopologicalCompression ttk::TopologicalSimplification ttk::TrackingFromFields ttk::TrackingFromOverlap ttk::TrackingFromPersistenceDiagrams ttk::TwoSkeleton ttk::UncertainDataEstimator ttk::UnionFind ttk::WebSocketIO ttk::Wrapper ttk::ZeroSkeleton ttk::cf::MergeTree ttk::dcg::DiscreteGradient ttk::ftm::FTMTree_MT ttk::ftr::Allocable ttk::ftr::Scalars< ScalarType > ttk::ftr::SuperArc ttk::lts::LocalizedTopologicalSimplification ttk::ttkCinemaImagingVTK ttkAlgorithm ttkKeyHandler ttkOBJWriter ttkOFFReader ttkOFFWriter ttkTriangulationFactory

Public Member Functions

 Debug ()
 
 ~Debug () override
 
virtual int setDebugLevel (const int &debugLevel)
 
int setWrapper (const Wrapper *wrapper) override
 
int printMsg (const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::string > &msgs, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printErr (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printWrn (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const double &memory, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::vector< std::string > > &rows, const debug::Priority &priority=debug::Priority::INFO, const bool hasHeader=true, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
void setDebugMsgPrefix (const std::string &prefix)
 
- Public Member Functions inherited from ttk::BaseClass
 BaseClass ()
 
virtual ~BaseClass ()=default
 
int getThreadNumber () const
 
virtual int setThreadNumber (const int threadNumber)
 

Protected Member Functions

int printMsgInternal (const std::string &msg, const std::string &right, const std::string &filler, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsgInternal (const std::string &msg, const debug::Priority &priority, const debug::LineMode &lineMode, std::ostream &stream=std::cout) const
 
int welcomeMsg (std::ostream &stream)
 

Protected Attributes

int debugLevel_
 
std::string debugMsgPrefix_
 
- Protected Attributes inherited from ttk::BaseClass
bool lastObject_
 
int threadNumber_
 
Wrapperwrapper_
 

Static Protected Attributes

static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

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 ttk class should inheritate from it.

Definition at line 87 of file Debug.h.

Constructor & Destructor Documentation

◆ Debug()

Debug::Debug ( )

Definition at line 13 of file Debug.cpp.

◆ ~Debug()

Debug::~Debug ( )
override

Definition at line 24 of file Debug.cpp.

Member Function Documentation

◆ printErr()

int ttk::Debug::printErr ( const std::string &  msg,
const debug::LineMode lineMode = debug::LineMode::NEW,
std::ostream &  stream = std::cerr 
) const
inline

Prints an error debug message.

Definition at line 148 of file Debug.h.

◆ printMsg() [1/11]

int ttk::Debug::printMsg ( const debug::Separator separator,
const debug::LineMode lineMode = debug::LineMode::NEW,
const debug::Priority priority = debug::Priority::INFO,
std::ostream &  stream = std::cout 
) const
inline

Prints a separator.

Definition at line 319 of file Debug.h.

◆ printMsg() [2/11]

int ttk::Debug::printMsg ( const debug::Separator separator,
const debug::Priority priority,
const debug::LineMode lineMode = debug::LineMode::NEW,
std::ostream &  stream = std::cout 
) const
inline

Prints a separator with custom priority.

Definition at line 334 of file Debug.h.

◆ printMsg() [3/11]

int ttk::Debug::printMsg ( const std::string &  msg,
const debug::Priority priority = debug::Priority::INFO,
const debug::LineMode lineMode = debug::LineMode::NEW,
std::ostream &  stream = std::cout 
) const
inline

Prints a string debug message.

Definition at line 117 of file Debug.h.

◆ printMsg() [4/11]

int ttk::Debug::printMsg ( const std::string &  msg,
const debug::Separator separator,
const debug::LineMode lineMode = debug::LineMode::NEW,
const debug::Priority priority = debug::Priority::INFO,
std::ostream &  stream = std::cout 
) const
inline

Prints a message and fills the remaining space with a separator.

Definition at line 344 of file Debug.h.

◆ printMsg() [5/11]

int ttk::Debug::printMsg ( const std::string &  msg,
const double &  progress,
const debug::LineMode lineMode = debug::LineMode::NEW,
const debug::Priority priority = debug::Priority::PERFORMANCE,
std::ostream &  stream = std::cout 
) const
inline

Prints a performance debug message with specified progress.

Definition at line 247 of file Debug.h.

◆ printMsg() [6/11]

int ttk::Debug::printMsg ( const std::string &  msg,
const double &  progress,
const debug::Priority priority,
const debug::LineMode lineMode = debug::LineMode::NEW,
std::ostream &  stream = std::cout 
) const
inline

Prints a performance debug message with specified progress and custom priority.

Definition at line 261 of file Debug.h.

◆ printMsg() [7/11]

int ttk::Debug::printMsg ( const std::string &  msg,
const double &  progress,
const double &  time,
const debug::LineMode lineMode = debug::LineMode::NEW,
const debug::Priority priority = debug::Priority::PERFORMANCE,
std::ostream &  stream = std::cout 
) const
inline

Prints a performance debug message with specified progress and time.

Definition at line 217 of file Debug.h.

◆ printMsg() [8/11]

int ttk::Debug::printMsg ( const std::string &  msg,
const double &  progress,
const double &  time,
const int &  threads,
const debug::LineMode lineMode = debug::LineMode::NEW,
const debug::Priority priority = debug::Priority::PERFORMANCE,
std::ostream &  stream = std::cout 
) const
inline

Prints a performance debug message with specified progress, time, and threads.

Definition at line 232 of file Debug.h.

◆ printMsg() [9/11]

int ttk::Debug::printMsg ( const std::string &  msg,
const double &  progress,
const double &  time,
const int &  threads,
const double &  memory,
const debug::LineMode lineMode = debug::LineMode::NEW,
const debug::Priority priority = debug::Priority::PERFORMANCE,
std::ostream &  stream = std::cout 
) const
inline

Prints a performance debug message with specified progress, time, nThreads, and memory (values can be omitted form the message by passing the value -1)

Definition at line 170 of file Debug.h.

◆ printMsg() [10/11]

int ttk::Debug::printMsg ( const std::vector< std::string > &  msgs,
const debug::Priority priority = debug::Priority::INFO,
const debug::LineMode lineMode = debug::LineMode::NEW,
std::ostream &  stream = std::cout 
) const
inline

Prints multiple string debug messages at once.

Definition at line 131 of file Debug.h.

◆ printMsg() [11/11]

int ttk::Debug::printMsg ( const std::vector< std::vector< std::string > > &  rows,
const debug::Priority priority = debug::Priority::INFO,
const bool  hasHeader = true,
const debug::LineMode lineMode = debug::LineMode::NEW,
std::ostream &  stream = std::cout 
) const
inline

Prints a table.

Definition at line 272 of file Debug.h.

◆ printMsgInternal() [1/2]

int ttk::Debug::printMsgInternal ( const std::string &  msg,
const debug::Priority priority,
const debug::LineMode lineMode,
std::ostream &  stream = std::cout 
) const
inlineprotected

Internal debug method that actually prints messages.

Definition at line 412 of file Debug.h.

◆ printMsgInternal() [2/2]

int ttk::Debug::printMsgInternal ( const std::string &  msg,
const std::string &  right,
const std::string &  filler,
const debug::Priority priority = debug::Priority::INFO,
const debug::LineMode lineMode = debug::LineMode::NEW,
std::ostream &  stream = std::cout 
) const
inlineprotected

Internal debug method that formats debug messages.

Definition at line 383 of file Debug.h.

◆ printWrn()

int ttk::Debug::printWrn ( const std::string &  msg,
const debug::LineMode lineMode = debug::LineMode::NEW,
std::ostream &  stream = std::cerr 
) const
inline

Prints a warning debug message.

Definition at line 158 of file Debug.h.

◆ setDebugLevel()

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.

Reimplemented in ttk::ftm::FTMTree_CT, ttk::MandatoryCriticalPoints, ttk::MultiresTriangulation, ttk::Triangulation, ttk::cf::MergeTree, and ttk::ftr::FTRGraph< ScalarType, triangulationType >.

Definition at line 128 of file Debug.cpp.

◆ setDebugMsgPrefix()

void ttk::Debug::setDebugMsgPrefix ( const std::string &  prefix)
inline

Sets the prefix that will be print at the beginning of every debug message.

Definition at line 361 of file Debug.h.

◆ setWrapper()

int Debug::setWrapper ( const Wrapper wrapper)
overridevirtual

Specify a pointer to a calling object that wraps the current class deriving from ttk::BaseClass.

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

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

Reimplemented from ttk::BaseClass.

Reimplemented in ttk::Triangulation.

Definition at line 136 of file Debug.cpp.

◆ welcomeMsg()

int Debug::welcomeMsg ( std::ostream &  stream)
protected

Definition at line 34 of file Debug.cpp.

Member Data Documentation

◆ debugLevel_

int ttk::Debug::debugLevel_
mutableprotected

Definition at line 373 of file Debug.h.

◆ debugMsgPrefix_

std::string ttk::Debug::debugMsgPrefix_
protected

Definition at line 377 of file Debug.h.

◆ lastLineMode

COMMON_EXPORTS ttk::debug::LineMode ttk::Debug::lastLineMode = ttk::debug::LineMode::NEW
staticprotected

Definition at line 375 of file Debug.h.


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