humoto
config_msgpack.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4  @copyright 2014-2017 INRIA. Licensed under the Apache License, Version 2.0.
5  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
6 
7  @brief
8 
9  @note Headers with the implementation are included in 'config.h'.
10 */
11 
12 #pragma once
13 
14 #ifdef HUMOTO_CONFIG_DISABLED
15  #error "This header must be included before humoto.h"
16 #else
17 
18  #include "humoto_helpers.h"
19 
20  #include "msgpack.hpp"
21 
22  #include "config_msgpack/reader.h"
23  #include "config_msgpack/writer.h"
24 
25 
26  namespace humoto
27  {
28  namespace config
29  {
30  /**
31  * @brief MessagePack bridge namespace.
32  */
33  namespace msgpack
34  {
38  #endif
39  {
40  protected:
41  #ifdef HUMOTO_CONFIG_CONFIGURABLE_BASE_PARENT
42  using HUMOTO_CONFIG_CONFIGURABLE_BASE_PARENT::writeConfigEntries;
43  using HUMOTO_CONFIG_CONFIGURABLE_BASE_PARENT::readConfigEntries;
44  #endif
45 
46  ///@{
47  /**
48  * @attention Implementations of these methods are added
49  * automatically upon inclusion of define_accessors.h.
50  */
51  virtual void writeConfigEntries(humoto::config::msgpack::Writer &) const = 0;
52  virtual void readConfigEntries(humoto::config::msgpack::Reader &, const bool) = 0;
53  ///@}
54  };
55 
56  #ifdef HUMOTO_CONFIG_CONFIGURABLE_BASE_PARENT
57  #undef HUMOTO_CONFIG_CONFIGURABLE_BASE_PARENT
58  #endif
59  #define HUMOTO_CONFIG_CONFIGURABLE_BASE_PARENT humoto::config::msgpack::ConfigurableBase
60  }
61  }
62  }
63 
64  #define HUMOTO_BRIDGE_config_msgpack_DEFINITIONS \
65  protected: \
66  void writeConfigEntries(humoto::config::msgpack::Writer & writer) const \
67  { \
68  writeConfigEntriesTemplate(writer); \
69  }\
70  void readConfigEntries(humoto::config::msgpack::Reader & reader, const bool crash_flag)\
71  {\
72  readConfigEntriesTemplate(reader, crash_flag);\
73  }
74 
75  #ifndef HUMOTO_USE_CONFIG
76  #define HUMOTO_USE_CONFIG
77  #endif
78 
79 #endif
virtual void writeConfigEntries(humoto::config::msgpack::Writer &) const =0
virtual void readConfigEntries(humoto::config::msgpack::Reader &, const bool)=0
Very basic definitions.
#define HUMOTO_CONFIG_CONFIGURABLE_BASE_PARENT
The root namespace of HuMoTo.
Definition: config.h:12
Configuration reader class.
Definition: reader.h:21
Configuration writer class.
Definition: writer.h:21