Orfeo Toolbox  4.0
itkObject.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 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef __itkObject_h
29 #define __itkObject_h
30 
31 #include "itkLightObject.h"
32 #include "itkEventObject.h"
33 #include "itkMetaDataDictionary.h"
34 
35 namespace itk
36 {
37 class SubjectImplementation;
38 class Command;
39 
57 class ITKCommon_EXPORT Object:public LightObject
58 {
59 public:
61  typedef Object Self;
65 
67  static Pointer New();
68 
74  virtual LightObject::Pointer CreateAnother() const;
75 
77  itkTypeMacro(Object, LightObject);
78 
80  virtual void DebugOn() const;
81 
83  virtual void DebugOff() const;
84 
86  bool GetDebug() const;
87 
89  void SetDebug(bool debugFlag) const;
90 
92  virtual ModifiedTimeType GetMTime() const;
93 
95  virtual const TimeStamp & GetTimeStamp() const;
96 
99  virtual void Modified() const;
100 
102  virtual void Register() const;
103 
105  virtual void UnRegister() const;
106 
108  virtual void SetReferenceCount(int);
109 
112  static void SetGlobalWarningDisplay(bool flag);
113 
114  static bool GetGlobalWarningDisplay();
115 
116  static void GlobalWarningDisplayOn()
117  { SetGlobalWarningDisplay(true); }
118  static void GlobalWarningDisplayOff()
119  { SetGlobalWarningDisplay(false); }
120 
129  unsigned long AddObserver(const EventObject & event, Command *);
130 
131  unsigned long AddObserver(const EventObject & event, Command *) const;
132 
138  Command * GetCommand(unsigned long tag);
139 
141  void InvokeEvent(const EventObject &);
142 
145  void InvokeEvent(const EventObject &) const;
146 
148  void RemoveObserver(unsigned long tag);
149 
151  void RemoveAllObservers();
152 
154  bool HasObserver(const EventObject & event) const;
155 
160  MetaDataDictionary & GetMetaDataDictionary(void);
161 
165  const MetaDataDictionary & GetMetaDataDictionary(void) const;
166 
170  void SetMetaDataDictionary(const MetaDataDictionary & rhs);
171 
179  itkSetMacro(ObjectName, std::string);
180  itkGetConstReferenceMacro(ObjectName, std::string);
181 
182 protected:
183  Object();
184  virtual ~Object();
185 
190  virtual void PrintSelf(std::ostream & os, Indent indent) const;
191 
192  bool PrintObservers(std::ostream & os, Indent indent) const;
193 
197  virtual void SetTimeStamp( const TimeStamp & time );
198 
199 private:
200  Object(const Self &); //purposely not implemented
201  void operator=(const Self &); //purposely not implemented
202 
204  mutable bool m_Debug;
205 
208 
211 
223 
224  std::string m_ObjectName;
225 };
226 } // end namespace itk
227 
228 #endif

Generated at Sat Mar 8 2014 15:18:43 for Orfeo Toolbox with doxygen 1.8.3.1