AnimatLab  2
Test
StdUtils::IStdClassFactory Class Referenceabstract

Standard class factory. More...

#include <StdClassFactory.h>

+ Inheritance diagram for StdUtils::IStdClassFactory:
+ Collaboration diagram for StdUtils::IStdClassFactory:

Public Member Functions

 IStdClassFactory ()
 Default constructor. More...
 
virtual ~IStdClassFactory ()
 Destructor. More...
 
virtual CStdSerializeCreateObject (std::string strClassType, std::string strObjectType, bool bThrowError=true)=0
 Creates an object of the specified class and object types. More...
 

Static Public Member Functions

static IStdClassFactoryLoadModule (std::string strModuleName, bool bThrowError=true)
 Loads a DLL module by name and attempts to call the GetStdClassFactory method to get a pointer to the class factory. More...
 

Detailed Description

Standard class factory.

This is a standard interface used for all class factories. To make your library able able to be loaded you need to derive a class from this and then implement the GetStdClassFactory method within your new DLL.

Author
dcofer
Date
5/3/2011

Definition at line 20 of file StdClassFactory.h.

Constructor & Destructor Documentation

IStdClassFactory::IStdClassFactory ( )

Default constructor.

Author
dcofer
Date
5/3/2011

Definition at line 19 of file StdClassFactory.cpp.

IStdClassFactory::~IStdClassFactory ( )
virtual

Destructor.

Author
dcofer
Date
5/3/2011

Definition at line 29 of file StdClassFactory.cpp.

Member Function Documentation

virtual CStdSerialize* StdUtils::IStdClassFactory::CreateObject ( std::string  strClassType,
std::string  strObjectType,
bool  bThrowError = true 
)
pure virtual

Creates an object of the specified class and object types.

Author
dcofer
Date
5/3/2011
Parameters
strClassTypeType of the class.
strObjectTypeType of the object.
bThrowErrortrue to throw error if there is a problem.
Returns
null if it fails and bThrowError is false, else a pointer to the created object.

Implemented in TestClassFactory.

Referenced by AnimatSim::Simulator::CreateObject(), AnimatSim::Simulator::CreateSimulator(), AnimatSim::Behavior::NervousSystem::LoadNeuralModule(), and AnimatSim::Simulator::LoadStructure().

+ Here is the caller graph for this function:

IStdClassFactory * IStdClassFactory::LoadModule ( std::string  strModuleName,
bool  bThrowError = true 
)
static

Loads a DLL module by name and attempts to call the GetStdClassFactory method to get a pointer to the class factory.

Author
dcofer
Date
5/3/2011
Parameters
strModuleNameName of the DLL module.
Returns
Pointer to the loaded module, exception if not found.

Definition at line 95 of file StdClassFactory.cpp.

References StdUtils::Std_IsBlank(), StdUtils::Std_Replace(), and StdUtils::Std_ToLower().

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: