A DebugSlave uses a link to another master Debugable to provide its log and bug services. More...
#include <debug.h>
Public Member Functions | |
DebugSlave (unsigned int minimal_debug_level=0, Debugable *master=0) | |
Constructor. | |
virtual unsigned int | debug () const |
virtual ostream_ptr & | logif (bool condition) const |
Return an Dv::ostream_ptr to write debug or log info on. | |
virtual void | set_debug_master (Debugable *master, unsigned int min_debug_level=0) const |
Set the debug master of this slave. | |
unsigned int | debug_threshold () const |
virtual Debugable * | debug_master () const |
Protected Attributes | |
unsigned int | threshold_ |
Debugable * | master_ |
A DebugSlave uses a link to another master Debugable to provide its log and bug services.
If there is no master, the slave always return a null Dv::ostream_ptr and a debug level of 0.
Note that the liberal use of const_cast. The idea is that adding debug manipulation to existing code should not generate const-correctness errors.
Definition at line 208 of file debug.h.
Dv::DebugSlave::DebugSlave | ( | unsigned int | minimal_debug_level = 0 , |
|
Debugable * | master = 0 | |||
) | [inline] |
Constructor.
minimal_debug_level | only if the master's debug level is at least this number will the master's Dv::ostream_ptr be returned by the Dv::DebugSlave::logif and Dv::DebugSlave::log member functions. | |
master | to which the object will be connected. This can also be done later using Dv::DebugSlave::set_debug_master |
virtual unsigned int Dv::DebugSlave::debug | ( | ) | const [inline, virtual] |
Reimplemented from Dv::Debugable.
Reimplemented in Dv::Debug.
Definition at line 221 of file debug.h.
References Dv::Debugable::debug(), and debug_master().
Referenced by logif().
virtual ostream_ptr& Dv::DebugSlave::logif | ( | bool | condition | ) | const [inline, virtual] |
Return an Dv::ostream_ptr to write debug or log info on.
condition | a non-null Dv::ostream_ptr will be returned only if this condition is true and the master debug level is at least the treshold specified in the constructor. |
Reimplemented from Dv::Debugable.
Reimplemented in Dv::Debug.
Definition at line 236 of file debug.h.
References debug(), debug_master(), Dv::Debugable::logif(), and threshold_.
virtual void Dv::DebugSlave::set_debug_master | ( | Debugable * | master, | |
unsigned int | min_debug_level = 0 | |||
) | const [inline, virtual] |
Set the debug master of this slave.
master | new debug master of this slave. | |
min_debug_level | to use with the new master. If 0, the old threshold remains in effect. |
Definition at line 251 of file debug.h.
References master_, and threshold_.
unsigned int Dv::DebugSlave::debug_threshold | ( | ) | const [inline] |
Definition at line 258 of file debug.h.
References threshold_.
virtual Debugable* Dv::DebugSlave::debug_master | ( | ) | const [inline, virtual] |
Reimplemented in Dv::DebugObserver.
Definition at line 260 of file debug.h.
References master_.
Referenced by debug(), Dv::Debug::logif(), and logif().
unsigned int Dv::DebugSlave::threshold_ [protected] |
Definition at line 264 of file debug.h.
Referenced by debug_threshold(), Dv::Debug::logif(), logif(), and set_debug_master().
Debugable* Dv::DebugSlave::master_ [protected] |
Definition at line 265 of file debug.h.
Referenced by debug_master(), and set_debug_master().
dvutil-1.0.10 | [ 5 December, 2009] |