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
41namespace igtl
42{
61class OverRideMap;
62
64{
65public:
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
94
97
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
153
154protected:
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
171
172private:
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 API for object creation callback functions.
Create instances of classes using an object factory.
SmartPointer< const Self > ConstPointer
virtual void PrintSelf(std::ostream &os) const
void RegisterOverride(const char *classOverride, const char *overrideClassName, const char *description, bool enableFlag, CreateObjectFunctionBase *createFunction)
virtual const char * GetIGTLSourceVersion(void) const =0
SmartPointer< Self > Pointer
static void RegisterFactory(ObjectFactoryBase *)
virtual LightObject::Pointer CreateObject(const char *igtlclassname)
virtual void Disable(const char *className)
static LightObject::Pointer CreateInstance(const char *igtlclassname)
static void UnRegisterAllFactories()
virtual std::list< std::string > GetClassOverrideWithNames()
virtual const char * GetDescription(void) const =0
static std::list< ObjectFactoryBase * > GetRegisteredFactories()
static void UnRegisterFactory(ObjectFactoryBase *)
virtual void SetEnableFlag(bool flag, const char *className, const char *subclassName)
virtual bool GetEnableFlag(const char *className, const char *subclassName)
static std::list< LightObject::Pointer > CreateAllInstance(const char *igtlclassname)
virtual std::list< std::string > GetClassOverrideDescriptions()
const char * GetLibraryPath()
virtual std::list< std::string > GetClassOverrideNames()
igtlTypeMacro(ObjectFactoryBase, Object)
virtual std::list< bool > GetEnableFlags()
Base class for most igtl classes.
Definition igtlObject.h:61
Implements transparent reference counting.
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
Internal implementation class for ObjectFactorBase.
CreateObjectFunctionBase::Pointer m_CreateObject

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012