15 #ifndef __MLPACK_CORE_UTIL_PREFIXEDOUTSTREAM_HPP
16 #define __MLPACK_CORE_UTIL_PREFIXEDOUTSTREAM_HPP
24 #include <boost/lexical_cast.hpp>
25 #include <boost/utility/enable_if.hpp>
26 #include <boost/type_traits.hpp>
75 destination(destination),
161 #include "prefixedoutstream_impl.hpp"
std::ostream & destination
The output stream that all data is to be sent too; example: std::cout.
Linear algebra utility functions, generally performed on matrices or vectors.
PrefixedOutStream & operator<<(bool val)
Write a bool to the stream.
bool fatal
If true, a std::runtime_error exception will be thrown when a CR is encountered.
std::string prefix
Contains the prefix we must prepend to each line.
PrefixedOutStream(std::ostream &destination, const char *prefix, bool ignoreInput=false, bool fatal=false)
Set up the PrefixedOutStream.
bool ignoreInput
Discards input, prints nothing if true.
bool carriageReturned
If true, the previous call to operator<< encountered a CR, and a prefix will be necessary.
void BaseLogic(const T &val)
Conducts the base logic required in all the operator << overloads.
void PrefixIfNeeded()
Output the prefix, but only if we need to and if we are allowed to.
Allows us to output to an ostream with a prefix at the beginning of each line, in the same way we wou...