Dune::DebugStream< thislevel, dlevel, alevel, activator > Class Template Reference
[Debug output]
#include <debugstream.hh>
Inheritance diagram for Dune::DebugStream< thislevel, dlevel, alevel, activator >:

Detailed Description
template<DebugLevel thislevel = 1, DebugLevel dlevel = 1, DebugLevel alevel = 1, template< DebugLevel, DebugLevel > class activator = greater_or_equal>
class Dune::DebugStream< thislevel, dlevel, alevel, activator >
Generic class to implement debug output streams.
The main function of a DebugStream is to provide output in a standard ostream fashion that is fully deactivated if the level of the stream does not meet the current requirements. More information in Debug output
- Parameters:
-
thislevel this level dlevel level needed for any output to happen alevel level needed to switch activation flag on activator template describing the activation policy
- Todo:
- Fix visibility of internal data
Public Member Functions | |
DebugStream (std::ostream &out=std::cerr) | |
Create a DebugStream and set initial output stream. | |
DebugStream (DebugStreamState &master, std::ostream &fallback=std::cerr) | |
Create a DebugStream and directly tie to another DebugStream. | |
~DebugStream () | |
Destroy stream. | |
template<class T> | |
DebugStream & | operator<< (const T data) |
Generic types are passed on to current output stream. | |
DebugStream & | operator<< (const int data) |
explicit specialization so that enums can be printed | |
DebugStream & | operator<< (std::ostream &(*f)(std::ostream &)) |
pass on manipulators to underlying output stream | |
DebugStream & | flush () |
pass on flush to underlying output stream | |
void | push (bool b) |
set activation flag and store old value | |
void | pop () throw (DebugStreamError) |
restore previously set activation flag | |
bool | active () const |
reports if this stream will produce output | |
void | attach (std::ostream &stream) |
set output to a different stream. | |
void | detach () throw (DebugStreamError) |
detach current output stream and restore to previous stream | |
void | untie () throw (DebugStreamError) |
Untie stream. | |
Public Attributes | |
StreamWrap * | current |
current output stream and link to possibly pushed old output streams | |
bool | _active |
flag to switch output during runtime | |
bool | _tied |
are we tied to another DebugStream? | |
unsigned int | _tied_streams |
how many streams are tied to this state |
Constructor & Destructor Documentation
template<DebugLevel thislevel = 1, DebugLevel dlevel = 1, DebugLevel alevel = 1, template< DebugLevel, DebugLevel > class activator = greater_or_equal>
Dune::DebugStream< thislevel, dlevel, alevel, activator >::DebugStream | ( | std::ostream & | out = std::cerr |
) | [inline] |
Create a DebugStream and set initial output stream.
during runtime another stream can be attach()ed, however the initial stream may not be detach()ed.
The documentation for this class was generated from the following file: