Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlObjectFactoryBase.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: The OpenIGTLink Library
4  Language: C++
5  Web page: http://openigtlink.org/
6 
7  Copyright (c) Insight Software Consortium. All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 =========================================================================*/
14 /*=========================================================================
15 
16  Program: Insight Segmentation & Registration Toolkit
17  Module: $RCSfile: itkObjectFactoryBase.h,v $
18  Language: C++
19  Date: $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
20  Version: $Revision: 3460 $
21 
22  Copyright (c) Insight Software Consortium. All rights reserved.
23  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
24 
25  Portions of this code are covered under the VTK copyright.
26  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
27 
28  This software is distributed WITHOUT ANY WARRANTY; without even
29  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30  PURPOSE. See the above copyright notices for more information.
31 
32 =========================================================================*/
33 #ifndef __igtlObjectFactoryBase_h
34 #define __igtlObjectFactoryBase_h
35 
36 #include "igtlObject.h"
38 #include <list>
39 #include <vector>
40 
41 namespace igtl
42 {
61 class OverRideMap;
62 
64 {
65 public:
68  typedef Object Superclass;
71 
74 
79  static LightObject::Pointer CreateInstance(const char* igtlclassname);
80 
85  static std::list<LightObject::Pointer>
86  CreateAllInstance(const char* igtlclassname);
87 
90  static void ReHash();
91 
93  static void RegisterFactory(ObjectFactoryBase* );
94 
96  static void UnRegisterFactory(ObjectFactoryBase*);
97 
99  static void UnRegisterAllFactories();
100 
103  static std::list<ObjectFactoryBase*> GetRegisteredFactories();
104 
110  virtual const char* GetIGTLSourceVersion(void) const = 0;
111 
113  virtual const char* GetDescription(void) const = 0;
114 
116  virtual std::list<std::string> GetClassOverrideNames();
117 
119  virtual std::list<std::string> GetClassOverrideWithNames();
120 
122  virtual std::list<std::string> GetClassOverrideDescriptions();
123 
125  virtual std::list<bool> GetEnableFlags();
126 
128  virtual void SetEnableFlag(bool flag,
129  const char* className,
130  const char* subclassName);
131 
133  virtual bool GetEnableFlag(const char* className,
134  const char* subclassName);
135 
139  virtual void Disable(const char* className);
140 
142  const char* GetLibraryPath();
143 
147  {
148  std::string m_Description;
149  std::string m_OverrideWithName;
152  };
153 
154 protected:
155  virtual void PrintSelf(std::ostream& os) const;
156 
158  void RegisterOverride(const char* classOverride,
159  const char* overrideClassName,
160  const char* description,
161  bool enableFlag,
162  CreateObjectFunctionBase* createFunction);
163 
167  virtual LightObject::Pointer CreateObject(const char* igtlclassname );
168 
170  virtual ~ObjectFactoryBase();
171 
172 private:
173  OverRideMap* m_OverrideMap;
174 
175  ObjectFactoryBase(const Self&); //purposely not implemented
176  void operator=(const Self&); //purposely not implemented
177 
180  static void Initialize();
181 
183  static void RegisterDefaults();
184 
186 // static void LoadDynamicFactories();
187 //
188 
190 // static void LoadLibrariesInPath( const char*);
191 //
192 
194  static std::list<ObjectFactoryBase*>* m_RegisteredFactories;
195 
198  void* m_LibraryHandle;
199  unsigned long m_LibraryDate;
200  std::string m_LibraryPath;
201 };
202 
203 } // end namespace igtl
204 
205 #endif
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
SmartPointer< Self > Pointer
Internal implementation class for ObjectFactorBase.
Create instances of classes using an object factory.
SmartPointer< const Self > ConstPointer
#define IGTLCommon_EXPORT
Define API for object creation callback functions.
CreateObjectFunctionBase::Pointer m_CreateObject
Light weight base class for most igtl classes.
Base class for most igtl classes.
Definition: igtlObject.h:60

Generated at Wed Dec 4 2013 03:48:28 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012