Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

log4cpp::CategoryStream Class Reference

This class enables streaming simple types and objects to a category. More...

#include <CategoryStream.hh>

Collaboration diagram for log4cpp::CategoryStream:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Separator { ENDLINE }
 Enumeration of special 'Separators'. More...


Public Methods

 CategoryStream (Category &category, Priority::Value priority)
 Construct a CategoryStream for given Category with given priority. More...

 ~CategoryStream ()
 Destructor for CategoryStream. More...

CategorygetCategory () const
 Returns the destination Category for this stream. More...

Priority::Value getPriority () const throw ()
 Returns the priority for this stream. More...

CategoryStream & operator<< (Separator separator)
 Streams in a Separator. More...

void flush ()
 Flush the contents of the stream buffer to the Category and empties the buffer. More...

template<typename T> CategoryStream & operator<< (const T &t)
 Stream in arbitrary types and objects. More...


Detailed Description

This class enables streaming simple types and objects to a category.

Use category.errorStream(), etc. to obtain a CategoryStream class.


Member Enumeration Documentation

enum log4cpp::CategoryStream::Separator
 

Enumeration of special 'Separators'.

Currently only contains the 'ENDLINE' separator, which separates two log messages.

Enumeration values:
ENDLINE 


Constructor & Destructor Documentation

log4cpp::CategoryStream::CategoryStream Category   category,
Priority::Value    priority
 

Construct a CategoryStream for given Category with given priority.

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

log4cpp::CategoryStream::~CategoryStream  
 

Destructor for CategoryStream.


Member Function Documentation

void log4cpp::CategoryStream::flush  
 

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

Category& log4cpp::CategoryStream::getCategory   const [inline]
 

Returns the destination Category for this stream.

Returns:
The Category.

Priority::Value log4cpp::CategoryStream::getPriority   const throw () [inline]
 

Returns the priority for this stream.

Returns:
The priority.

template<typename T>
CategoryStream& log4cpp::CategoryStream::operator<< const T &    t [inline]
 

Stream in arbitrary types and objects.

Parameters:
t  The value or object to stream in.
Returns:
A reference to itself.

CategoryStream & log4cpp::CategoryStream::operator<< Separator    separator
 

Streams in a Separator.

If the separator equals CategoryStream::ENDLINE it sends the contents of the stream buffer to the Category with set priority and empties the buffer.

Parameters:
separator  The Separator
Returns:
A reference to itself.


The documentation for this class was generated from the following files:
Generated on Mon Oct 28 23:42:12 2002 for log4cpp by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002