File control/src/utils/SensorFactory.hpp#
Go to the source code of this file
Factory to generate user-defined sensors
Defines
-
AUTO_REGISTER_SENSOR(class_name, class_type)#
-
namespace SensorFactory#
Namespace for Sensor factory related objects.
Typedefs
-
typedef SP::Sensor (*object_creator)(SP::DynamicalSystem)#
A pointer to function, returning a SP::Sensor, built with its type (ie class name) and a SP::DynamicalSystem.
-
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 <SensorFactory.hpp>
Registry Class for sensors.
Sensor factory. Use: SensorFactory::Registry& regSensor(SensorFactory::Registry::get()) ; SP::Sensor yourSensor = regSensor.instantiate(sensorType, timeD, myDS); With sensorType a std::string, the name of the class of your Sensor (expl: “SensorPosition”), timeD a SP::TimeDiscretisation and myDS a SP::DynamicalSystem.
Public Functions
-
void add(int type, object_creator creator)#
Add an object_creator into the factory_map.
- Parameters:
type – the type of the added Sensor
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(int type, object_creator creator)#
-
class Registration#
- #include <SensorFactory.hpp>
Registration Class for sensors.
Class used for auto-registration of Sensor-type objects.
Public Functions
-
Registration(int type, object_creator creator)#
To register some new object into the factory.
- Parameters:
type – the type of the added Sensor
creator – object creator
-
Registration(int type, object_creator creator)#
-
typedef SP::Sensor (*object_creator)(SP::DynamicalSystem)#