ALBA
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
albaObjectFactory Class Referenceabstract

#include <albaObjectFactory.h>

Inheritance diagram for albaObjectFactory:
Inheritance graph
[legend]
Collaboration diagram for albaObjectFactory:
Collaboration graph
[legend]

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)
 
albaReferenceCountedGetArgs (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 albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () const
 
virtual void Print (std::ostream &os, const int indent=0) const
 
 albaObject (const albaObject &c)
 

Static Public Member Functions

static albaObjectCreateInstance (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 albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 

Protected Types

typedef std::multimap< std::string, mmuOverrideInformationmmuOverRideMap
 

Protected Member Functions

virtual albaObjectCreateObject (const char *classname)
 
albaReferenceCountedGetFactoryArgs (const char *type_name)
 

Protected Attributes

mmuOverRideMapm_OverrideMap
 
- Protected Attributes inherited from albaReferenceCounted
int m_ReferenceCount
 
- Protected Attributes inherited from albaObject
bool m_HeapFlag
 

Detailed Description

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.

See also
albaObject

Definition at line 51 of file albaObjectFactory.h.

Member Typedef Documentation

◆ mmuOverRideMap

typedef std::multimap<std::string, mmuOverrideInformation> albaObjectFactory::mmuOverRideMap
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.

Constructor & Destructor Documentation

◆ albaObjectFactory()

albaObjectFactory::albaObjectFactory ( )

◆ ~albaObjectFactory()

virtual albaObjectFactory::~albaObjectFactory ( )
virtual

Member Function Documentation

◆ albaAbstractTypeMacro()

albaObjectFactory::albaAbstractTypeMacro ( albaObjectFactory  ,
albaReferenceCounted   
)

Run-time type information (and related methods).

◆ CreateInstance()

static albaObject * albaObjectFactory::CreateInstance ( const char *  classname)
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.

◆ CreateAllInstance()

static std::list< albaObject * > albaObjectFactory::CreateAllInstance ( const char *  classname)
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.

◆ ReHash()

static void albaObjectFactory::ReHash ( )
static

Re-check the ALBA_AUTOLOAD_PATH for new factory libraries.

This calls UnRegisterAll before re-loading.

◆ RegisterFactory()

static void albaObjectFactory::RegisterFactory ( albaObjectFactory )
static

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

◆ UnRegisterFactory()

static void albaObjectFactory::UnRegisterFactory ( albaObjectFactory )
static

Remove a factory from the list of registered factories.

◆ UnRegisterAllFactories()

static void albaObjectFactory::UnRegisterAllFactories ( )
static

Unregister all factories.

◆ GetRegisteredFactories()

static std::list< albaObjectFactory * > albaObjectFactory::GetRegisteredFactories ( )
static

Return the list of all registered factories.

This is NOT a copy, do not remove items from this list!

◆ GetALBASourceVersion()

virtual const char * albaObjectFactory::GetALBASourceVersion ( void  ) const
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.

◆ GetDescription()

virtual const char * albaObjectFactory::GetDescription ( void  ) const
pure virtual

Return a descriptive string describing the factory.

Implemented in albaCoreFactory, albaPipeFactory, and albaInteractionFactory.

◆ GetClassOverrideNames()

virtual std::list< std::string > albaObjectFactory::GetClassOverrideNames ( )
virtual

Return a list of classes that this factory overrides.

◆ GetClassOverrideWithNames()

virtual std::list< std::string > albaObjectFactory::GetClassOverrideWithNames ( )
virtual

Return a list of the names of classes that override classes.

◆ GetClassOverrideTypeNames()

virtual std::list< std::string > albaObjectFactory::GetClassOverrideTypeNames ( )
virtual

Return a list of typeName for class overrides.

◆ GetEnableFlags()

virtual std::list< bool > albaObjectFactory::GetEnableFlags ( )
virtual

Return a list of enable flags.

◆ SetEnableFlag()

virtual void albaObjectFactory::SetEnableFlag ( bool  flag,
const char *  className,
const char *  subclassName 
)
virtual

Set the Enable flag for the specific override of className.

◆ GetEnableFlag()

virtual bool albaObjectFactory::GetEnableFlag ( const char *  className,
const char *  subclassName 
)
virtual

Get the Enable flag for the specific override of className.

◆ Disable()

virtual void albaObjectFactory::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.

◆ GetLibraryPath()

const char * albaObjectFactory::GetLibraryPath ( )

This returns the path to a dynamically loaded factory.

◆ GetObjectTypeName()

std::string albaObjectFactory::GetObjectTypeName ( const char *  classname)

Returns the Object Type Name.

◆ RegisterNewObject()

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().

◆ RegisterOverride()

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.

◆ GetArgs()

albaReferenceCounted * albaObjectFactory::GetArgs ( const char *  type_name)

return argument data assigned to object in the factory

◆ Print()

virtual void albaObjectFactory::Print ( std::ostream &  os,
const int  indent = 0 
) const
virtual

dump the object

Reimplemented from albaObject.

◆ CreateObject()

virtual albaObject * albaObjectFactory::CreateObject ( const char *  classname)
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.

◆ GetFactoryArgs()

albaReferenceCounted * albaObjectFactory::GetFactoryArgs ( const char *  type_name)
protected

internally used to retrieve args for this factory

Member Data Documentation

◆ m_OverrideMap

mmuOverRideMap* albaObjectFactory::m_OverrideMap
protected

Definition at line 182 of file albaObjectFactory.h.


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