23 #ifndef __MLPACK_CORE_UTIL_PREFIXEDOUTSTREAM_HPP
24 #define __MLPACK_CORE_UTIL_PREFIXEDOUTSTREAM_HPP
31 #include <boost/lexical_cast.hpp>
32 #include <boost/utility/enable_if.hpp>
33 #include <boost/type_traits.hpp>
79 destination(destination),
139 typename boost::disable_if<
146 typename boost::enable_if<
149 typename boost::disable_if<
150 HasToString<T, std::
string(T::*)() const>
156 typename boost::enable_if<
159 typename boost::enable_if<
160 HasToString<T, std::
string(T::*)() const>
194 #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.
void CallBaseLogic(const T &s, typename boost::disable_if< boost::is_class< T > >::type *=0)
This handles forwarding all primitive types transparently.
PrefixedOutStream & operator<<(bool val)
Write a bool to the stream.
bool fatal
If true, the application will terminate with an error code 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.
#define HAS_MEM_FUNC(FUNC, NAME)
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...