WorldElementBase.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 WorldElementBase : public VisualObject, public Simulable
00019 {
00020    public:
00021         WorldElementBase(World* parent) : VisualObject(parent) {}
00022         virtual ~WorldElementBase() {}
00028         static WorldElementBase* factory(
00029                 World* parent, const rapidxml::xml_node<char>* xml_node,
00030                 const char* class_name = NULL);
00031 
00032         virtual void loadConfigFrom(const rapidxml::xml_node<char>* root) = 0;
00033 
00034    protected:
00035 };
00036 
00037 // Class factory:
00038 typedef ClassFactory<WorldElementBase, World*, const rapidxml::xml_node<char>*>
00039         TClassFactory_worldElements;
00040 extern TClassFactory_worldElements classFactory_worldElements;
00041 
00042 #define DECLARES_REGISTER_WORLD_ELEMENT(CLASS_NAME) \
00043         DECLARES_REGISTER_CLASS2(                       \
00044                 CLASS_NAME, WorldElementBase, World*, const rapidxml::xml_node<char>*)
00045 
00046 #define REGISTER_WORLD_ELEMENT(TEXTUAL_NAME, CLASS_NAME)                       \
00047         REGISTER_CLASS2(                                                           \
00048                 TClassFactory_worldElements, classFactory_worldElements, TEXTUAL_NAME, \
00049                 CLASS_NAME)
00050 }


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