Orxonox
0.0.5 Codename: Arcturus
|
This class is used to buffer output and send it to OutputManager whenever std::endl is passed to it. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/util/output/OutputStream.h>
Public Member Functions | |
_UtilExport | OutputStream () |
Default constructor, initializes level and context with default values. More... | |
_UtilExport | OutputStream (OutputLevel level, const OutputContextContainer &context) |
Constructor, initializes level and context with the provided values. More... | |
_UtilExport | ~OutputStream () |
Destructor, sends remaining output to OutputManager (if any). More... | |
bool | acceptsOutput () const |
const OutputContextContainer * | getOutputContext () const |
const OutputLevel | getOutputLevel () const |
template<class T > | |
OutputStream & | operator<< (const T &val) |
Generic << operator which adds output to the stream. More... | |
OutputStream & | operator<< (std::ios_base &(*manipulator)(std::ios_base &)) |
Sends a manipulator to the output stream. More... | |
OutputStream & | operator<< (std::ios &(*manipulator)(std::ios &)) |
Sends a manipulator to the output stream. More... | |
OutputStream & | operator<< (std::ostream &(*manipulator)(std::ostream &)) |
Sends a manipulator to the output stream and flushes the message if the manipulator is std::endl. More... | |
void _UtilExport | setOutputAttributes (OutputLevel level, const OutputContextContainer &context) |
Defines level and context of the following output. More... | |
Private Types | |
typedef std::ostream &(* | EndlType) (std::ostream &) |
Private Member Functions | |
template<class T > | |
OutputStream & | output (const T &val) |
Generic function to add values to the output stream, using the inherited << operator from std::ostringstream. More... | |
void _UtilExport | sendMessage () |
Sends the buffered message to OutputManager together with the stored level and context. More... | |
Private Attributes | |
bool | bAcceptsOutput_ |
After defining level and context of the following message, this flag is set according to the masks defined in OutputManager. If it is false, the OutputStream will throw away every output sent using the << operator. More... | |
const OutputContextContainer * | context_ |
The output context of the current message. More... | |
OutputLevel | level_ |
The output level of the current message. More... | |
This class is used to buffer output and send it to OutputManager whenever std::endl is passed to it.
OutputStream inherits from std::ostringstream and acts like std::cout. This means you can use the << operator to write output to the stream. This class is used by the orxout() function.
The following code samples are all equivalent:
|
private |
orxonox::OutputStream::OutputStream | ( | ) |
Default constructor, initializes level and context with default values.
orxonox::OutputStream::OutputStream | ( | OutputLevel | level, |
const OutputContextContainer & | context | ||
) |
Constructor, initializes level and context with the provided values.
orxonox::OutputStream::~OutputStream | ( | ) |
Destructor, sends remaining output to OutputManager (if any).
|
inline |
|
inline |
|
inline |
|
inline |
Generic << operator which adds output to the stream.
|
inline |
Sends a manipulator to the output stream.
|
inline |
Sends a manipulator to the output stream.
|
inline |
Sends a manipulator to the output stream and flushes the message if the manipulator is std::endl.
|
inlineprivate |
Generic function to add values to the output stream, using the inherited << operator from std::ostringstream.
|
private |
Sends the buffered message to OutputManager together with the stored level and context.
Additionally empties the buffer.
void orxonox::OutputStream::setOutputAttributes | ( | OutputLevel | level, |
const OutputContextContainer & | context | ||
) |
Defines level and context of the following output.
Also sets the bAcceptsOutput_ flag according to the masks defined in OutputManager.
|
private |
After defining level and context of the following message, this flag is set according to the masks defined in OutputManager. If it is false, the OutputStream will throw away every output sent using the << operator.
|
private |
The output context of the current message.
|
private |
The output level of the current message.