Ariles
declarator.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @copyright 2017-2024 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
6  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7 
8  @brief
9 */
10 
11 #pragma once
12 
13 
14 namespace ariles2
15 {
16  namespace ns_ros2param
17  {
18  namespace impl
19  {
20  class Declarator;
21  }
22 
23 
24 
25  /**
26  * @brief Parameter declarator
27  */
28  class Declarator : public serialization::PIMPLVisitor<write::Visitor, impl::Declarator>
29  {
30  public:
31  explicit Declarator(const rclcpp::node_interfaces::NodeParametersInterface::SharedPtr &nh);
32 
33 
34  void flush();
35 
36 
37  void startMapEntry(const std::string &child_name);
38  void endMapEntry();
39 
40  void startArray(const std::size_t size, const bool /*compact*/ = false);
41  void startArrayElement();
42  void endArrayElement();
43  void endArray();
44 
45 
46 #define ARILES2_BASIC_TYPE(type) void writeElement(const type &element, const Parameters &param);
47 
49 
50 #undef ARILES2_BASIC_TYPE
51  };
52  } // namespace ns_ros2param
53 } // namespace ariles2
Parameter declarator.
Definition: declarator.h:29
void flush()
Flush the configuration to the output.
Definition: declarator.cpp:67
void startMapEntry(const std::string &child_name)
Starts a nested map in the configuration file.
Definition: declarator.cpp:74
Declarator(const rclcpp::node_interfaces::NodeParametersInterface::SharedPtr &nh)
Definition: declarator.cpp:61
void startArray(const std::size_t size, const bool=false)
Definition: declarator.cpp:106
#define ARILES2_BASIC_TYPES_LIST
Definition: helpers.h:72
CPPUT_MACRO_SUBSTITUTE(ARILES2_BASIC_SIGNED_INTEGER_TYPES_LIST) CPPUT_MACRO_SUBSTITUTE(ARILES2_BASIC_UNSIGNED_INTEGER_TYPES_LIST) CPPUT_MACRO_SUBSTITUTE(ARILES2_BASIC_REAL_TYPES_LIST) void Reader
Definition: reader.cpp:417
Definition: basic.h:17