Ariles
Loading...
Searching...
No Matches
reader.h
Go to the documentation of this file.
1/**
2 @file
3 @author Alexander Sherikov
4
5 @copyright 2018 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
14namespace ariles2
15{
16 namespace ns_rosparam
17 {
18 namespace impl
19 {
20 class Reader;
21 }
22
23
24
25 /**
26 * @brief Configuration reader class
27 */
28 class Reader : public serialization::PIMPLVisitor<read::Visitor, impl::Reader>
29 {
30 protected:
31 bool startRoot(const std::string &name);
32 void endRoot(const std::string &name);
33
34 public:
35 /**
36 * @brief Constructor
37 *
38 * @param[in] nh NodeHandle
39 */
40 explicit Reader(const ::ros::NodeHandle &nh);
41
42
43 void startMap(
45 const std::size_t min = 0,
46 const std::size_t max = 0);
47 bool startMapEntry(const std::string &child_name);
48 void endMapEntry();
49
50
52 const SizeLimitEnforcementType /*limit_type*/ = SIZE_LIMIT_NONE,
53 const std::size_t /*min*/ = 0,
54 const std::size_t /*max*/ = 0);
55 bool startIteratedMapElement(std::string &entry_name);
57 void endIteratedMap();
58
59
60 std::size_t startArray();
61 void startArrayElement();
62 void endArrayElement();
63 void endArray();
64
65
66#define ARILES2_BASIC_TYPE(type) void readElement(type &element);
67
69
70#undef ARILES2_BASIC_TYPE
71 };
72 } // namespace ns_rosparam
73} // namespace ariles2
Configuration reader class.
Definition reader.h:29
bool startMapEntry(const std::string &child_name)
startMapEntry to the entry with the given name
Definition reader.cpp:62
bool startIteratedMap(const SizeLimitEnforcementType=SIZE_LIMIT_NONE, const std::size_t=0, const std::size_t=0)
Definition reader.cpp:88
bool startRoot(const std::string &name)
Definition reader.cpp:158
void endMapEntry()
endMapEntry from the current entry to its parent.
Definition reader.cpp:81
void endRoot(const std::string &name)
Definition reader.cpp:168
bool startIteratedMapElement(std::string &entry_name)
Definition reader.cpp:104
void startMap(const SizeLimitEnforcementType limit_type=SIZE_LIMIT_NONE, const std::size_t min=0, const std::size_t max=0)
Definition reader.cpp:49
#define ARILES2_BASIC_TYPES_LIST
Definition helpers.h:72
#define CPPUT_MACRO_SUBSTITUTE(macro)
Definition misc.h:21