Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::ObjectFactoryBase Class Reference
[ITK System Objects]

Create instances of classes using an object factory. More...

#include <itkObjectFactoryBase.h>

Inheritance diagram for itk::ObjectFactoryBase:

Inheritance graph
[legend]
Collaboration diagram for itk::ObjectFactoryBase:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ObjectFactoryBase Self
typedef Object Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const
Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual const char * GetITKSourceVersion (void) const =0
virtual const char * GetDescription (void) const =0
virtual std::list< std::string > GetClassOverrideNames ()
virtual std::list< std::string > GetClassOverrideWithNames ()
virtual std::list< std::string > GetClassOverrideDescriptions ()
virtual std::list< bool > GetEnableFlags ()
virtual void SetEnableFlag (bool flag, const char *className, const char *subclassName)
virtual bool GetEnableFlag (const char *className, const char *subclassName)
virtual void Disable (const char *className)
const char * GetLibraryPath ()

Static Public Member Functions

LightObject::Pointer CreateInstance (const char *itkclassname)
std::list< LightObject::PointerCreateAllInstance (const char *itkclassname)
void ReHash ()
void RegisterFactory (ObjectFactoryBase *)
void UnRegisterFactory (ObjectFactoryBase *)
void UnRegisterAllFactories ()
std::list< ObjectFactoryBase * > GetRegisteredFactories ()

Protected Member Functions

virtual void PrintSelf (std::ostream &os, Indent indent) const
void RegisterOverride (const char *classOverride, const char *overrideClassName, const char *description, bool enableFlag, CreateObjectFunctionBase *createFunction)
virtual LightObject::Pointer CreateObject (const char *itkclassname)
 ObjectFactoryBase ()
virtual ~ObjectFactoryBase ()

Detailed Description

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 50 of file itkObjectFactoryBase.h.


Member Typedef Documentation

typedef SmartPointer<const Self> itk::ObjectFactoryBase::ConstPointer
 

Reimplemented from itk::Object.

Reimplemented in itk::AnalyzeImageIOFactory, itk::Brains2MaskImageIOFactory, itk::DICOMImageIO2Factory, itk::DicomImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::GiplImageIOFactory, itk::JPEGImageIOFactory, itk::MetaImageIOFactory, itk::PNGImageIOFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::SiemensVisionImageIOFactory, itk::StimulateImageIOFactory, itk::TIFFImageIOFactory, and itk::VTKImageIOFactory.

Definition at line 57 of file itkObjectFactoryBase.h.

typedef SmartPointer<Self> itk::ObjectFactoryBase::Pointer
 

Reimplemented from itk::Object.

Reimplemented in itk::AnalyzeImageIOFactory, itk::Brains2MaskImageIOFactory, itk::DICOMImageIO2Factory, itk::DicomImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::GiplImageIOFactory, itk::JPEGImageIOFactory, itk::MetaImageIOFactory, itk::PNGImageIOFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::SiemensVisionImageIOFactory, itk::StimulateImageIOFactory, itk::TIFFImageIOFactory, and itk::VTKImageIOFactory.

Definition at line 56 of file itkObjectFactoryBase.h.

typedef ObjectFactoryBase itk::ObjectFactoryBase::Self
 

Standard class typedefs.

Reimplemented from itk::Object.

Reimplemented in itk::AnalyzeImageIOFactory, itk::Brains2MaskImageIOFactory, itk::DICOMImageIO2Factory, itk::DicomImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::GiplImageIOFactory, itk::JPEGImageIOFactory, itk::MetaImageIOFactory, itk::PNGImageIOFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::SiemensVisionImageIOFactory, itk::StimulateImageIOFactory, itk::TIFFImageIOFactory, and itk::VTKImageIOFactory.

Definition at line 54 of file itkObjectFactoryBase.h.

typedef Object itk::ObjectFactoryBase::Superclass
 

Reimplemented from itk::Object.

Reimplemented in itk::AnalyzeImageIOFactory, itk::Brains2MaskImageIOFactory, itk::DICOMImageIO2Factory, itk::DicomImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::GiplImageIOFactory, itk::JPEGImageIOFactory, itk::MetaImageIOFactory, itk::PNGImageIOFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::SiemensVisionImageIOFactory, itk::StimulateImageIOFactory, itk::TIFFImageIOFactory, and itk::VTKImageIOFactory.

