ObjectFactory Class Reference
[Services]

Dynamic creation of arbitrary class objects. More...

#include <ObjectFactory.h>

List of all members.

Public Member Functions

virtual void * createObject (const std::string &className)=0
virtual void destroyObject (void *pObject, const std::string &className)=0
virtual void * createObjectVector (const std::string &className)=0
virtual void destroyObjectVector (void *pVector, const std::string &className)=0

Protected Member Functions

virtual ~ObjectFactory ()


Detailed Description

Dynamic creation of arbitrary class objects.

The ObjectFactory can create and destroy objects of arbitrary classes dynamically at runtime.

Definition at line 24 of file ObjectFactory.h.


Constructor & Destructor Documentation

virtual ObjectFactory::~ObjectFactory (  )  [protected, virtual]

This will be cleaned up during application close.

Plug-ins do not need to destroy it.

Definition at line 166 of file ObjectFactory.h.


Member Function Documentation

virtual void* ObjectFactory::createObject ( const std::string &  className  )  [pure virtual]

Instantiate an object whose type is determined at runtime.

Parameters:
className A string containing the class name of the object to be instantiated. The valid object types are: Vectors may also be created with a string of the form "vector<int>" for the types listed in createObjectVector().
Returns:
A pointer to the instantiated object if successful, or NULL.

virtual void ObjectFactory::destroyObject ( void *  pObject,
const std::string &  className 
) [pure virtual]

Deallocate an object that was previously allocated by the ObjectFactory, including vectors.

Parameters:
pObject A pointer to an object previously allocated by the ObjectFactory.
className A string containing the class name of the object to be deallocated.

virtual void* ObjectFactory::createObjectVector ( const std::string &  className  )  [pure virtual]

Instantiate an empty vector of objects whose type is determined at runtime.

Deprecated:
This method is deprecated, and may be removed in a future version. Use ObjectFactory::createObject() instead with an argument of "vector<type>".
Parameters:
className A string containing the name of the class of the object to be instantiated. The valid object types are:
Returns:
A pointer to the instantiated vector if successful, or NULL.

virtual void ObjectFactory::destroyObjectVector ( void *  pVector,
const std::string &  className 
) [pure virtual]

Deallocate a vector of objects whose type is determined at runtime.

This method deletes a vector that was previously allocatied by the object factory. If the vector contains pointers, the objects that the pointers point to are not deleted.

Deprecated:
This method is deprecated, and may be removed in a future version. Use ObjectFactory::destroyObject() instead with an argument of "vector<type>".
Parameters:
pVector A pointer to a vector previously allocated by the ObjectFactory.
className A string containing the name of the class of the object to be instantiated.


Software Development Kit - Opticks 4.9.0 Build 16218