using namespace std; #include "info.hpp" #include "verbose.hpp" /** Prints the tabs according to verbosity stored in the temporary constructed class. * \param &ost stream to extend with tabs * \return &ost stream with tabs */ ostream& Verbose::print (ostream &ost) const { for (int i=Verbosity+Info::verbosity;i--;) ost.put('\t'); //Log() << Verbose(0) << "Verbose(.) called." << endl; return ost; }; /** States whether current output message should be print or not. * Compares Verbose::Verbosity against \a verbosityLevel. * \param verbosityLevel given global level of verbosity * \return true - do output, false - don't */ bool Verbose::DoOutput(int verbosityLevel) const { return (verbosityLevel >= Verbosity+Info::verbosity); }; /** Operator for the Verbose(arg) call. * Constructs temporary a Verbose class object, wherein the verbosity is stored. * Then << is called, which calls Verbose's print which adds the tabs and returns the stream. * \param &ost stream to extend * \param &m pointer to created Verbose object * \return &ost */ ostream& operator<<(ostream& ost,const Verbose& m) { return m.print(ost); }; /** Prints the tabs according to verbosity stored in the temporary constructed class. * Note that highest bit is set artificially to give number of bits to print * \param &ost stream to extend with tabs * \return &ost stream with tabs */ ostream& Binary::print (ostream &ost) const { int bits = 1, counter = 1; while ((bits = 1 << counter) < BinaryNumber) counter++; for (int i=0;i