SensorBase.h
Go to the documentation of this file.
00001 /*+-------------------------------------------------------------------------+
00002   |                       MultiVehicle simulator (libmvsim)                 |
00003   |                                                                         |
00004   | Copyright (C) 2014  Jose Luis Blanco Claraco (University of Almeria)    |
00005   | Copyright (C) 2017  Borys Tymchenko (Odessa Polytechnic University)     |
00006   | Distributed under GNU General Public License version 3                  |
00007   |   See <http://www.gnu.org/licenses/>                                    |
00008   +-------------------------------------------------------------------------+ */
00009 
00010 #pragma once
00011 
00012 #include <mvsim/VisualObject.h>
00013 #include <mvsim/Simulable.h>
00014 #include <mvsim/ClassFactory.h>
00015 
00016 namespace mvsim
00017 {
00018 class VehicleBase;
00019 
00020 class SensorBase : public VisualObject, public Simulable
00021 {
00022    public:
00023         using Ptr = std::shared_ptr<SensorBase>;
00024 
00025         SensorBase(VehicleBase& vehicle);  
00026 
00027         virtual ~SensorBase();
00028 
00031         static SensorBase* factory(
00032                 VehicleBase& parent, const rapidxml::xml_node<char>* xml_node);
00033 
00034         virtual void loadConfigFrom(const rapidxml::xml_node<char>* root) = 0;
00035 
00036         double m_sensor_period;  
00037 
00038 
00039    protected:
00040         VehicleBase& m_vehicle;  
00041 
00042         double m_sensor_last_timestamp;  
00043 
00044 };
00045 
00046 // Class factory:
00047 typedef ClassFactory<SensorBase, VehicleBase&, const rapidxml::xml_node<char>*>
00048         TClassFactory_sensors;
00049 extern TClassFactory_sensors classFactory_sensors;
00050 
00051 #define DECLARES_REGISTER_SENSOR(CLASS_NAME) \
00052         DECLARES_REGISTER_CLASS2(                \
00053                 CLASS_NAME, SensorBase, VehicleBase&, const rapidxml::xml_node<char>*)
00054 
00055 #define REGISTER_SENSOR(TEXTUAL_NAME, CLASS_NAME) \
00056         REGISTER_CLASS2(                              \
00057                 TClassFactory_sensors, classFactory_sensors, TEXTUAL_NAME, CLASS_NAME)
00058 }


mvsim
Author(s):
autogenerated on Thu Sep 7 2017 09:27:48