Requirements
The Class Factory should Allow/Support:
- Construction of objects by unique identifier (name of the object)
- Pass arbitrary parameter and parameter types to object constructor
- Construction of objects with the help of a static class factory function
- Construction of a "Type Copy" of an object instance
- Object should have the ability to construct its child classes
- Get a list of implemented child classes for a specific class type
- Two way object registration:
- register objects with static register macro (object are known if library is loaded)
- register objects with the help of class files (library is only loaded if necessary)
- Limited class reflection:
- Object knows its identifier/name (identifier includes the namespace of the object while the name is namespace free (and therefore the name is not necessarily unique))
- Object knows its id (number) (id number is only valid during runtime)
- Object knows its child classes
- Object can determine if it is of abstract type
Preconditions
To enable the class factory to construct a object the following preconditions have to be fulfilled:
- The desired class is derived from the Object class
- The class is registered at the factory using one of the two possible registration methods