ITK  6.0.0
Insight Toolkit
itkStdStreamLogOutput.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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 itkStdStreamLogOutput_h
19#define itkStdStreamLogOutput_h
20
21#include <iostream>
22#include <string>
23
24#include <mutex>
25#include "itkLogOutput.h"
26
27namespace itk
28{
42class ITKCommon_EXPORT StdStreamLogOutput : public LogOutput
43{
44public:
49
50 using StreamType = std::ostream;
51
52 using StreamPointerType = std::ostream *;
53
54 itkOverrideGetNameOfClassMacro(StdStreamLogOutput);
55
56 itkNewMacro(StdStreamLogOutput);
57
58 itkGetConstMacro(Stream, StreamPointerType);
59
61 void
63
65 void
66 Flush() override;
67
69 void
70 Write(double timestamp) override;
71
73 void
74 Write(std::string const & content) override;
75
77 void
78 Write(std::string const & content, double timestamp) override;
79
80protected:
83
86
87 void
88 PrintSelf(std::ostream & os, Indent indent) const override;
89
90private:
92
93 std::mutex m_Mutex{};
94};
95} // namespace itk
96
97#endif // itkStdStreamLogOutput_h
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Represents an output stream.
Definition: itkLogOutput.h:40
Base class for most ITK classes.
Definition: itkObject.h:62
Represents a standard stream output stream.
void Write(std::string const &content) override
void PrintSelf(std::ostream &os, Indent indent) const override
~StdStreamLogOutput() override
void SetStream(StreamType &Stream)
void Write(double timestamp) override
void Flush() override
void Write(std::string const &content, double timestamp) override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....