RTC::basic_medlogbuf< _CharT, _Traits > Class Template Reference

Mediate logger buffer class. More...

#include <SystemLogger.h>

List of all members.

Public Types

typedef _CharT char_type
typedef _Traits traits_type
typedef
std::basic_streambuf
< char_type,
traits_type
__streambuf_type
typedef
std::basic_filebuf
< char_type,
traits_type
__filebuf_type

Public Member Functions

 basic_medlogbuf ()
 Constructor.
 basic_medlogbuf (__filebuf_type &filebuf)
 Constructor.
 basic_medlogbuf (const basic_medlogbuf &x)
 basic_medlogbuf copy constructor.
virtual ~basic_medlogbuf ()
 Destractor.
void setBuffer (__filebuf_type &filebuf)
 Set the log buffer.
void setDateFmt (char *fmt)
 Set date/time format for adding the header.
void setDateFmt (const std::string &fmt)
 Set date/time format for adding the header.
std::string getFmtDate ()
 Get the current formatted date/time string.
void setSuffix (char *suffix)
 Set suffix of date/time string of header.
void setSuffix (const std::string &suffix)
 Set suffix of date/time string of header.
std::string getSuffix ()
 Get suffix of date/time string of header.

Protected Member Functions

virtual int sync ()
 synchronization of buffer


Detailed Description

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
class RTC::basic_medlogbuf< _CharT, _Traits >

Mediate logger buffer class.

This is a logger buffer class like basic_streambuf. Mediates to basic_filebuf. Add the header etc to the string received from stream and pass it to basic_filebuf.


Member Typedef Documentation

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef _CharT RTC::basic_medlogbuf< _CharT, _Traits >::char_type

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef _Traits RTC::basic_medlogbuf< _CharT, _Traits >::traits_type

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef std::basic_streambuf<char_type, traits_type> RTC::basic_medlogbuf< _CharT, _Traits >::__streambuf_type

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef std::basic_filebuf<char_type, traits_type> RTC::basic_medlogbuf< _CharT, _Traits >::__filebuf_type


Constructor & Destructor Documentation

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
RTC::basic_medlogbuf< _CharT, _Traits >::basic_medlogbuf (  )  [inline]

Constructor.

Constructor

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
RTC::basic_medlogbuf< _CharT, _Traits >::basic_medlogbuf ( __filebuf_type filebuf  )  [inline]

Constructor.

Constructor

Parameters:
filebuf Buffer for log file

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
RTC::basic_medlogbuf< _CharT, _Traits >::basic_medlogbuf ( const basic_medlogbuf< _CharT, _Traits > &  x  )  [inline]

basic_medlogbuf copy constructor.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
virtual RTC::basic_medlogbuf< _CharT, _Traits >::~basic_medlogbuf (  )  [inline, virtual]

Destractor.

Destructor


Member Function Documentation

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
void RTC::basic_medlogbuf< _CharT, _Traits >::setBuffer ( __filebuf_type filebuf  )  [inline]

Set the log buffer.

Set the specified file buffer as log buffer.

Parameters:
filebuf Buffer for log file

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
void RTC::basic_medlogbuf< _CharT, _Traits >::setDateFmt ( char *  fmt  )  [inline]

Set date/time format for adding the header.

The format specification string is as follows:

 %a abbreviated weekday name 
 %A full weekday name 
 %b abbreviated month name 
 %B full month name 
 %c the standard date and time string 
 %d day of the month, as a number (1-31) 
 %H hour, 24 hour format (0-23) 
 %I hour, 12 hour format (1-12) 
 %j day of the year, as a number (1-366) 
 %m month as a number (1-12).
    Note: some versions of Microsoft Visual C++ may use values that range
    from 0-11. 
 %M minute as a number (0-59) 
 %p locale's equivalent of AM or PM 
 %S second as a number (0-59) 
 %U week of the year, sunday as the first day 
 %w weekday as a decimal (0-6, sunday=0) 
 %W week of the year, monday as the first day 
 %x standard date string 
 %X standard time string 
 %y year in decimal, without the century (0-99) 
 %Y year in decimal, with the century 
 %Z time zone name 
 %% a percent sign 
 

Parameters:
fmt Datetime format

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
void RTC::basic_medlogbuf< _CharT, _Traits >::setDateFmt ( const std::string &  fmt  )  [inline]

Set date/time format for adding the header.

For more details on the format specification string, please refer to void setDateFmt(char*).

Parameters:
fmt Datetime format string

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
std::string RTC::basic_medlogbuf< _CharT, _Traits >::getFmtDate (  )  [inline]

Get the current formatted date/time string.

Get the current datetime described by specified format.

Returns:
Format specification current datetime

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
void RTC::basic_medlogbuf< _CharT, _Traits >::setSuffix ( char *  suffix  )  [inline]

Set suffix of date/time string of header.

Set the suffix string added after the datatime of the header.

Parameters:
suffix Suffix string

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
void RTC::basic_medlogbuf< _CharT, _Traits >::setSuffix ( const std::string &  suffix  )  [inline]

Set suffix of date/time string of header.

Set the suffix string added after the datatime of the header.

Parameters:
suffix Suffix string

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
std::string RTC::basic_medlogbuf< _CharT, _Traits >::getSuffix (  )  [inline]

Get suffix of date/time string of header.

Get the suffix string added after the datatime of the header.

Returns:
Suffix string

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
virtual int RTC::basic_medlogbuf< _CharT, _Traits >::sync (  )  [inline, protected, virtual]

synchronization of buffer

Synchronous function to be invoked when the buffer was flushed.

Returns:
Synchronous processing result of the buffer


Generated on Thu May 29 15:03:33 2008 for OpenRTM by  doxygen 1.5.3