Orfeo Toolbox  3.16
itkObjectFactoryBase.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkObjectFactoryBase.h,v $
5  Language: C++
6  Date: $Date: 2009-12-23 14:55:37 $
7  Version: $Revision: 1.38 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  Portions of this code are covered under the VTK copyright.
13  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14 
15  This software is distributed WITHOUT ANY WARRANTY; without even
16  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 #ifndef __itkObjectFactoryBase_h
21 #define __itkObjectFactoryBase_h
22 
23 #include "itkObject.h"
25 #include <list>
26 #include <vector>
27 
28 namespace itk
29 {
48 class OverRideMap;
49 
51 {
52 public:
55  typedef Object Superclass;
58 
60  itkTypeMacro(ObjectFactoryBase, Object);
61 
66  static LightObject::Pointer CreateInstance(const char* itkclassname);
67 
72  static std::list<LightObject::Pointer>
73  CreateAllInstance(const char* itkclassname);
74 
77  static void ReHash();
78 
80  static void RegisterFactory(ObjectFactoryBase* );
81 
83  static void UnRegisterFactory(ObjectFactoryBase*);
84 
86  static void UnRegisterAllFactories();
87 
90  static std::list<ObjectFactoryBase*> GetRegisteredFactories();
91 
97  virtual const char* GetITKSourceVersion(void) const = 0;
98 
100  virtual const char* GetDescription(void) const = 0;
101 
103  virtual std::list<std::string> GetClassOverrideNames();
104 
106  virtual std::list<std::string> GetClassOverrideWithNames();
107 
109  virtual std::list<std::string> GetClassOverrideDescriptions();
110 
112  virtual std::list<bool> GetEnableFlags();
113 
115  virtual void SetEnableFlag(bool flag,
116  const char* className,
117  const char* subclassName);
118 
120  virtual bool GetEnableFlag(const char* className,
121  const char* subclassName);
122 
126  virtual void Disable(const char* className);
127 
129  const char* GetLibraryPath();
130 
134  {
135  std::string m_Description;
136  std::string m_OverrideWithName;
139  };
140 
141 protected:
142  virtual void PrintSelf(std::ostream& os, Indent indent) const;
143 
145  void RegisterOverride(const char* classOverride,
146  const char* overrideClassName,
147  const char* description,
148  bool enableFlag,
149  CreateObjectFunctionBase* createFunction);
150 
154  virtual LightObject::Pointer CreateObject(const char* itkclassname );
155 
159  virtual std::list<LightObject::Pointer>
160  CreateAllObject(const char* itkclassname);
161 
163  virtual ~ObjectFactoryBase();
164 
165 private:
167 
168  ObjectFactoryBase(const Self&); //purposely not implemented
169  void operator=(const Self&); //purposely not implemented
170 
173  static void Initialize();
174 
176  static void RegisterDefaults();
177 
179  static void LoadDynamicFactories();
180 
182  static void LoadLibrariesInPath( const char*);
183 
185  static std::list<ObjectFactoryBase*>* m_RegisteredFactories;
186 
190  unsigned long m_LibraryDate;
191  std::string m_LibraryPath;
192 };
193 
194 } // end namespace itk
195 
196 #endif

Generated at Sat Feb 2 2013 23:56:47 for Orfeo Toolbox with doxygen 1.8.1.1