TTK
Loading...
Searching...
No Matches
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 ttk::RangeMinimumQuery< int > Octree ttk::Arc ttk::ArrayPreconditioning ttk::AssignmentAuction< dataType > ttk::AssignmentExhaustive< dataType > ttk::AssignmentMunkres< dataType > ttk::AssignmentSolver< dataType > ttk::BarycentricSubdivision ttk::BottleneckDistance ttk::BranchMappingDistance ttk::CinemaImaging ttk::CinemaQuery ttk::ClusteringMetrics 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::DistanceMatrixDistortion ttk::EigenField ttk::ExTreeM ttk::FiberSurface ttk::GabowTarjan ttk::GaussianPointCloud ttk::Graph ttk::HarmonicField ttk::HelloWorld ttk::Icosphere ttk::Identifiers ttk::IntegralLines ttk::JacobiSet ttk::LDistance ttk::LDistanceMatrix ttk::LegacyTopologicalSimplification ttk::LowestCommonAncestor ttk::MandatoryCriticalPoints ttk::ManifoldCheck ttk::MarchingTetrahedra ttk::MergeTreeAutoencoder ttk::MergeTreeAutoencoderDecoding ttk::MergeTreeAxesAlgorithmBase ttk::MergeTreeBarycenter ttk::MergeTreeBase ttk::MergeTreeClustering< dataType2 > ttk::MergeTreeDistance ttk::MergeTreeDistanceMatrix ttk::MergeTreePrincipalGeodesics ttk::MergeTreePrincipalGeodesicsBase ttk::MergeTreePrincipalGeodesicsDecoding ttk::MergeTreeTemporalReduction ttk::MergeTreeTemporalReductionDecoding ttk::MergeTreeVisualization ttk::MeshGraph ttk::MetricDistortion ttk::MorphologicalOperators ttk::MorseSmaleComplex ttk::MorseSmaleQuadrangulation ttk::MultiresTopology ttk::MultiresTriangulation ttk::Node ttk::OneSkeleton ttk::PDBarycenter ttk::PDClustering ttk::PDFBounds< dataType > ttk::PDFHistograms ttk::PathCompression ttk::PathMappingDistance ttk::PersistenceCurve ttk::PersistenceDiagram ttk::PersistenceDiagramAuction ttk::PersistenceDiagramBarycenter ttk::PersistenceDiagramClustering ttk::PersistenceDiagramDistanceMatrix ttk::PersistentSimplexPairs ttk::PlanarGraphLayout ttk::ProgramBase ttk::ProjectionFromTable ttk::Quadrangulation ttk::QuadrangulationSubdivision ttk::RangeDrivenOctree ttk::RangeMinimumQuery< DataType > ttk::ReebSpace ttk::RipsComplex ttk::RipsPersistenceDiagram ttk::ScalarFieldCriticalPoints ttk::ScalarFieldSmoother ttk::SignedDistanceField ttk::SubLevelSetTree ttk::SurfaceGeometrySmoother ttk::ThreeSkeleton ttk::TopoMap ttk::TopologicalCompression ttk::TopologicalOptimization 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 ttkMergeTreeBase 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_
 
std::string debugMsgNamePrefix_
 
- 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 88 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 149 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 320 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 336 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 118 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 346 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 248 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 262 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 218 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 233 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 171 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 132 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 273 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 419 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 390 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 159 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 147 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 364 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 155 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 379 of file Debug.h.

◆ debugMsgNamePrefix_

std::string ttk::Debug::debugMsgNamePrefix_
protected

Definition at line 384 of file Debug.h.

◆ debugMsgPrefix_

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

Definition at line 383 of file Debug.h.

◆ lastLineMode

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

Definition at line 381 of file Debug.h.


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