Ariles
reader.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @copyright 2014-2017 INRIA. Licensed under the Apache License, Version 2.0.
6  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7 
8  @copyright 2017-2018 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
9  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
10 
11  @brief
12 */
13 
14 #pragma once
15 
16 namespace ariles2
17 {
18  namespace ns_msgpack
19  {
20  namespace impl
21  {
23  }
24 
25 
26  /**
27  * @brief Configuration reader class
28  */
29  class ARILES2_VISIBILITY_ATTRIBUTE Reader : public serialization::PIMPLVisitor<read::Visitor, impl::Reader>
30  {
31  protected:
32  bool startRoot(const std::string &name);
33  void endRoot(const std::string &name);
34 
35 
36  public:
37  /**
38  * @brief Constructor
39  *
40  * @param[in] file_name
41  */
42  explicit Reader(const std::string &file_name);
43 
44 
45  /**
46  * @brief Constructor
47  *
48  * @param[in] input_stream
49  */
50  explicit Reader(std::istream &input_stream);
51 
52 
53  void startMap(
54  const SizeLimitEnforcementType limit_type = SIZE_LIMIT_NONE,
55  const std::size_t min = 0,
56  const std::size_t max = 0);
57  bool startMapEntry(const std::string &child_name);
58  void endMapEntry();
59 
60 
61  std::size_t startArray();
62  void startArrayElement();
63  void endArrayElement();
64  void endArray();
65 
66 
67 #define ARILES2_BASIC_TYPE(type) void readElement(type &element);
68 
70 
71 #undef ARILES2_BASIC_TYPE
72  };
73  } // namespace ns_msgpack
74 } // namespace ariles2
ariles2
Definition: basic.h:16
ARILES2_BASIC_TYPES_LIST
#define ARILES2_BASIC_TYPES_LIST
Definition: helpers.h:131
ariles2::read::Visitor::SizeLimitEnforcementType
SizeLimitEnforcementType
Definition: read.h:47
ariles2::ns_octave::ARILES2_MACRO_SUBSTITUTE
ARILES2_MACRO_SUBSTITUTE(ARILES2_BASIC_NUMERIC_TYPES_LIST) void Writer
Definition: writer.cpp:255
ariles2::serialization::PIMPLVisitor
Definition: serialization.h:121
ARILES2_VISIBILITY_ATTRIBUTE
#define ARILES2_VISIBILITY_ATTRIBUTE
Definition: helpers.h:138
ariles2::ns_yaml_cpp::impl::Reader
class ARILES2_VISIBILITY_ATTRIBUTE Reader
Definition: reader.h:19
ariles2::ns_msgpack::Reader
Configuration reader class.
Definition: reader.h:29
ariles2::ns_msgpack::impl::Reader
Definition: reader.cpp:34