File kernel/src/modelingTools/RelationFactory.hpp#
Go to the source code of this file
Factory to generate user-defined Relations.
Defines
-
AUTO_REGISTER_RELATION(class_name, class_type)#
-
namespace RelationFactory#
Namespace for Relation factory related objects.
Typedefs
-
typedef SP::Relation (*object_creator)(int)#
A pointer to function, returning a pointer to Relation, built with its type (related to the class name)
-
typedef std::map<int, object_creator> MapFactory#
The type of the factory map.
-
typedef MapFactory::iterator MapFactoryIt#
An iterator through the MapFactory.
Functions
-
class Registry#
- #include <RelationFactory.hpp>
Registry Class for sensors.
Relation factory. Use: RelationFactory::Registry& regRelation(RelationFactory::Registry::get()) ; SP::Relation yourRelation = regRelation.instantiate(type, x0);
Public Functions
-
void add(int name, object_creator obj)#
Add an object_creator into the factory_map, factory_map[name] = object.
- Parameters:
name – an int, the name of the object added
obj – an object creator
Private Members
-
MapFactory factory_map#
map that links a std::string, the type of the class, to a pointer to function, used to build the object.
-
void add(int name, object_creator obj)#
-
class Registration#
- #include <RelationFactory.hpp>
Registration Class for relations.
Class used for auto-registration of Relation-type objects.
Public Functions
-
Registration(int name, object_creator obj)#
To register some new object into the factory.
- Parameters:
name – an int, the name of the object to be registered
obj – an object creator
-
Registration(int name, object_creator obj)#
-
typedef SP::Relation (*object_creator)(int)#