Definition at line 55 of file itkObjectFactoryBase.h.


Constructor & Destructor Documentation

itk::ObjectFactoryBase::ObjectFactoryBase  )  [protected]
 

virtual itk::ObjectFactoryBase::~ObjectFactoryBase  )  [protected, virtual]
 


Member Function Documentation

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.

LightObject::Pointer itk::ObjectFactoryBase::CreateInstance const char *  itkclassname  )  [static]
 

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.

virtual LightObject::Pointer itk::ObjectFactoryBase::CreateObject const char *  itkclassname  )  [protected, virtual]
 

This method is provioded 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 const char* itk::ObjectFactoryBase::GetClassName  )  const [virtual]
 

Run-time type information (and related methods).

Reimplemented from itk::Object.

Reimplemented in itk::AnalyzeImageIOFactory, itk::Brains2MaskImageIOFactory, itk::DICOMImageIO2Factory, itk::DicomImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::GiplImageIOFactory, itk::JPEGImageIOFactory, itk::MetaImageIOFactory, itk::PNGImageIOFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::SiemensVisionImageIOFactory, itk::StimulateImageIOFactory, itk::TIFFImageIOFactory, and itk::VTKImageIOFactory.

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::AnalyzeImageIOFactory, itk::Brains2MaskImageIOFactory, itk::DICOMImageIO2Factory, itk::DicomImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::GiplImageIOFactory, itk::JPEGImageIOFactory, itk::MetaImageIOFactory, itk::PNGImageIOFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::SiemensVisionImageIOFactory, itk::StimulateImageIOFactory, itk::TIFFImageIOFactory, and itk::VTKImageIOFactory.

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::AnalyzeImageIOFactory, itk::Brains2MaskImageIOFactory, itk::DICOMImageIO2Factory, itk::DicomImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, itk::GiplImageIOFactory, itk::JPEGImageIOFactory, itk::MetaImageIOFactory, itk::PNGImageIOFactory, itk::RawImageIOFactory< TPixel, VImageDimension >, itk::SiemensVisionImageIOFactory, itk::StimulateImageIOFactory, itk::TIFFImageIOFactory, and itk::VTKImageIOFactory.

const char* itk::ObjectFactoryBase::GetLibraryPath  ) 
 

This returns the path to a dynamically loaded factory.

std::list<ObjectFactoryBase*> itk::ObjectFactoryBase::GetRegisteredFactories  )  [static]
 

Return the list of all registered factories. This is NOT a copy, do not remove items from this list!

virtual void itk::ObjectFactoryBase::PrintSelf std::ostream &  os,
Indent  indent
const [protected, virtual]
 

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::AnalyzeImageIOFactory, itk::GE4ImageIOFactory, itk::GE5ImageIOFactory, itk::GEAdwImageIOFactory, and itk::SiemensVisionImageIOFactory.

void itk::ObjectFactoryBase::RegisterFactory ObjectFactoryBase  )  [static]
 

Register a factory so it can be used to create itk objects.

void itk::ObjectFactoryBase::RegisterOverride const char *  classOverride,
const char *  overrideClassName,
const char *  description,
bool  enableFlag,
CreateObjectFunctionBase createFunction
[protected]
 

Register object creation information with the factory.

void itk::ObjectFactoryBase::ReHash  )  [static]
 

Re-check the ITK_AUTOLOAD_PATH for new factory libraries. This calls UnRegisterAll before re-loading.

virtual void itk::ObjectFactoryBase::SetEnableFlag bool  flag,
const char *  className,
const char *  subclassName
[virtual]
 

Set the Enable flag for the specific override of className.

void itk::ObjectFactoryBase::UnRegisterAllFactories  )  [static]
 

Unregister all factories.

void itk::ObjectFactoryBase::UnRegisterFactory ObjectFactoryBase  )  [static]
 

Remove a factory from the list of registered factories.


The documentation for this class was generated from the following file:
Generated at Sun Apr 1 03:11:40 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000