What should i say, the class factory.
More...
#include <factory/Factory.h>
What should i say, the class factory.
The class factory is capable to construct instances of registered classes using the factory macros. Class objects can be accessed using the identifier or the meta information of the class.
◆ Type
◆ ClassFactory()
◆ ~ClassFactory()
◆ newInstance() [1/3]
CLASS * newInstance |
( |
std::string const & |
classIdentifier | ) |
|
|
inlinestatic |
Create new instance of the class defined by class identifier.
The created class is casted to the class type defined by CLASS.
- Exceptions
-
XFactoryBadCast | If dynamic cast to desired class type fails |
XFactoryUnknown | If the given identifier is unknown |
XFactoryLogical | If the class creation fails. |
◆ newInstance() [2/3]
CLASS * newInstance |
( |
std::string const & |
classIdentifier, |
|
|
int |
paramCount, |
|
|
|
... |
|
) |
| |
|
inlinestatic |
Create new instance of the class defined by class identifier.
Additional constructor parameters can be passed using the va_list. The created class is casted to the class type defined by CLASS.
- Exceptions
-
XFactoryBadCast | If dynamic cast to desired class type fails |
XFactoryUnknown | If the given identifier is unknown |
XFactoryLogical | If the class creation fails. |
◆ newInstance() [3/3]
CLASS * newInstance |
( |
std::string const & |
classIdentifier, |
|
|
int |
paramCount, |
|
|
std::va_list |
list |
|
) |
| |
|
inlinestatic |
◆ isClassRegistered()
static bool isClassRegistered |
( |
std::string const & |
classIdentifier | ) |
|
|
inlinestatic |
Return true if a class with the desired identifier is registered.
◆ getClassByIdentifier()
static ClassProxy getClassByIdentifier |
( |
std::string const & |
classIdentifier | ) |
|
|
inlinestatic |
◆ getClassByMeta() [1/2]
static std::vector<ClassProxy> getClassByMeta |
( |
std::string const & |
metaKey, |
|
|
std::string const & |
metaValue |
|
) |
| |
|
inlinestatic |
Return list of Class objects matching the meta criterion.
- See also
- Class::getClassByMeta(std::string const& metaKey, std::string const& metaValue )
◆ getClassByMeta() [2/2]
static std::vector<ClassProxy> getClassByMeta |
( |
T |
funcPtr | ) |
|
|
inlinestatic |
Return list of Class objects returning true for the given comparison function.
- See also
- Class::getClassByMeta( T funcPtr, std::vector<ClassProxy>& pResult )
◆ getDerivedClasses()
static std::map<std::string, ClassProxy > getDerivedClasses |
( |
| ) |
|
|
inlinestatic |
Return list of registered classes.
◆ registerClass() [1/2]
static void registerClass |
( |
boost::shared_ptr< Class > |
iClass | ) |
|
|
static |
Register Class.
You normally don't have to call this function. Use the Macros instead.
- Exceptions
-
XFactoryLogical | If class identifier is already in use |
◆ registerClass() [2/2]
static void registerClass |
( |
boost::shared_ptr< Class > |
iClass, |
|
|
boost::shared_ptr< Class > |
baseClass |
|
) |
| |
|
static |
Register Class.
You normally don't have to call this function. Use the Macros instead.
- Exceptions
-
XFactoryLogical | If class identifier is already in use |
XFactoryLogical | If base class and class do have the same identifiers. |
◆ unregisterClass()
static void unregisterClass |
( |
Class * |
iClass | ) |
|
|
static |
Unregister Class.
Remove the class from the list of known classes and reduce the class tree.
◆ postRegisterBaseClasses()
static void postRegisterBaseClasses |
( |
std::string const & |
iClass, |
|
|
std::vector< std::string > const & |
parents |
|
) |
| |
|
static |
Register Parent - Child relationship.
You normally don't have to call this function. Use the Macros instead.
- Exceptions
-
XFactoryUnknown | if one ore more identifiers are unknown |
◆ finalizePostRegister()
static void finalizePostRegister |
( |
| ) |
|
|
static |
Propagate all children to indirect parents and add meta information of parent classes to children.
You normally don't have to call this function. Use the Macros instead.
◆ propagateChild()
Auxiliary function to propagate child classes to indirect parents.
◆ internalClassRegister()
bool internalClassRegister |
( |
boost::shared_ptr< Class > |
iClass | ) |
|
|
protected |
Internal function to register a class.
Used by registerClass() with and without parent.
◆ instance()
static Type& instance |
( |
| ) |
|
|
inlinestaticinherited |
Returns a reference to the singleton instance.
- Exceptions
-
XSingleton | If the singleton was already destroyed (dead reference) or not yet created (when using ExplicitInstantiation). |
◆ isDestroyed()
static bool isDestroyed |
( |
| ) |
|
|
inlinestaticinherited |
Returns true, if the singleton was already destroyed.
Trying to access it will result in an exception.
◆ makeInstance()
static Type* makeInstance |
( |
| ) |
|
|
inlinestaticprotectedinherited |
◆ destroyInstance()
static void destroyInstance |
( |
void |
| ) |
|
|
inlinestaticprotectedinherited |
◆ ClassProxy
◆ LightFactoryMutexGetter
friend class LightFactoryMutexGetter |
|
friend |
◆ VacantClass
The documentation for this class was generated from the following file: