ITK  6.0.0
Insight Toolkit
itkLightObject.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 itkLightObject_h
19#define itkLightObject_h
20
21#include "itkMacro.h"
22#include "itkSmartPointer.h"
23#include "itkTimeStamp.h"
24#include "itkIndent.h"
25#include <atomic>
26
27#include <iostream>
28#include <typeinfo>
29
30#if defined(_WIN32)
31# include "itkWindows.h"
32#endif
33
34namespace itk
35{
55class ITKCommon_EXPORT LightObject
56{
57public:
58 ITK_DISALLOW_COPY_AND_MOVE(LightObject);
59
64
66 static Pointer
67 New();
68
74 virtual Pointer
76
79 Clone() const
80 {
81 return this->InternalClone();
82 }
83
87 virtual void
89
93 itkVirtualGetNameOfClassMacro(LightObject);
94
95#ifdef _WIN32
97 void *
98 operator new(size_t);
99
100 void *
101 operator new[](size_t);
102
103 void
104 operator delete(void *);
105
106 void
107 operator delete[](void *, size_t);
108
109#endif
110
112 void
113 Print(std::ostream & os, Indent indent = 0) const;
114
117 static void
119
121 virtual void
122 Register() const;
123
125 virtual void
126 UnRegister() const noexcept;
127
129 virtual int
130 GetReferenceCount() const
131 {
132 return m_ReferenceCount;
133 }
134
137 virtual void
139
140protected:
142 virtual ~LightObject();
143
148 virtual void
149 PrintSelf(std::ostream & os, Indent indent) const;
150
151 virtual void
152 PrintHeader(std::ostream & os, Indent indent) const;
153
154 virtual void
155 PrintTrailer(std::ostream & os, Indent indent) const;
156
163
165 mutable std::atomic<int> m_ReferenceCount{};
166};
167
174ITKCommon_EXPORT std::ostream &
175 operator<<(std::ostream & os, const LightObject & o);
176
177} // end namespace itk
178
179#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
virtual void Delete()
virtual LightObject::Pointer InternalClone() const
Pointer Clone() const
virtual ~LightObject()
virtual Pointer CreateAnother() const
virtual void PrintTrailer(std::ostream &os, Indent indent) const
static Pointer New()
virtual void PrintSelf(std::ostream &os, Indent indent) const
virtual void UnRegister() const noexcept
virtual void SetReferenceCount(int)
static void BreakOnError()
virtual void Register() const
void Print(std::ostream &os, Indent indent=0) const
virtual void PrintHeader(std::ostream &os, Indent indent) const
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)