File control/src/utils/ActuatorFactory.hpp#
Go to the source code of this file
Factory to generate user-defined sensors.
Defines
-
AUTO_REGISTER_ACTUATOR(class_name, class_type)#
-
namespace ActuatorFactory#
Namespace for Actuator factory related objects.
Typedefs
-
typedef SP::Actuator (*object_creator)(SP::ControlSensor)#
A pointer to function, returning a pointer to Actuator, built with a SP::ControlSensor.
-
typedef std::map<unsigned int, object_creator> MapFactory#
The type of the factory map.
-
typedef MapFactory::iterator MapFactoryIt#
An iterator through the MapFactory.
Functions
-
class Registry#
- #include <ActuatorFactory.hpp>
Registry Class for Actuators.
Actuator factory. Use:
With sensorType a std::string, the name of the class of your Actuator (expl: “ActuatorPosition”), timeD a SP::TimeDiscretisation and ds a SP::DynamicalSystem.ActuatorFactory::Registry& regActuator(ActuatorFactory::Registry::get()) ; Actuator * yourActuator = regActuator.instantiate(sensorType, timeD, ds);
Public Functions
-
void add(unsigned int type, object_creator creator)#
Add an object_creator into the factory_map, factory_map[name] = object.
- Parameters:
type – the type of the added Actuator
creator – object creator
Public Static Functions
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(unsigned int type, object_creator creator)#
-
class Registration#
- #include <ActuatorFactory.hpp>
Registration Class for Actuators.
Class used for auto-registration of Actuator-type objects.
Public Functions
-
Registration(unsigned int type, object_creator creator)#
To register some new object into the factory.
- Parameters:
type – the type of the added Actuator
creator – object creator
-
Registration(unsigned int type, object_creator creator)#
-
typedef SP::Actuator (*object_creator)(SP::ControlSensor)#