dune-common 2.9.0
Public Member Functions | Public Attributes | List of all members
Dune::DebugStream< thislevel, dlevel, alevel, activator > Class Template Reference

Generic class to implement debug output streams. More...

#include <dune/common/debugstream.hh>

Inheritance diagram for Dune::DebugStream< thislevel, dlevel, alevel, activator >:
Inheritance graph

Public Member Functions

 DebugStream (std::ostream &out=std::cerr)
 Create a DebugStream and set initial output stream. More...
 
 DebugStream (DebugStreamState &master, std::ostream &fallback=std::cerr)
 Create a DebugStream and directly tie to another DebugStream. More...
 
 ~DebugStream ()
 Destroy stream. More...
 
template<class T >
DebugStreamoperator<< (const T data)
 Generic types are passed on to current output stream. More...
 
DebugStreamoperator<< (const int data)
 explicit specialization so that enums can be printed More...
 
DebugStreamoperator<< (std::ostream &(*f)(std::ostream &))
 pass on manipulators to underlying output stream More...
 
DebugStreamflush ()
 pass on flush to underlying output stream More...
 
void push (bool b)
 set activation flag and store old value More...
 
void pop ()
 restore previously set activation flag More...
 
bool active () const
 reports if this stream will produce output More...
 
void attach (std::ostream &stream)
 set output to a different stream. More...
 
void detach ()
 detach current output stream and restore to previous stream More...
 
void tie (DebugStreamState &to)
 Tie a stream to this one. More...
 
void untie ()
 Untie stream. More...
 

Public Attributes

StreamWrapcurrent
 current output stream and link to possibly pushed old output streams More...
 
bool _active
 flag to switch output during runtime More...
 
bool _tied
 are we tied to another DebugStream? More...
 
unsigned int _tied_streams
 how many streams are tied to this state More...
 

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
thislevelthis level
dlevellevel needed for any output to happen
alevellevel needed to switch activation flag on
activatortemplate describing the activation policy
Todo:
Fix visibility of internal data

The documentation for this class was generated from the following file: