cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cmnOutputMultiplexer.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Ofri Sadowsky
7  Created on: 2002-04-18
8 
9  (C) Copyright 2002-2007 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 
20 */
21 
22 
27 #pragma once
28 
29 #ifndef _cmnOutputMultiplexer_h
30 #define _cmnOutputMultiplexer_h
31 
34 
35 #include <list>
36 #include <iostream>
37 
38 #include <cisstCommon/cmnExport.h>
39 
40 
80 class CISST_EXPORT cmnOutputMultiplexer : public std::ostream
81 {
82  public:
83  typedef char char_type;
84  typedef std::ostream ChannelType;
85 
87  typedef std::list<ChannelType *> ChannelContainerType;
88 
90  cmnOutputMultiplexer() : ChannelType(&m_Streambuf) {}
91 
95  ChannelType & AddChannel(ChannelType * channel);
96 
102  ChannelType & RemoveChannel(ChannelType * channel);
103 
104 
111  return m_ChannelContainer;
112  }
113 
114  protected:
116 
118 };
119 
120 
121 #endif // _cmnOutputMultiplexer_h
122 
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Portability across compilers and operating systems tools.
std::ostream ChannelType
Definition: cmnOutputMultiplexer.h:84
Creates a collection of objects that channels output to multiple sinks.
Definition: cmnOutputMultiplexer.h:80
std::list< ChannelType * > ChannelContainerType
Definition: cmnOutputMultiplexer.h:87
ChannelContainerType m_ChannelContainer
Definition: cmnOutputMultiplexer.h:115
Macros to export the symbols of cisstCommon (in a Dll).
Type Definitions for dynamic control of output messages.
cmnLODMultiplexerStreambuf< char_type > m_Streambuf
Definition: cmnOutputMultiplexer.h:117
char char_type
Definition: cmnOutputMultiplexer.h:83
cmnOutputMultiplexer()
Definition: cmnOutputMultiplexer.h:90
const ChannelContainerType & GetChannels() const
Definition: cmnOutputMultiplexer.h:110