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: Open IGT Link Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlObjectFactoryBase.h $
5  Language: C++
6  Date: $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
7  Version: $Revision: 3460 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 /*=========================================================================
17 
18  Program: Insight Segmentation & Registration Toolkit
19  Module: $RCSfile: itkObjectFactoryBase.h,v $
20  Language: C++
21  Date: $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
22  Version: $Revision: 3460 $
23 
24  Copyright (c) Insight Software Consortium. All rights reserved.
25  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
26 
27  Portions of this code are covered under the VTK copyright.
28  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
29 
30  This software is distributed WITHOUT ANY WARRANTY; without even
31  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
32  PURPOSE. See the above copyright notices for more information.
33 
34 =========================================================================*/
35 #ifndef __igtlObjectFactoryBase_h
36 #define __igtlObjectFactoryBase_h
37 
38 #include "igtlObject.h"
40 #include <list>
41 #include <vector>
42 
43 namespace igtl
44 {
63 class OverRideMap;
64 
66 {
67 public:
70  typedef Object Superclass;
73 
76 
81  static LightObject::Pointer CreateInstance(const char* igtlclassname);
82 
87  static std::list<LightObject::Pointer>
88  CreateAllInstance(const char* igtlclassname);
89 
92  static void ReHash();
93 
95  static void RegisterFactory(ObjectFactoryBase* );
96 
98  static void UnRegisterFactory(ObjectFactoryBase*);
99 
101  static void UnRegisterAllFactories();
102 
105  static std::list<ObjectFactoryBase*> GetRegisteredFactories();
106 
112  virtual const char* GetIGTLSourceVersion(void) const = 0;
113 
115  virtual const char* GetDescription(void) const = 0;
116 
118  virtual std::list<std::string> GetClassOverrideNames();
119 
121  virtual std::list<std::string> GetClassOverrideWithNames();
122 
124  virtual std::list<std::string> GetClassOverrideDescriptions();
125 
127  virtual std::list<bool> GetEnableFlags();
128 
130  virtual void SetEnableFlag(bool flag,
131  const char* className,
132  const char* subclassName);
133 
135  virtual bool GetEnableFlag(const char* className,
136  const char* subclassName);
137 
141  virtual void Disable(const char* className);
142 
144  const char* GetLibraryPath();
145 
149  {
150  std::string m_Description;
151  std::string m_OverrideWithName;
154  };
155 
156 protected:
157  virtual void PrintSelf(std::ostream& os) const;
158 
160  void RegisterOverride(const char* classOverride,
161  const char* overrideClassName,
162  const char* description,
163  bool enableFlag,
164  CreateObjectFunctionBase* createFunction);
165 
169  virtual LightObject::Pointer CreateObject(const char* igtlclassname );
170 
172  virtual ~ObjectFactoryBase();
173 
174 private:
175  OverRideMap* m_OverrideMap;
176 
177  ObjectFactoryBase(const Self&); //purposely not implemented
178  void operator=(const Self&); //purposely not implemented
179 
182  static void Initialize();
183 
185  static void RegisterDefaults();
186 
188 // static void LoadDynamicFactories();
189 //
190 
192 // static void LoadLibrariesInPath( const char*);
193 //
194 
196  static std::list<ObjectFactoryBase*>* m_RegisteredFactories;
197 
200  void* m_LibraryHandle;
201  unsigned long m_LibraryDate;
202  std::string m_LibraryPath;
203 };
204 
205 } // end namespace igtl
206 
207 #endif
208 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000