DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Trace.h
1
16
17
#pragma once
29
30
#if defined(Trace_RECURSES)
31
#error Recursive header files inclusion detected in Trace.h
32
#else
// defined(Trace_RECURSES)
34
#define Trace_RECURSES
35
36
#if !defined Trace_h
38
#define Trace_h
39
41
// Inclusions
42
#include <iostream>
43
#include <ostream>
44
#include <string>
45
#include <stack>
46
47
#include "DGtal/base/Config.h"
48
#include "DGtal/base/Clock.h"
49
#include "DGtal/base/TraceWriter.h"
50
#include "DGtal/base/TraceWriterTerm.h"
52
53
54
namespace
DGtal
55
{
56
58
// class Trace
73
class
Trace
74
{
75
// ----------------------- Standard services ------------------------------
76
public
:
77
79
#define TRACE_PATTERN " "
80
#define PROGRESSBARWIDTH 60
81
82
89
Trace
(
TraceWriter
& writer);
90
91
95
~Trace
();
96
101
void
reset
();
102
103
104
110
void
beginBlock
(
const
std::string &keyword =
""
);
111
117
double
endBlock
();
118
123
std::ostream &
info
();
124
130
std::ostream &
warning
();
131
132
138
std::ostream &
error
();
139
140
146
std::ostream &
emphase
();
147
154
void
progressBar
(
const
double
currentValue,
155
const
double
maximalValue);
156
157
158
// ----------------------- Interface --------------------------------------
159
public
:
160
165
void
selfDisplay
( std::ostream & out )
const
;
166
171
bool
isValid
()
const
;
172
173
// ------------------------- Protected Data ------------------------------
174
private
:
175
// ------------------------- Private Data --------------------------------
176
private
:
178
unsigned
int
myCurrentLevel
;
180
std::string
myCurrentPrefix
;
181
183
std::stack<std::string>
myKeywordStack
;
184
186
TraceWriter
&
myWriter
;
187
189
std::stack<Clock*>
myClockStack
;
190
192
int
myProgressBarCurrent
;
193
195
unsigned
int
myProgressBarRotation
;
196
198
bool
myStyle
;
199
200
// ------------------------- Hidden services ------------------------------
201
protected
:
202
203
private
:
204
210
Trace
(
const
Trace
& other );
211
218
Trace
&
operator=
(
const
Trace
& other );
219
220
221
222
223
// ------------------------- Internals ------------------------------------
224
private
:
225
226
};
// end of class Trace
227
228
235
std::ostream&
236
operator<<
( std::ostream & out,
const
Trace
&
object
);
237
238
239
}
// namespace DGtal
240
241
#include "DGtal/base/Assert.h"
242
244
// Includes inline functions
245
#include "DGtal/base/Trace.ih"
246
247
// //
249
250
#endif
// !defined Trace_h
251
252
#undef Trace_RECURSES
253
#endif
// else defined(Trace_RECURSES)
DGtal::TraceWriter
Virtual Class to implement trace writers.
Definition
TraceWriter.h:58
DGtal::Trace
implementation of basic methods to trace out messages with indentation levels.
Definition
Trace.h:74
DGtal::Trace::myClockStack
std::stack< Clock * > myClockStack
A stack to store the block clocks.
Definition
Trace.h:189
DGtal::Trace::Trace
Trace(TraceWriter &writer)
DGtal::Trace::reset
void reset()
DGtal::Trace::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::myProgressBarCurrent
int myProgressBarCurrent
Progress bar current position.
Definition
Trace.h:192
DGtal::Trace::Trace
Trace(const Trace &other)
DGtal::Trace::myCurrentPrefix
std::string myCurrentPrefix
The indentation prefix string.
Definition
Trace.h:180
DGtal::Trace::warning
std::ostream & warning()
DGtal::Trace::myCurrentLevel
unsigned int myCurrentLevel
The indentation level.
Definition
Trace.h:178
DGtal::Trace::myKeywordStack
std::stack< std::string > myKeywordStack
A stack to store the block keywords.
Definition
Trace.h:183
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::error
std::ostream & error()
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::isValid
bool isValid() const
DGtal::Trace::~Trace
~Trace()
DGtal::Trace::myStyle
bool myStyle
True if the style has changed.
Definition
Trace.h:198
DGtal::Trace::operator=
Trace & operator=(const Trace &other)
DGtal::Trace::myProgressBarRotation
unsigned int myProgressBarRotation
Progress bar rotation position.
Definition
Trace.h:195
DGtal::Trace::progressBar
void progressBar(const double currentValue, const double maximalValue)
DGtal::Trace::myWriter
TraceWriter & myWriter
A reference to the output writer.
Definition
Trace.h:186
DGtal::Trace::endBlock
double endBlock()
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
src
DGtal
base
Trace.h
Generated on
for DGtal by
1.18.0