cisst-saw
Loading...
Searching...
No Matches
mtsLODMultiplexerStreambuf Class Reference

#include <mtsLODMultiplexerStreambuf.h>

Inheritance diagram for mtsLODMultiplexerStreambuf:
cmnLODMultiplexerStreambuf< char >

Public Types

typedef cmnLODMultiplexerStreambuf< char > BaseType
typedef std::char_traits< char > TraitType
typedef cmnCallbackStreambuf< char > PerThreadChannelType
typedef BaseType::int_type IntType
Public Types inherited from cmnLODMultiplexerStreambuf< char >
typedef cmnLODMultiplexerStreambuf< char, std::char_traits< char > > ThisType
typedef std::basic_streambuf< char, std::char_traits< char > > BaseClassType
typedef std::basic_streambuf< char, std::char_traits< char > > ChannelType
typedef std::pair< ChannelType *, cmnLogMaskElementType
typedef std::list< ElementTypeChannelContainerType
typedef ChannelContainerType::iterator IteratorType
typedef ChannelContainerType::const_iterator ConstIteratorType
typedef std::list< ThisType * > MultiplexerContainerType
typedef MultiplexerContainerType::iterator MultiplexerIteratorType
typedef MultiplexerContainerType::const_iterator MultiplexerConstIteratorType

Public Member Functions

 mtsLODMultiplexerStreambuf ()
 ~mtsLODMultiplexerStreambuf ()
Public Member Functions inherited from cmnLODMultiplexerStreambuf< char >
 cmnLODMultiplexerStreambuf (std::ofstream &fileStream)
 cmnLODMultiplexerStreambuf ()
bool AddChannel (ChannelType *channel, cmnLogMask mask)
bool AddChannel (std::ostream &outstream, cmnLogMask mask)
bool AddMultiplexer (ThisType *multiplexer)
void RemoveChannel (ChannelType *channel)
void RemoveMultiplexer (ThisType *multiplexer)
void RemoveChannel (std::ostream &outstream)
void RemoveAllChannels (void)
bool SetChannelMask (ChannelType *channel, cmnLogMask mask)
bool GetChannelMask (const ChannelType *channel, cmnLogMask &mask) const
const ChannelContainerTypeGetChannels (void) const

Protected Types

typedef std::map< osaThreadId, PerThreadChannelType *, osaThreadIdPerThreadChannelMapType
typedef std::pair< PerThreadChannelMapType::iterator, bool > PerThreadChannelMapPairType
Protected Types inherited from cmnLODMultiplexerStreambuf< char >
typedef std::basic_streambuf< char, std::char_traits< char > >::int_type int_type

Protected Member Functions

std::streamsize xsputn (const char *s, std::streamsize n, cmnLogLevel level)
std::streamsize xsputn (const char *s, std::streamsize n)
IntType overflow (IntType c, cmnLogLevel level)
IntType overflow (IntType c=mtsLODMultiplexerStreambuf::TraitType::eof())
int sync (void)
PerThreadChannelTypeGetThreadChannel (const osaThreadId &threadId)
Protected Member Functions inherited from cmnLODMultiplexerStreambuf< char >
IteratorType FindChannel (const ChannelType *channel)
ConstIteratorType FindChannel (const ChannelType *channel) const
MultiplexerIteratorType FindMultiplexer (const ThisType *multiplexer)
MultiplexerConstIteratorType FindMultiplexer (const ThisType *multiplexer) const

Protected Attributes

PerThreadChannelMapType PerThreadChannelMap
osaMutex PerThreadChannelMapSync
Protected Attributes inherited from cmnLODMultiplexerStreambuf< char >
ChannelContainerType Channels
MultiplexerContainerType Multiplexers

Member Typedef Documentation

◆ BaseType

◆ IntType

◆ PerThreadChannelMapPairType

typedef std::pair<PerThreadChannelMapType::iterator, bool> mtsLODMultiplexerStreambuf::PerThreadChannelMapPairType
protected

◆ PerThreadChannelMapType

◆ PerThreadChannelType

◆ TraitType

typedef std::char_traits<char> mtsLODMultiplexerStreambuf::TraitType

Constructor & Destructor Documentation

◆ mtsLODMultiplexerStreambuf()

mtsLODMultiplexerStreambuf::mtsLODMultiplexerStreambuf ( )

◆ ~mtsLODMultiplexerStreambuf()

mtsLODMultiplexerStreambuf::~mtsLODMultiplexerStreambuf ( )

Member Function Documentation

◆ GetThreadChannel()

PerThreadChannelType * mtsLODMultiplexerStreambuf::GetThreadChannel ( const osaThreadId & threadId)
protected

Get (per-thread) log channel for a thread given. If thread id was not registered yet, create new one.

◆ overflow() [1/2]

IntType mtsLODMultiplexerStreambuf::overflow ( IntType c,
cmnLogLevel level )
protectedvirtual

Multiplexed and LODed version of basic_streambuf overflow for multiplexing. 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.

Reimplemented from cmnLODMultiplexerStreambuf< char >.

◆ overflow() [2/2]

IntType mtsLODMultiplexerStreambuf::overflow ( IntType c = mtsLODMultiplexerStreambuf::TraitType::eof())
protectedvirtual

Override the basic_streambuf overflow for multiplexing. 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.

Reimplemented from cmnLODMultiplexerStreambuf< char >.

◆ sync()

int mtsLODMultiplexerStreambuf::sync ( void )
protectedvirtual

Override the basic_streambuf sync for multiplexing. Note that in this one we sync() all the channels, regardless of the LOD.

Reimplemented from cmnLODMultiplexerStreambuf< char >.

◆ xsputn() [1/2]

std::streamsize mtsLODMultiplexerStreambuf::xsputn ( const char * s,
std::streamsize n )
protectedvirtual

Override the basic_streambuf xsputn to do the multiplexing

Reimplemented from cmnLODMultiplexerStreambuf< char >.

◆ xsputn() [2/2]

std::streamsize mtsLODMultiplexerStreambuf::xsputn ( const char * s,
std::streamsize n,
cmnLogLevel level )
protectedvirtual

Multiplexed and LODed version of basic_streambuf xsputn.

Reimplemented from cmnLODMultiplexerStreambuf< char >.

Member Data Documentation

◆ PerThreadChannelMap

PerThreadChannelMapType mtsLODMultiplexerStreambuf::PerThreadChannelMap
protected

◆ PerThreadChannelMapSync

osaMutex mtsLODMultiplexerStreambuf::PerThreadChannelMapSync
protected

To access internal container thread-safely


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