23#ifndef _SENSORFACTORY_HH_
24#define _SENSORFACTORY_HH_
41 typedef Sensor* (*SensorFactoryFn) ();
72 const std::string &_className);
78 std::vector<std::string> &_types);
81 private:
static std::map<std::string, SensorFactoryFn> sensorMap;
90 #define GZ_REGISTER_STATIC_SENSOR(name, classname) \
91 Sensor *New##classname() \
93 return new gazebo::sensors::classname(); \
96 void Register##classname() \
98 SensorFactory::RegisterSensor(name, New##classname);\
sensors
Definition SensorManager.hh:35
Forward declarations and typedefs for sensors.
Definition SensorFactory.hh:48
static void GetSensorTypes(std::vector< std::string > &_types)
Get all the sensor types.
static void RegisterSensor(const std::string &_className, SensorFactoryFn _factoryfn)
Register a sensor class (called by sensor registration function).
static SensorPtr NewSensor(const std::string &_className)
Create a new instance of a sensor.
static void RegisterAll()
Register all known sensors.
Base class for sensors.
Definition Sensor.hh:53
Sensor *(* SensorFactoryFn)()
Definition SensorFactory.hh:41
std::shared_ptr< Sensor > SensorPtr
Definition SensorTypes.hh:64
Forward declarations for the common classes.
Definition Animation.hh:27