ALBA
|
#include <albaObjectFactory.h>
Classes | |
struct | mmuOverrideInformation |
Public Member Functions | |
albaAbstractTypeMacro (albaObjectFactory, albaReferenceCounted) | |
virtual const char * | GetALBASourceVersion (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 > | GetClassOverrideTypeNames () |
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 () |
std::string | GetObjectTypeName (const char *classname) |
void | RegisterNewObject (const char *ObjectName, const char *typeName, albaCreateObjectFunction createFunction, albaReferenceCounted *args=NULL) |
void | RegisterOverride (const char *classOverride, const char *overrideClassName, const char *typeName, bool enableFlag, albaCreateObjectFunction createFunction, albaReferenceCounted *args=NULL) |
albaReferenceCounted * | GetArgs (const char *type_name) |
virtual void | Print (std::ostream &os, const int indent=0) const |
albaObjectFactory () | |
virtual | ~albaObjectFactory () |
Public Member Functions inherited from albaReferenceCounted | |
albaReferenceCounted () | |
virtual | ~albaReferenceCounted () |
albaAbstractTypeMacro (albaReferenceCounted, albaObject) | |
virtual void | Delete () |
void | Register (void *obj) |
virtual void | UnRegister (void *obj) |
int | GetReferenceCount () |
void | SetReferenceCount (int) |
Public Member Functions inherited from albaObject | |
albaObject () | |
virtual | ~albaObject () |
virtual void | Delete () |
virtual const char * | GetTypeName () const |
virtual bool | IsA (const char *type_name) const |
virtual bool | IsA (const albaTypeID &type_id) const |
virtual albaObject * | NewObjectInstance () const =0 |
virtual const albaTypeID & | GetTypeId () const |
virtual void | Print (std::ostream &os, const int indent=0) const |
albaObject (const albaObject &c) | |
Static Public Member Functions | |
static albaObject * | CreateInstance (const char *classname) |
static std::list< albaObject * > | CreateAllInstance (const char *classname) |
static void | ReHash () |
static void | RegisterFactory (albaObjectFactory *) |
static void | UnRegisterFactory (albaObjectFactory *) |
static void | UnRegisterAllFactories () |
static std::list< albaObjectFactory * > | GetRegisteredFactories () |
Static Public Member Functions inherited from albaObject | |
static const char * | GetStaticTypeName () |
static bool | IsStaticType (const char *type_name) |
static bool | IsStaticType (const albaTypeID &type_id) |
static const albaTypeID & | GetStaticTypeId () |
static albaObject * | SafeDownCast (albaObject *o) |
Protected Types | |
typedef std::multimap< std::string, mmuOverrideInformation > | mmuOverRideMap |
Protected Member Functions | |
virtual albaObject * | CreateObject (const char *classname) |
albaReferenceCounted * | GetFactoryArgs (const char *type_name) |
Protected Attributes | |
mmuOverRideMap * | m_OverrideMap |
Protected Attributes inherited from albaReferenceCounted | |
int | m_ReferenceCount |
Protected Attributes inherited from albaObject | |
bool | m_HeapFlag |
Create instances of classes using an object factory.
albaObjectFactory is used to create albaObject's. The base class albaObjectFactory contains a static method CreateInstance() that is used to create alba objects from the list of registered albaObjectFactory sub-classes. The first time CreateInstance() is called, all dll's or shared libraries in the environment variable ALBA_AUTOLOAD_PATH are loaded into the current process. The C function albaLoad is called on each dll. albaLoad should return an instance of the factory sub-class implemented in the shared library. ALBA_AUTOLOAD_PATH is an environment variable containing a colon separated (semi-colon on win32) list of paths.
Definition at line 51 of file albaObjectFactory.h.
|
protected |
albaStringOverMap - Internal implementation class for ObjectFactorBase.
Create a sub class to shrink the size of the symbols Also, so a forward reference can be put in albaObjectFactory.h and a pointer member can be used. This avoids other classes including <map> and getting long symbol warnings.
Definition at line 180 of file albaObjectFactory.h.
albaObjectFactory::albaObjectFactory | ( | ) |
|
virtual |
albaObjectFactory::albaAbstractTypeMacro | ( | albaObjectFactory | , |
albaReferenceCounted | |||
) |
Run-time type information (and related methods).
|
static |
Create and return an instance of the named object.
Each loaded albaObjectFactory will be asked in the order the factory was in the ALBA_AUTOLOAD_PATH. After the first factory returns the object no other factories are asked.
|
static |
Create and return all possible instances of the named object.
Each loaded albaObjectFactory will be asked in the order the factory was in the ALBA_AUTOLOAD_PATH. All created objects will be returned in the list.
|
static |
Re-check the ALBA_AUTOLOAD_PATH for new factory libraries.
This calls UnRegisterAll before re-loading.
|
static |
Register a factory so it can be used to create alba objects.
|
static |
Remove a factory from the list of registered factories.
|
static |
Unregister all factories.
|
static |
Return the list of all registered factories.
This is NOT a copy, do not remove items from this list!
|
pure virtual |
All sub-classes of albaObjectFactory should must return the version of ALBA they were built with.
This should be implemented with the macro ALBA_SOURCE_VERSION and NOT a call to Version::GetALBASourceVersion. 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 albaCoreFactory, albaPipeFactory, and albaInteractionFactory.
|
pure virtual |
Return a descriptive string describing the factory.
Implemented in albaCoreFactory, albaPipeFactory, and albaInteractionFactory.
|
virtual |
Return a list of classes that this factory overrides.
|
virtual |
Return a list of the names of classes that override classes.
|
virtual |
Return a list of typeName for class overrides.
|
virtual |
Return a list of enable flags.
|
virtual |
Set the Enable flag for the specific override of className.
|
virtual |
Get the Enable flag for the specific override of 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.
const char * albaObjectFactory::GetLibraryPath | ( | ) |
This returns the path to a dynamically loaded factory.
std::string albaObjectFactory::GetObjectTypeName | ( | const char * | classname | ) |
Returns the Object Type Name.
void albaObjectFactory::RegisterNewObject | ( | const char * | ObjectName, |
const char * | typeName, | ||
albaCreateObjectFunction | createFunction, | ||
albaReferenceCounted * | args = NULL |
||
) |
This function can be used by Application code to register new Objects's to the albaCoreFactory.
Referenced by albaPlugObject< T >::albaPlugObject().
void albaObjectFactory::RegisterOverride | ( | const char * | classOverride, |
const char * | overrideClassName, | ||
const char * | typeName, | ||
bool | enableFlag, | ||
albaCreateObjectFunction | createFunction, | ||
albaReferenceCounted * | args = NULL |
||
) |
Register object creation information with the factory.
albaReferenceCounted * albaObjectFactory::GetArgs | ( | const char * | type_name | ) |
return argument data assigned to object in the factory
|
virtual |
dump the object
Reimplemented from albaObject.
|
protectedvirtual |
This method is provided by sub-classes of albaObjectFactory.
It should create the named alba object or return 0 if that object is not supported by the factory implementation.
|
protected |
internally used to retrieve args for this factory
|
protected |
Definition at line 182 of file albaObjectFactory.h.