28#ifndef _cmnLODMultiplexerStreambuf_h
29#define _cmnLODMultiplexerStreambuf_h
107template <
class _element,
class _trait = std::
char_traits<_element> >
235 typedef typename std::basic_streambuf<_element, _trait>::int_type
int_type;
256 virtual std::streamsize
xsputn(
const _element *s, std::streamsize n);
301template <
class _element,
class _trait>
314template <
class _element,
class _trait>
327template <
class _element,
class _trait>
338template <
class _element,
class _trait>
349template <
class _element,
class _trait>
357template <
class _element,
class _trait>
369template <
class _element,
class _trait>
381template <
class _element,
class _trait>
385 std::streamsize ssize(0);
389 channelIt != channelEnd;
391 if (level & ((*channelIt).second)) {
392 ssize = ((*channelIt).first)->sputn(s, n);
399 multiplexerIt != multiplexerEnd;
401 ssize = (*multiplexerIt)->xsputn(s, n, level);
407template <
class _element,
class _trait>
414 channelIt != channelEnd;
416 ((*channelIt).first)->pubsync();
422 multiplexerIt != multiplexerEnd;
424 (*multiplexerIt)->sync();
430template <
class _element,
class _trait>
435 if (_trait::eq_int_type(_trait::eof(), c)) {
436 return (_trait::not_eof(c));
443 channelIt != channelEnd;
445 if (level & ((*channelIt).second)) {
446 ((*channelIt).first)->sputc(_trait::to_char_type(c));
453 multiplexerIt != multiplexerEnd;
455 (*multiplexerIt)->overflow(c, level);
458 return _trait::not_eof(c);
462template <
class _element,
class _trait>
465 std::streamsize ssize(0);
470 channelIt != channelEnd;
472 ssize = ((*channelIt).first)->sputn(s, n);
478 multiplexerIt != multiplexerEnd;
480 ssize = (*multiplexerIt)->xsputn(s, n);
486template <
class _element,
class _trait>
491 if (_trait::eq_int_type(_trait::eof(), c)) {
492 return (_trait::not_eof(c));
499 channelIt != channelEnd;
501 ((*channelIt).first)->sputc(_trait::to_char_type(c));
507 multiplexerIt != multiplexerEnd;
509 (*multiplexerIt)->overflow(c);
513 return _trait::not_eof(c);
517template <
class _element,
class _trait>
523 if ((*it).first == channel) {
532template <
class _element,
class _trait>
538 if ((*it).first == channel) {
547template <
class _element,
class _trait>
553 if ((*it) == multiplexer) {
562template <
class _element,
class _trait>
568 if ((*it) == multiplexer) {
MultiplexerConstIteratorType FindMultiplexer(const ThisType *multiplexer) const
Definition cmnLODMultiplexerStreambuf.h:564
cmnLODMultiplexerStreambuf()
Definition cmnLODMultiplexerStreambuf.h:143
bool AddChannel(ChannelType *channel, cmnLogMask mask)
virtual std::streamsize xsputn(const _element *s, std::streamsize n)
Definition cmnLODMultiplexerStreambuf.h:463
ChannelContainerType Channels
Definition cmnLODMultiplexerStreambuf.h:267
bool GetChannelMask(const ChannelType *channel, cmnLogMask &mask) const
Definition cmnLODMultiplexerStreambuf.h:370
std::list< ElementType > ChannelContainerType
Definition cmnLODMultiplexerStreambuf.h:124
ChannelContainerType::iterator IteratorType
Definition cmnLODMultiplexerStreambuf.h:125
IteratorType FindChannel(const ChannelType *channel)
Definition cmnLODMultiplexerStreambuf.h:519
std::basic_streambuf< _element, _trait >::int_type int_type
Definition cmnLODMultiplexerStreambuf.h:235
bool AddMultiplexer(ThisType *multiplexer)
Definition cmnLODMultiplexerStreambuf.h:315
void RemoveAllChannels(void)
Definition cmnLODMultiplexerStreambuf.h:350
MultiplexerContainerType Multiplexers
Definition cmnLODMultiplexerStreambuf.h:281
bool AddChannel(std::ostream &outstream, cmnLogMask mask)
Definition cmnLODMultiplexerStreambuf.h:163
MultiplexerContainerType::const_iterator MultiplexerConstIteratorType
Definition cmnLODMultiplexerStreambuf.h:130
virtual int_type overflow(int_type c, cmnLogLevel level)
Definition cmnLODMultiplexerStreambuf.h:432
bool SetChannelMask(ChannelType *channel, cmnLogMask mask)
Definition cmnLODMultiplexerStreambuf.h:358
MultiplexerIteratorType FindMultiplexer(const ThisType *multiplexer)
Definition cmnLODMultiplexerStreambuf.h:549
virtual int_type overflow(int_type c=_trait::eof())
Definition cmnLODMultiplexerStreambuf.h:488
cmnLODMultiplexerStreambuf(std::ofstream &fileStream)
Definition cmnLODMultiplexerStreambuf.h:136
std::basic_streambuf< _element, _trait > ChannelType
Definition cmnLODMultiplexerStreambuf.h:116
cmnLODMultiplexerStreambuf< _element, _trait > ThisType
Definition cmnLODMultiplexerStreambuf.h:114
virtual int sync()
Definition cmnLODMultiplexerStreambuf.h:408
void RemoveChannel(ChannelType *channel)
Definition cmnLODMultiplexerStreambuf.h:328
std::list< ThisType * > MultiplexerContainerType
Definition cmnLODMultiplexerStreambuf.h:128
const ChannelContainerType & GetChannels(void) const
Definition cmnLODMultiplexerStreambuf.h:226
std::pair< ChannelType *, cmnLogMask > ElementType
Definition cmnLODMultiplexerStreambuf.h:118
std::basic_streambuf< _element, _trait > BaseClassType
Definition cmnLODMultiplexerStreambuf.h:115
void RemoveChannel(std::ostream &outstream)
Definition cmnLODMultiplexerStreambuf.h:190
ConstIteratorType FindChannel(const ChannelType *channel) const
Definition cmnLODMultiplexerStreambuf.h:534
ChannelContainerType::const_iterator ConstIteratorType
Definition cmnLODMultiplexerStreambuf.h:126
void RemoveMultiplexer(ThisType *multiplexer)
Definition cmnLODMultiplexerStreambuf.h:339
MultiplexerContainerType::iterator MultiplexerIteratorType
Definition cmnLODMultiplexerStreambuf.h:129
virtual std::streamsize xsputn(const _element *s, std::streamsize n, cmnLogLevel level)
Definition cmnLODMultiplexerStreambuf.h:382
Types for dynamic control of output messages.
Definition cmnMultiplexerStreambufProxy.h:88
Declaration of Levels of Detail for cmnLogger (human readable logging).
short cmnLogMask
Definition cmnLogLoD.h:67
short cmnLogLevel
Definition cmnLogLoD.h:55
#define CMN_LOG_ALLOW_ALL
Definition cmnLogLoD.h:75
Portability across compilers and operating systems tools.