ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMultipleLogOutput.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkMultipleLogOutput_h
19 #define itkMultipleLogOutput_h
20 
21 #include "itkLogOutput.h"
22 
23 #include <fstream>
24 #include <set>
25 
26 namespace itk
27 {
40 class ITKCommon_EXPORT MultipleLogOutput:public LogOutput
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_ASSIGN(MultipleLogOutput);
44 
49 
51 
52  itkTypeMacro(MultipleLogOutput, LogOutput);
53  itkNewMacro(MultipleLogOutput);
54 
55 public:
56 
60  void AddLogOutput(OutputType *output);
61 
63  void Flush() override;
64 
66  void Write(double timestamp) override;
67 
69  void Write(const std::string & content) override;
70 
72  void Write(const std::string & content, double timestamp) override;
73 
74 protected:
77 
79  ~MultipleLogOutput() override;
80 
81 private:
82  using ContainerType = std::set< OutputType::Pointer >;
83 
85 };
86 }
87 
88 #endif //itkMultipleLogOutput_h
Light weight base class for most itk classes.
Allows writing simultaneously to multiple streams. Note that the class derives from std::streambuf an...
Represents an output stream.
Definition: itkLogOutput.h:39
std::set< OutputType::Pointer > ContainerType
Base class for most ITK classes.
Definition: itkObject.h:60