OpenRTM-aist  1.2.1
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
coil::log_streambuf< _CharT, _Traits > Class Template Reference

log_streambuf template class More...

#include <Logger.h>

Inheritance diagram for coil::log_streambuf< _CharT, _Traits >:
Inheritance graph
[legend]
Collaboration diagram for coil::log_streambuf< _CharT, _Traits >:
Collaboration graph
[legend]

Classes

struct  Stream
 Structure for stream management. More...
 

Public Types

typedef _CharT char_type
 
typedef _Traits traits_type
 
typedef std::basic_streambuf< char_type, traits_typestreambuf_type
 
typedef coil::Mutex Mutex
 
typedef coil::Guard< coil::MutexGuard
 

Public Member Functions

 log_streambuf ()
 Constructor. More...
 
virtual ~log_streambuf ()
 Destructor. More...
 
void addStream (streambuf_type *stream, bool cleanup=false)
 Destructor. More...
 
bool removeStream (streambuf_type *stream)
 Destructor. More...
 
std::vector< streambuf_type * > getBuffers ()
 Get stream buffer list. More...
 

Protected Member Functions

virtual std::streamsize xsputn (const char_type *s, std::streamsize n)
 override of basic_streambuf::xsputn More...
 
virtual std::streamsize stream_sputn ()
 Write the stream buffer in stream. More...
 
virtual std::streamsize stream_sputn (const char_type *s, std::streamsize n)
 Writes up to n characters from the array pointed by s to the output sequence controlled by the stream buffer. More...
 
virtual int overflow (int c=traits_type::eof())
 override of basic_streambuf::overflow More...
 
virtual int sync ()
 override of basic_streambuf::sync More...
 

Detailed Description

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
class coil::log_streambuf< _CharT, _Traits >

log_streambuf template class

Member Typedef Documentation

template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
typedef _CharT coil::log_streambuf< _CharT, _Traits >::char_type
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
typedef coil::Guard<coil::Mutex> coil::log_streambuf< _CharT, _Traits >::Guard
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
typedef coil::Mutex coil::log_streambuf< _CharT, _Traits >::Mutex
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
typedef std::basic_streambuf<char_type, traits_type> coil::log_streambuf< _CharT, _Traits >::streambuf_type
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
typedef _Traits coil::log_streambuf< _CharT, _Traits >::traits_type

Constructor & Destructor Documentation

template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
coil::log_streambuf< _CharT, _Traits >::log_streambuf ( )
inline

Constructor.

Constructor

References BUFFER_LEN.

template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
virtual coil::log_streambuf< _CharT, _Traits >::~log_streambuf ( )
inlinevirtual

Destructor.

Destructor

Member Function Documentation

template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
void coil::log_streambuf< _CharT, _Traits >::addStream ( streambuf_type stream,
bool  cleanup = false 
)
inline

Destructor.

This operation adds a stream that is actual output stream. User has responsibility to destruct the stream object, since this object never destructs the stream objects. The added stream objects should not be destructed before the destruction of this object. The stream destruction should be done by user after removing it from this object or destructing this object.

Parameters
streama pointer to std::basic_streambuf type stream object
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
std::vector<streambuf_type*> coil::log_streambuf< _CharT, _Traits >::getBuffers ( )
inline

Get stream buffer list.

Return a stream buffer list.

Returns
streambuf_type list
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
virtual int coil::log_streambuf< _CharT, _Traits >::overflow ( int  c = traits_type::eof())
inlineprotectedvirtual

override of basic_streambuf::overflow

Parameters
cinput character
Returns
return value

References coil::log_streambuf< _CharT, _Traits >::stream_sputn().

Referenced by coil::log_streambuf< _CharT, _Traits >::sync().

template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
bool coil::log_streambuf< _CharT, _Traits >::removeStream ( streambuf_type stream)
inline

Destructor.

This operation remove a stream that is actual output stream. User has responsibility to destruct the stream object.

Parameters
streama pointer to std::basic_streambuf type stream object
Returns
Whether removing the stream succeeded.
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
virtual std::streamsize coil::log_streambuf< _CharT, _Traits >::stream_sputn ( )
inlineprotectedvirtual

Write the stream buffer in stream.

Returns
The number of characters written.

Referenced by coil::log_streambuf< _CharT, _Traits >::overflow(), coil::log_streambuf< _CharT, _Traits >::sync(), and coil::log_streambuf< _CharT, _Traits >::xsputn().

template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
virtual std::streamsize coil::log_streambuf< _CharT, _Traits >::stream_sputn ( const char_type s,
std::streamsize  n 
)
inlineprotectedvirtual

Writes up to n characters from the array pointed by s to the output sequence controlled by the stream buffer.

Parameters
sa pointer to input characters
nnumber of input characters
Returns
The number of characters written.
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
virtual int coil::log_streambuf< _CharT, _Traits >::sync ( )
inlineprotectedvirtual

override of basic_streambuf::sync

Returns
return value

References coil::log_streambuf< _CharT, _Traits >::overflow(), and coil::log_streambuf< _CharT, _Traits >::stream_sputn().

template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
virtual std::streamsize coil::log_streambuf< _CharT, _Traits >::xsputn ( const char_type s,
std::streamsize  n 
)
inlineprotectedvirtual

override of basic_streambuf::xsputn

Parameters
sa pointer to input characters
nnumber of input characters
Returns
input stream size

References coil::log_streambuf< _CharT, _Traits >::stream_sputn().


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