WorldElementBase.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2020 Jose Luis Blanco Claraco |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under 3-clause BSD License |
7  | See COPYING |
8  +-------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
12 #include <mvsim/ClassFactory.h>
13 #include <mvsim/Simulable.h>
14 #include <mvsim/VisualObject.h>
15 
16 namespace mvsim
17 {
18 class WorldElementBase : public VisualObject, public Simulable
19 {
20  public:
21  using Ptr = std::shared_ptr<WorldElementBase>;
22 
23  WorldElementBase(World* parent) : VisualObject(parent) {}
24  virtual ~WorldElementBase() {}
30  static Ptr factory(
31  World* parent, const rapidxml::xml_node<char>* xml_node,
32  const char* class_name = nullptr);
33 
34  virtual void loadConfigFrom(const rapidxml::xml_node<char>* root) = 0;
35 
36  protected:
37 };
38 
39 // Class factory:
42 
44 
45 #define DECLARES_REGISTER_WORLD_ELEMENT(CLASS_NAME) \
46  DECLARES_REGISTER_CLASS2( \
47  CLASS_NAME, WorldElementBase, World*, const rapidxml::xml_node<char>*)
48 
49 #define REGISTER_WORLD_ELEMENT(TEXTUAL_NAME, CLASS_NAME) \
50  REGISTER_CLASS2( \
51  TClassFactory_worldElements, classFactory_worldElements, TEXTUAL_NAME, \
52  CLASS_NAME)
53 } // namespace mvsim
std::shared_ptr< Simulable > Ptr
Definition: Simulable.h:27
static Ptr factory(World *parent, const rapidxml::xml_node< char > *xml_node, const char *class_name=nullptr)
WorldElementBase(World *parent)
TClassFactory_worldElements classFactory_worldElements
virtual void loadConfigFrom(const rapidxml::xml_node< char > *root)=0
T root(const T v0, const T v1)


mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:51