cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
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
*, cmnLogMask
ElementType
 
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 RemoveChannel (std::ostream &outstream)
 
void RemoveMultiplexer (ThisType *multiplexer)
 
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
*, osaThreadId
PerThreadChannelMapType
 
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

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

Constructor & Destructor Documentation

mtsLODMultiplexerStreambuf::mtsLODMultiplexerStreambuf ( )
mtsLODMultiplexerStreambuf::~mtsLODMultiplexerStreambuf ( )

Member Function Documentation

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.

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 >.

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 >.

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 >.

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 >.

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

Override the basic_streambuf xsputn to do the multiplexing

Reimplemented from cmnLODMultiplexerStreambuf< char >.

Member Data Documentation

PerThreadChannelMapType mtsLODMultiplexerStreambuf::PerThreadChannelMap
protected
osaMutex mtsLODMultiplexerStreambuf::PerThreadChannelMapSync
protected

To access internal container thread-safely


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