Dune::DebugStream< thislevel, dlevel, alevel, activator > Class Template Reference
[Debug output]

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

#include <dune/common/debugstream.hh>

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

List of all members.

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 >
DebugStreamoperator<< (const T data)
 Generic types are passed on to current output stream.
DebugStreamoperator<< (const int data)
 explicit specialization so that enums can be printed
DebugStreamoperator<< (std::ostream &(*f)(std::ostream &))
 pass on manipulators to underlying output stream
DebugStreamflush ()
 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 tie (DebugStreamState &to) throw (DebugStreamError)
void untie () throw (DebugStreamError)
 Untie stream.

Public Attributes

StreamWrapcurrent
 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

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

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.

References Dune::DebugStreamState::_active, Dune::DebugStreamState::_tied, Dune::DebugStreamState::_tied_streams, Dune::DebugStreamState::current, and Dune::StreamWrap::next.


Member Data Documentation


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

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].