#include <itkObjectFactoryBase.h>
Inherits itk::Object.
Inherited by itk::BioRadImageIOFactory, itk::BMPImageIOFactory, itk::Bruker2DSEQImageIOFactory, itk::BYUMeshIOFactory, itk::DCMTKImageIOFactory, itk::FEMFactoryBase, itk::FileListVideoIOFactory, itk::FreeSurferAsciiMeshIOFactory, itk::FreeSurferBinaryMeshIOFactory, itk::GDCMImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::GiftiMeshIOFactory, itk::GiplImageIOFactory, itk::GPUBinaryThresholdImageFilterFactory, itk::GPUDemonsRegistrationFilterFactory, itk::GPUGradientAnisotropicDiffusionImageFilterFactory, itk::GPUImageFactory, itk::GPUMeanImageFilterFactory, itk::HDF5ImageIOFactory, itk::HDF5TransformIOFactory, itk::JPEG2000ImageIOFactory, itk::JPEGImageIOFactory, itk::LSMImageIOFactory, itk::MatlabTransformIOFactory, itk::MetaImageIOFactory, itk::MGHImageIOFactory, itk::MRCImageIOFactory, itk::NiftiImageIOFactory, itk::NrrdImageIOFactory, itk::ObjectFactory< T >, itk::OBJMeshIOFactory, itk::OFFMeshIOFactory, itk::OpenCVVideoIOFactory, itk::PNGImageIOFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::SCIFIOImageIOFactory, itk::SiemensVisionImageIOFactory, itk::SpatialObjectFactoryBase, itk::StimulateImageIOFactory, itk::STLMeshIOFactory, itk::TIFFImageIOFactory, itk::TransformFactoryBase, itk::TxtTransformIOFactory, itk::VoxBoCUBImageIOFactory, itk::VTKImageIOFactory, itk::VTKPolyDataMeshIOFactory, and itk::VXLVideoIOFactory.
Create instances of classes using an object factory.
ObjectFactoryBase is used to create itk objects. The base class ObjectFactoryBase contains a static method CreateInstance() that is used to create itk objects from the list of registerd ObjectFactoryBase sub-classes. The first time CreateInstance() is called, all dll's or shared libraries in the environment variable ITK_AUTOLOAD_PATH are loaded into the current process. The C function itkLoad is called on each dll. itkLoad should return an instance of the factory sub-class implemented in the shared library. ITK_AUTOLOAD_PATH is an environment variable containing a colon separated (semi-colon on win32) list of paths.
This can be use to overide the creation of any object in ITK.
Definition at line 58 of file itkObjectFactoryBase.h.
Position at which the new factory will be registered in the internal factory container.
Enumerator |
---|
INSERT_AT_FRONT |
|
INSERT_AT_BACK |
|
INSERT_AT_POSITION |
|
Definition at line 99 of file itkObjectFactoryBase.h.
itk::ObjectFactoryBase::ObjectFactoryBase |
( |
| ) |
|
|
protected |
virtual itk::ObjectFactoryBase::~ObjectFactoryBase |
( |
| ) |
|
|
protectedvirtual |
itk::ObjectFactoryBase::ObjectFactoryBase |
( |
const Self & |
| ) |
|
|
private |
static std::list< LightObject::Pointer > itk::ObjectFactoryBase::CreateAllInstance |
( |
const char * |
itkclassname | ) |
|
|
static |
Create and return all possible instances of the named itk object. Each loaded ObjectFactoryBase will be asked in the order the factory was in the ITK_AUTOLOAD_PATH. All created objects will be returned in the list.
virtual std::list< LightObject::Pointer > itk::ObjectFactoryBase::CreateAllObject |
( |
const char * |
itkclassname | ) |
|
|
protectedvirtual |
This method creates all the objects with the class overide of itkclass name, which are provide by this object
Create and return an instance of the named itk object. Each loaded ObjectFactoryBase will be asked in the order the factory was in the ITK_AUTOLOAD_PATH. After the first factory returns the object no other factories are asked.
Referenced by itk::ObjectFactory< T >::Create().
This method is provided by sub-classes of ObjectFactoryBase. It should create the named itk object or return 0 if that object is not supported by the factory implementation.
virtual void itk::ObjectFactoryBase::Disable |
( |
const char * |
className | ) |
|
|
virtual |
Set all enable flags for the given class to 0. This will mean that the factory will stop producing class with the given name.
virtual std::list< std::string > itk::ObjectFactoryBase::GetClassOverrideDescriptions |
( |
| ) |
|
|
virtual |
Return a list of descriptions for class overrides.
virtual std::list< std::string > itk::ObjectFactoryBase::GetClassOverrideNames |
( |
| ) |
|
|
virtual |
Return a list of classes that this factory overrides.
virtual std::list< std::string > itk::ObjectFactoryBase::GetClassOverrideWithNames |
( |
| ) |
|
|
virtual |
Return a list of the names of classes that override classes.
virtual const char* itk::ObjectFactoryBase::GetDescription |
( |
void |
| ) |
const |
|
pure virtual |
Return a descriptive string describing the factory.
Implemented in itk::GPUImageFactory, itk::GPUDemonsRegistrationFilterFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::GPUBinaryThresholdImageFilterFactory, itk::GPUGradientAnisotropicDiffusionImageFilterFactory, itk::GPUMeanImageFilterFactory, itk::MRCImageIOFactory, itk::JPEG2000ImageIOFactory, itk::BioRadImageIOFactory, itk::LSMImageIOFactory, itk::StimulateImageIOFactory, itk::VTKImageIOFactory, itk::FEMFactoryBase, itk::SpatialObjectFactoryBase, itk::TransformFactoryBase, itk::Bruker2DSEQImageIOFactory, itk::VoxBoCUBImageIOFactory, itk::HDF5ImageIOFactory, itk::STLMeshIOFactory, itk::JPEGImageIOFactory, itk::TIFFImageIOFactory, itk::NiftiImageIOFactory, itk::PNGImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::SiemensVisionImageIOFactory, itk::HDF5TransformIOFactory, itk::MatlabTransformIOFactory, itk::BYUMeshIOFactory, itk::FreeSurferAsciiMeshIOFactory, itk::FreeSurferBinaryMeshIOFactory, itk::GiftiMeshIOFactory, itk::OBJMeshIOFactory, itk::OFFMeshIOFactory, itk::VTKPolyDataMeshIOFactory, itk::BMPImageIOFactory, itk::GiplImageIOFactory, itk::MetaImageIOFactory, itk::NrrdImageIOFactory, itk::TxtTransformIOFactory, itk::DCMTKImageIOFactory, itk::FileListVideoIOFactory, itk::OpenCVVideoIOFactory, itk::VXLVideoIOFactory, itk::GDCMImageIOFactory, itk::MGHImageIOFactory, and itk::SCIFIOImageIOFactory.
virtual bool itk::ObjectFactoryBase::GetEnableFlag |
( |
const char * |
className, |
|
|
const char * |
subclassName |
|
) |
| |
|
virtual |
Get the Enable flag for the specific override of className.
virtual std::list< bool > itk::ObjectFactoryBase::GetEnableFlags |
( |
| ) |
|
|
virtual |
Return a list of enable flags.
virtual const char* itk::ObjectFactoryBase::GetITKSourceVersion |
( |
void |
| ) |
const |
|
pure virtual |
All sub-classes of ObjectFactoryBase should must return the version of ITK they were built with. This should be implemented with the macro ITK_SOURCE_VERSION and NOT a call to Version::GetITKSourceVersion. As the version needs to be compiled into the file as a string constant. This is critical to determine possible incompatible dynamic factory loads.
Implemented in itk::GPUImageFactory, itk::GPUDemonsRegistrationFilterFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::GPUBinaryThresholdImageFilterFactory, itk::GPUGradientAnisotropicDiffusionImageFilterFactory, itk::GPUMeanImageFilterFactory, itk::MRCImageIOFactory, itk::JPEG2000ImageIOFactory, itk::BioRadImageIOFactory, itk::LSMImageIOFactory, itk::StimulateImageIOFactory, itk::VTKImageIOFactory, itk::FEMFactoryBase, itk::SpatialObjectFactoryBase, itk::TransformFactoryBase, itk::Bruker2DSEQImageIOFactory, itk::VoxBoCUBImageIOFactory, itk::HDF5ImageIOFactory, itk::STLMeshIOFactory, itk::JPEGImageIOFactory, itk::TIFFImageIOFactory, itk::NiftiImageIOFactory, itk::PNGImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::SiemensVisionImageIOFactory, itk::HDF5TransformIOFactory, itk::MatlabTransformIOFactory, itk::BYUMeshIOFactory, itk::FreeSurferAsciiMeshIOFactory, itk::FreeSurferBinaryMeshIOFactory, itk::GiftiMeshIOFactory, itk::OBJMeshIOFactory, itk::OFFMeshIOFactory, itk::VTKPolyDataMeshIOFactory, itk::BMPImageIOFactory, itk::GiplImageIOFactory, itk::MetaImageIOFactory, itk::NrrdImageIOFactory, itk::TxtTransformIOFactory, itk::DCMTKImageIOFactory, itk::FileListVideoIOFactory, itk::OpenCVVideoIOFactory, itk::VXLVideoIOFactory, itk::GDCMImageIOFactory, itk::MGHImageIOFactory, and itk::SCIFIOImageIOFactory.
const char* itk::ObjectFactoryBase::GetLibraryPath |
( |
| ) |
|
This returns the path to a dynamically loaded factory.
virtual const char* itk::ObjectFactoryBase::GetNameOfClass |
( |
| ) |
const |
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::Object.
Reimplemented in itk::GPUImageFactory, itk::GPUDemonsRegistrationFilterFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::GPUBinaryThresholdImageFilterFactory, itk::GPUGradientAnisotropicDiffusionImageFilterFactory, itk::GPUMeanImageFilterFactory, itk::MRCImageIOFactory, itk::JPEG2000ImageIOFactory, itk::BioRadImageIOFactory, itk::LSMImageIOFactory, itk::StimulateImageIOFactory, itk::VTKImageIOFactory, itk::FEMFactoryBase, itk::SpatialObjectFactoryBase, itk::TransformFactoryBase, itk::Bruker2DSEQImageIOFactory, itk::VoxBoCUBImageIOFactory, itk::HDF5ImageIOFactory, itk::STLMeshIOFactory, itk::JPEGImageIOFactory, itk::TIFFImageIOFactory, itk::PNGImageIOFactory, itk::NiftiImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::SiemensVisionImageIOFactory, itk::HDF5TransformIOFactory, itk::MatlabTransformIOFactory, itk::BYUMeshIOFactory, itk::FreeSurferAsciiMeshIOFactory, itk::FreeSurferBinaryMeshIOFactory, itk::GiftiMeshIOFactory, itk::OBJMeshIOFactory, itk::OFFMeshIOFactory, itk::VTKPolyDataMeshIOFactory, itk::BMPImageIOFactory, itk::GiplImageIOFactory, itk::MetaImageIOFactory, itk::NrrdImageIOFactory, itk::TxtTransformIOFactory, itk::DCMTKImageIOFactory, itk::FileListVideoIOFactory, itk::OpenCVVideoIOFactory, itk::VXLVideoIOFactory, itk::GDCMImageIOFactory, itk::MGHImageIOFactory, and itk::SCIFIOImageIOFactory.
static std::list< ObjectFactoryBase * > itk::ObjectFactoryBase::GetRegisteredFactories |
( |
| ) |
|
|
static |
static bool itk::ObjectFactoryBase::GetStrictVersionChecking |
( |
| ) |
|
|
static |
Require the ITK version of this application to exactly match the ITK version used to compile a dynamic library. When this is set to true, if the versions do not match, an exception will be thrown. When this is false, and the versions do not match, only a warning message is printed out in the console, and the factory is still registered.
static void itk::ObjectFactoryBase::Initialize |
( |
| ) |
|
|
staticprivate |
static void itk::ObjectFactoryBase::InitializeFactoryList |
( |
| ) |
|
|
staticprivate |
Initialize the static list of Factories.
static void itk::ObjectFactoryBase::LoadDynamicFactories |
( |
| ) |
|
|
staticprivate |
Load dynamic factories from the ITK_AUTOLOAD_PATH
static void itk::ObjectFactoryBase::LoadLibrariesInPath |
( |
const char * |
| ) |
|
|
staticprivate |
Load all dynamic libraries in the given path
void itk::ObjectFactoryBase::operator= |
( |
const Self & |
| ) |
|
|
private |
virtual void itk::ObjectFactoryBase::PrintSelf |
( |
std::ostream & |
os, |
|
|
Indent |
indent |
|
) |
| const |
|
protectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::Object.
Reimplemented in itk::STLMeshIOFactory, itk::HDF5ImageIOFactory, itk::MatlabTransformIOFactory, itk::BYUMeshIOFactory, itk::FreeSurferAsciiMeshIOFactory, itk::FreeSurferBinaryMeshIOFactory, itk::GiftiMeshIOFactory, itk::OBJMeshIOFactory, itk::OFFMeshIOFactory, itk::VTKPolyDataMeshIOFactory, itk::NiftiImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::SiemensVisionImageIOFactory, itk::HDF5TransformIOFactory, itk::TxtTransformIOFactory, and itk::MGHImageIOFactory.
Register a factory so it can be used to create itk objects.
When INSERT_AT_POSITION is selected, a third argument must be provided
with the actual integer number of the intended position. The position
number must be in the range [0, numberOfRegisteredFactories-1].
Usage should be any of the following:
itk::ObjectFactoryBase::RegisterFactory( newFactory1 ); // at back
itk::ObjectFactoryBase::RegisterFactory( newFactory2, INSERT_AT_FRONT );
itk::ObjectFactoryBase::RegisterFactory( newFactory3, INSERT_AT_BACK );
itk::ObjectFactoryBase::RegisterFactory( newFactory4, INSERT_AT_POSITION, 5 );
If the position value is out of range, an exception will be
thrown.
Returns true if the factory was successfully registered.
Returns false if factory is already loaded.
Referenced by itk::SpatialObjectFactoryBase::GetFactory(), itk::TransformFactoryBase::GetFactory(), itk::FEMFactoryBase::GetFactory(), ProcessArgumentsAndRegisterBuiltInFactories(), itk::SCIFIOImageIOFactory::RegisterOneFactory(), itk::FreeSurferAsciiMeshIOFactory::RegisterOneFactory(), itk::FreeSurferBinaryMeshIOFactory::RegisterOneFactory(), itk::VTKPolyDataMeshIOFactory::RegisterOneFactory(), itk::BYUMeshIOFactory::RegisterOneFactory(), itk::GiftiMeshIOFactory::RegisterOneFactory(), itk::OBJMeshIOFactory::RegisterOneFactory(), itk::OFFMeshIOFactory::RegisterOneFactory(), itk::STLMeshIOFactory::RegisterOneFactory(), itk::Bruker2DSEQImageIOFactory::RegisterOneFactory(), itk::VoxBoCUBImageIOFactory::RegisterOneFactory(), itk::JPEG2000ImageIOFactory::RegisterOneFactory(), itk::GPUMeanImageFilterFactory::RegisterOneFactory(), itk::GPUGradientAnisotropicDiffusionImageFilterFactory::RegisterOneFactory(), itk::GPUBinaryThresholdImageFilterFactory::RegisterOneFactory(), itk::RawImageIOFactory< TPixel, VImageDimension >::RegisterOneFactory(), itk::GPUDemonsRegistrationFilterFactory::RegisterOneFactory(), itk::GPUImageFactory::RegisterOneFactory(), and RegisterRequiredFactories().
Register a factory so it can be used to create itk objects. This method is intended to be called only for built-in default factories, not for loadable factories.
Factories that are registered with this method will be regisistered after ReHash.
Referenced by itk::GDCMImageIOFactory::RegisterOneFactory(), itk::MGHImageIOFactory::RegisterOneFactory(), itk::BMPImageIOFactory::RegisterOneFactory(), itk::GiplImageIOFactory::RegisterOneFactory(), itk::NrrdImageIOFactory::RegisterOneFactory(), itk::FileListVideoIOFactory::RegisterOneFactory(), itk::OpenCVVideoIOFactory::RegisterOneFactory(), itk::DCMTKImageIOFactory::RegisterOneFactory(), itk::TxtTransformIOFactory::RegisterOneFactory(), itk::VXLVideoIOFactory::RegisterOneFactory(), itk::MetaImageIOFactory::RegisterOneFactory(), itk::NiftiImageIOFactory::RegisterOneFactory(), itk::GEAdwImageIOFactory::RegisterOneFactory(), itk::GE5ImageIOFactory::RegisterOneFactory(), itk::HDF5TransformIOFactory::RegisterOneFactory(), itk::SiemensVisionImageIOFactory::RegisterOneFactory(), itk::GE4ImageIOFactory::RegisterOneFactory(), itk::MatlabTransformIOFactory::RegisterOneFactory(), itk::JPEGImageIOFactory::RegisterOneFactory(), itk::TIFFImageIOFactory::RegisterOneFactory(), itk::PNGImageIOFactory::RegisterOneFactory(), itk::HDF5ImageIOFactory::RegisterOneFactory(), itk::VTKImageIOFactory::RegisterOneFactory(), itk::StimulateImageIOFactory::RegisterOneFactory(), itk::LSMImageIOFactory::RegisterOneFactory(), itk::BioRadImageIOFactory::RegisterOneFactory(), and itk::MRCImageIOFactory::RegisterOneFactory().
static void itk::ObjectFactoryBase::RegisterInternal |
( |
| ) |
|
|
staticprivate |
Register default factories which are not loaded at run time.
void itk::ObjectFactoryBase::RegisterOverride |
( |
const char * |
classOverride, |
|
|
const char * |
overrideClassName, |
|
|
const char * |
description, |
|
|
bool |
enableFlag, |
|
|
CreateObjectFunctionBase * |
createFunction |
|
) |
| |
|
protected |
static void itk::ObjectFactoryBase::ReHash |
( |
| ) |
|
|
static |
Re-check the ITK_AUTOLOAD_PATH for new factory libraries. This calls UnRegisterAll before re-loading.
- Examples:
- IO/IOPlugin.cxx.
virtual void itk::ObjectFactoryBase::SetEnableFlag |
( |
bool |
flag, |
|
|
const char * |
className, |
|
|
const char * |
subclassName |
|
) |
| |
|
virtual |
Set the Enable flag for the specific override of className.
static void itk::ObjectFactoryBase::SetStrictVersionChecking |
( |
bool |
| ) |
|
|
static |
Require the ITK version of this application to exactly match the ITK version used to compile a dynamic library. When this is set to true, if the versions do not match, an exception will be thrown. When this is false, and the versions do not match, only a warning message is printed out in the console, and the factory is still registered.
static void itk::ObjectFactoryBase::StrictVersionCheckingOff |
( |
| ) |
|
|
static |
Require the ITK version of this application to exactly match the ITK version used to compile a dynamic library. When this is set to true, if the versions do not match, an exception will be thrown. When this is false, and the versions do not match, only a warning message is printed out in the console, and the factory is still registered.
static void itk::ObjectFactoryBase::StrictVersionCheckingOn |
( |
| ) |
|
|
static |
Require the ITK version of this application to exactly match the ITK version used to compile a dynamic library. When this is set to true, if the versions do not match, an exception will be thrown. When this is false, and the versions do not match, only a warning message is printed out in the console, and the factory is still registered.
static void itk::ObjectFactoryBase::UnRegisterAllFactories |
( |
| ) |
|
|
static |
Unregister all factories.
Remove a factory from the list of registered factories.
unsigned long itk::ObjectFactoryBase::m_LibraryDate |
|
private |
void* itk::ObjectFactoryBase::m_LibraryHandle |
|
private |
Member variables for a factory set by the base class at load or register time
Definition at line 249 of file itkObjectFactoryBase.h.
std::string itk::ObjectFactoryBase::m_LibraryPath |
|
private |
OverRideMap* itk::ObjectFactoryBase::m_OverrideMap |
|
private |
bool itk::ObjectFactoryBase::m_StrictVersionChecking |
|
staticprivate |
The documentation for this class was generated from the following file: