![]() |
deal.II version 9.7.1
|
Go to the source code of this file.
Functions | |
| ConditionalOStream (std::ostream &stream, const bool active=true) | |
| void | set_condition (const bool active) |
| bool | is_active () const |
| std::ostream & | get_stream () const |
| template<typename T> | |
| const ConditionalOStream & | operator<< (const T &t) const |
| const ConditionalOStream & | operator<< (std::ostream &(*p)(std::ostream &)) const |
Variables | |
| std::ostream & | output_stream |
| bool | active_flag |
| void ConditionalOStream::set_condition | ( | const bool | active | ) |
Depending on the active flag set the condition of this stream to active (true) or non-active (false). An object of this class prints to cout if and only if its condition is active.
Definition at line 30 of file conditional_ostream.cc.
| bool is_active | ( | ) | const |
Return the condition of the object.
| std::ostream & get_stream | ( | ) | const |
Return a reference to the stream currently in use.
| const ConditionalOStream & operator<< | ( | const T & | t | ) | const |
Output a constant something through this stream. This function must be const so that member objects of this type can also be used from const member functions of the surrounding class.
| const ConditionalOStream & operator<< | ( | std::ostream &(* | p )(std::ostream &) | ) | const |
Treat ostream manipulators. This function must be const so that member objects of this type can also be used from const member functions of the surrounding class.
Note that compilers want to see this treated differently from the general template above since functions like std::endl are actually overloaded and can't be bound directly to a template type.
|
private |
Reference to the stream we want to write to.
Definition at line 134 of file conditional_ostream.h.
|
private |
Stores the actual condition the object is in.
Definition at line 139 of file conditional_ostream.h.