StdOutProgressStream
-
struct StdOutProgressStream
Catches all print output.
Purpose is to be able to direct printed output into a file, to std::cout or somewhere else. StdOutProgressStream directs the prints to std::cout.
Public Functions
-
inline bool printAgain()
Whether it is time to print again.
Intended for progress prints, that would otherwise spam the output.
- Returns:
true If enough time e.g. 1sec has passed since the last call to printAgain.
- Returns:
false otherwise.
-
inline bool active() const
Should the given string be printed based on the current verbosity.
- Returns:
true if the current verbosity is smaller than the maximal verbosity for this stream.
- Returns:
false otherwise.
-
template<typename T>
inline StdOutProgressStream &operator<<(const T &sStr) Print some string-like.
- Template Parameters:
T – some printable type.
- Parameters:
sStr – message to print.
- Returns:
StdOutProgressStream& this stream.
-
inline StdOutProgressStream &operator<<(const Verbosity &xNew)
change the current verbosity of this stream.
- Parameters:
xNew – new verbosity.
- Returns:
StdOutProgressStream& this stream.
-
inline StdOutProgressStream(size_t uiVerb)
Construct a new Std Out Progress Stream object.
- Parameters:
uiVerb – the maximal verbosity for this stream.
-
inline bool printAgain()