Scippy

SoPlex

Sequential object-oriented simPlex

spxout.h File Reference

Wrapper for different output streams and verbosity levels. More...

#include <iostream>
#include <iomanip>
#include <assert.h>
#include "soplex/fmt.hpp"
#include "soplex/spxdefines.h"

Go to the source code of this file.

Classes

struct  EnableDebugOutput
 
class  SPxOut
 Wrapper for several output streams. A verbosity level is used to decide which stream to use and whether to really print a given message. Regardless of whether the verbosity level is set via a manipulator or via the member function, it is persistent until a new value is set. More...
 
struct  SPxOut::struct_Verbosity
 helper struct for the output operator More...
 

Namespaces

namespace  soplex
 Everything should be within this namespace.
 

Functions

Verbosity manipulator

Manipulators are implemented in a similar way as done for setw(), setprecision(), etc. in the standard library file iomanip. For instance, the non-member function verb(v) returns a struct struct_Verbosity which contains only the verbosity level. Calling

SPxOut spxout;
spxout << verb( SPxOut::ERROR ) << "This is an error!" << std::endl;
SPxOut::struct_Verbosity verb(const SPxOut::Verbosity &v)
manipulator to be used in an output statement
Definition: spxout.h:252

passes such a struct to the output operator defined below, which extracts the verbosity level from the struct and passes it to the member function SPxOut::setVerbosity().

SPxOut::struct_Verbosity verb (const SPxOut::Verbosity &v)
 manipulator to be used in an output statement More...
 
SPxOut & operator<< (SPxOut &stream, const SPxOut::struct_Verbosity &verbosity)
 output operator with verbosity level struct More...
 
Output of standard manipulators and other types

We have to define an output operator for many kinds of numeric types here because they can all be more or less casted into each other. When using only a template type, it is not clear what the compiler makes out of it (according to lint).

SPxOut & operator<< (SPxOut &_spxout, long t)
 Passes instances of type Type to the current stream. More...
 
SPxOut & operator<< (SPxOut &_spxout, unsigned long t)
 
SPxOut & operator<< (SPxOut &_spxout, bool t)
 
SPxOut & operator<< (SPxOut &_spxout, short t)
 
SPxOut & operator<< (SPxOut &_spxout, unsigned short t)
 
SPxOut & operator<< (SPxOut &_spxout, int t)
 
SPxOut & operator<< (SPxOut &_spxout, unsigned int t)
 
SPxOut & operator<< (SPxOut &_spxout, double t)
 
SPxOut & operator<< (SPxOut &_spxout, float t)
 
SPxOut & operator<< (SPxOut &_spxout, long double t)
 
SPxOut & operator<< (SPxOut &_spxout, const void *t)
 
SPxOut & operator<< (SPxOut &_spxout, std::ostream &(*manip)(std::ostream &))
 Passes standard manipulators without arguments, like std::endl or std::ios::right to the current stream. More...
 
template<typename T >
SPxOut & operator<< (SPxOut &_spxout, T t)
 Passes everything else to the current stream. In particular, this includes structs corresponding to manipulators with arguments, such as the struct _Setw for the setw() manipulator. More...
 

Detailed Description

Wrapper for different output streams and verbosity levels.

Definition in file spxout.h.