coil::log_streambuf< _CharT, _Traits > Class Template Reference

log_streambuf template class More...

#include <Logger.h>

List of all members.

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_type
streambuf_type
typedef coil::Mutex Mutex
typedef coil::Guard< coil::MutexGuard

Public Member Functions

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

Protected Member Functions

virtual std::streamsize xsputn (const char_type *s, std::streamsize n)
 override of basic_streambuf::xsputn
virtual std::streamsize stream_sputn ()
 Write the stream buffer in stream.
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.
virtual int overflow (int c=traits_type::eof())
 override of basic_streambuf::overflow
virtual int sync ()
 override of basic_streambuf::sync

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 (  )  [inline, virtual]

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:
stream a 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()  )  [inline, protected, virtual]

override of basic_streambuf::overflow

Parameters:
c input 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:
stream a 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 ( const char_type s,
std::streamsize  n 
) [inline, protected, virtual]

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

Parameters:
s a pointer to input characters
n number of input characters
Returns:
The number of characters written.
template<typename _CharT , typename _Traits = std::char_traits<_CharT>>
virtual std::streamsize coil::log_streambuf< _CharT, _Traits >::stream_sputn (  )  [inline, protected, virtual]

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 int coil::log_streambuf< _CharT, _Traits >::sync (  )  [inline, protected, virtual]

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 
) [inline, protected, virtual]

override of basic_streambuf::xsputn

Parameters:
s a pointer to input characters
n number of input characters
Returns:
input stream size

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

Generated on Fri Oct 28 18:31:17 2016 for OpenRTM-aist by  doxygen 1.6.3