Go to the documentation of this file.
23 #ifndef _SENSORFACTORY_HH_
24 #define _SENSORFACTORY_HH_
41 typedef Sensor* (*SensorFactoryFn) ();
59 public:
static void RegisterAll();
64 public:
static void RegisterSensor(
const std::string &_className,
71 public:
static SensorPtr NewSensor(
const std::string &_className);
76 public:
static void GetSensorTypes(std::vector<std::string> &_types);
79 private:
static std::map<std::string, SensorFactoryFn> sensorMap;
88 #define GZ_REGISTER_STATIC_SENSOR(name, classname) \
89 GZ_SENSORS_VISIBLE Sensor *New##classname() \
91 return new gazebo::sensors::classname(); \
94 void Register##classname() \
96 SensorFactory::RegisterSensor(name, New##classname);\
static void RegisterAll()
Register all known sensors.
std::shared_ptr< Sensor > SensorPtr
Definition: SensorTypes.hh:64
Forward declarations for the common classes.
Definition: Animation.hh:26
Forward declarations and typedefs for sensors.
Sensor *(* SensorFactoryFn)()
Definition: SensorFactory.hh:41
static SensorPtr NewSensor(const std::string &_className)
Create a new instance of a sensor.
Definition: SensorFactory.hh:47
static void GetSensorTypes(std::vector< std::string > &_types)
Get all the sensor types.
Base class for sensors.
Definition: Sensor.hh:51
static void RegisterSensor(const std::string &_className, SensorFactoryFn _factoryfn)
Register a sensor class (called by sensor registration function).