Main Page
Namespace List
Class Hierarchy
Alphabetical List
Compound List
File List
Namespace Members
Compound Members
File Members
Source
igtlObjectFactory.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: itkObjectFactory.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 __igtlObjectFactory_h
34
#define __igtlObjectFactory_h
35
36
#include "
igtlObjectFactoryBase.h
"
37
38
namespace
igtl
39
{
40
59
template
<
class
T>
60
class
ObjectFactory
:
public
ObjectFactoryBase
61
{
62
public
:
63
static
typename
T::Pointer
Create
()
64
{
65
LightObject::Pointer
ret =
ObjectFactory::CreateInstance
(
typeid
(T).name());
66
return
dynamic_cast<
T*
>
(ret.
GetPointer
());
67
}
68
};
69
70
}
// end namespace igtl
71
72
#endif
73
74
75
igtlObjectFactoryBase.h
igtl::SmartPointer::GetPointer
ObjectType * GetPointer() const
Definition:
igtlSmartPointer.h:108
igtl::ObjectFactory::Create
static T::Pointer Create()
Definition:
igtlObjectFactory.h:63
igtl::ObjectFactoryBase
Create instances of classes using an object factory.
Definition:
igtlObjectFactoryBase.h:63
igtl
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
Definition:
igtlBindMessage.h:25
igtl::ObjectFactory
Create instances of a class.
Definition:
igtlObjectFactory.h:60
igtl::SmartPointer< Self >
igtl::ObjectFactoryBase::CreateInstance
static LightObject::Pointer CreateInstance(const char *igtlclassname)
Generated for OpenIGTLink by
Doxygen
1.8.17 written by
Dimitri van Heesch
, © 1997-2012