Selecting or inspecting the ostream used by a debug object. More...
Functions | |
| void | libcwd::DebugObject::set_ostream (std::ostream *os) |
| Set output device (single threaded applications). | |
| std::ostream * | libcwd::DebugObject::get_ostream () const |
| Get the ostream device as set with set_ostream(). | |
| template<class T> | |
| void | libcwd::DebugObject::set_ostream (std::ostream *os, T *mutex) |
| Set output device and provide external lock. | |
Basically, a debug object (DebugObject) is a pointer to an ostream with a few extra attributes added to give it an internal state for on (pass output on) and off (don't pass output on) as well as some formatting information of how to write the data that is passed on to its ostream.
The methods of DebugObject given here allow you to set or get this ostream (pointer).
| void libcwd::DebugObject::set_ostream | ( | std::ostream * | os | ) |
Assign a new ostream to this debug object (default is std::cerr). For use in single threaded applications only.
| void libcwd::DebugObject::set_ostream | ( | std::ostream * | os, |
| T * | mutex ) |
Assign a new ostream to this debug object. The ostream will only be written to after obtaining the lock that is passed as second argument. Each ostream needs to have a unique lock. If the application also writes directly to the same ostream then use the same lock.
Example: