Public Member Functions | Private Attributes | List of all members
OCL::logging::CategoryStream Class Reference

#include <CategoryStream.hpp>

Public Member Functions

 CategoryStream (Category *rt_category, log4cpp::Priority::Value priority)
 
 CategoryStream (const CategoryStream &rhs)
 
void flush ()
 
template<typename T >
CategoryStreamoperator<< (const T &t)
 
virtual ~CategoryStream ()
 

Private Attributes

Category_category
 
log4cpp::Priority::Value _priority
 
RTT::rt_ostringstream oss
 

Detailed Description

This is a utility class which you can use to stream messages into a category object. It provides an std::iostream like syntax using the << operator, but you need to call flush() in order to do the actual write of your message.

Definition at line 19 of file CategoryStream.hpp.

Constructor & Destructor Documentation

OCL::logging::CategoryStream::CategoryStream ( Category rt_category,
log4cpp::Priority::Value  priority 
)

Construct a CategoryStream for given Category with given priority.

Parameters
categoryThe category this stream will send log messages to.
priorityThe priority the log messages will get or Priority::NOTSET to silently discard any streamed in messages.

Definition at line 7 of file CategoryStream.cpp.

OCL::logging::CategoryStream::CategoryStream ( const CategoryStream rhs)

Copy-constructor needed because the output string stream can't be copied. We rater have to copy the underlying (real-time) string.

Parameters
rhsThe CategoryStream to copy from

Definition at line 32 of file CategoryStream.cpp.

OCL::logging::CategoryStream::~CategoryStream ( )
virtual

Destructor for CategoryStream which also flushes any remaining data to the Category object.

Definition at line 14 of file CategoryStream.cpp.

Member Function Documentation

void OCL::logging::CategoryStream::flush ( )

Flush the contents of the stream buffer to the Category and empties the buffer.

Definition at line 19 of file CategoryStream.cpp.

template<typename T >
CategoryStream& OCL::logging::CategoryStream::operator<< ( const T &  t)
inline

Stream in arbitrary types and objects.

Parameters
tThe value or object to stream in.
Returns
A reference to itself.

Definition at line 55 of file CategoryStream.hpp.

Member Data Documentation

Category* OCL::logging::CategoryStream::_category
private

Definition at line 66 of file CategoryStream.hpp.

log4cpp::Priority::Value OCL::logging::CategoryStream::_priority
private

Definition at line 67 of file CategoryStream.hpp.

RTT::rt_ostringstream OCL::logging::CategoryStream::oss
private

Definition at line 68 of file CategoryStream.hpp.


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


ocl
Author(s): OCL Development Team
autogenerated on Wed Jun 26 2019 19:26:27