ERC CISST - cisst software

osaThreadedLogFileStreambuf< _element, _trait > Class Template Reference

#include <osaThreadedLogFile.h>

Inheritance diagram for osaThreadedLogFileStreambuf< _element, _trait >:

Inheritance graph
[legend]
Collaboration diagram for osaThreadedLogFileStreambuf< _element, _trait >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class _element, class _trait = std::char_traits<_element>>
class osaThreadedLogFileStreambuf< _element, _trait >

See also:
C++ manual on basic_ostream and basic_streambuf, cmnLogger

Definition at line 47 of file osaThreadedLogFile.h.

Public Types

Public Member Functions

Protected Types

Protected Member Functions


Member Typedef Documentation

template<class _element, class _trait = std::char_traits<_element>>
typedef std::list<ElementType> osaThreadedLogFileStreambuf< _element, _trait >::ChannelContainerType

Type of internal data structure storing the channels.

Definition at line 58 of file osaThreadedLogFile.h.


Constructor & Destructor Documentation

template<class _element, class _trait = std::char_traits<_element>>
osaThreadedLogFileStreambuf< _element, _trait >::osaThreadedLogFileStreambuf ( const std::string &  filePrefix  )  [inline]

Create the stream buf with the file name prefix. Does nothing else than storing the file name prefix.

Definition at line 65 of file osaThreadedLogFile.h.


Member Function Documentation

template<class _element, class _trait>
osaThreadedLogFileStreambuf< _element, _trait >::ChannelType * osaThreadedLogFileStreambuf< _element, _trait >::AddChannelForThread ( const osaThreadId threadId  ) 

Create a file for the current thread and add its buffer to the list of channels.

Definition at line 184 of file osaThreadedLogFile.h.

Referenced by osaThreadedLogFileStreambuf< _element, _trait >::overflow(), osaThreadedLogFileStreambuf< _element, _trait >::sync(), and osaThreadedLogFileStreambuf< _element, _trait >::xsputn().

template<class _element, class _trait>
int osaThreadedLogFileStreambuf< _element, _trait >::sync (  )  [protected, virtual]

Override the basic_streambuf sync for the current file output.

Definition at line 115 of file osaThreadedLogFile.h.

References osaThreadedLogFileStreambuf< _element, _trait >::AddChannelForThread(), osaMutex::Lock(), osaGetCurrentThreadId(), and osaMutex::Unlock().

template<class _element, class _trait>
std::streamsize osaThreadedLogFileStreambuf< _element, _trait >::xsputn ( const _element *  s,
std::streamsize  n 
) [protected, virtual]

Override the basic_streambuf xsputn for the current file output.

Definition at line 132 of file osaThreadedLogFile.h.

References osaThreadedLogFileStreambuf< _element, _trait >::AddChannelForThread(), osaMutex::Lock(), osaGetCurrentThreadId(), and osaMutex::Unlock().

template<class _element, class _trait>
osaThreadedLogFileStreambuf< _element, _trait >::int_type osaThreadedLogFileStreambuf< _element, _trait >::overflow ( int_type  c = _trait::eof()  )  [protected, virtual]

Override the basic_streambuf overflow. overflow() is called when sputc() discovers it does not have space in the storage buffer. In our case, it's always. See more on it in the basic_streambuf documentation.

Definition at line 149 of file osaThreadedLogFile.h.

References osaThreadedLogFileStreambuf< _element, _trait >::AddChannelForThread(), osaMutex::Lock(), osaGetCurrentThreadId(), and osaMutex::Unlock().


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu