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 ariles
17 {
18  namespace ns_msgpack
19  {
20  namespace impl
21  {
23  }
24 
25 
26  /**
27  * @brief Configuration reader class
28  */
29  class ARILES_VISIBILITY_ATTRIBUTE Reader : public ns_msgpack::Base<ariles::read::Visitor, impl::Reader>
30  {
31  protected:
32  std::size_t getMapSize(const bool /*expect_empty*/);
33 
34 
35  public:
36  /**
37  * @brief Constructor
38  *
39  * @param[in] file_name
40  */
41  explicit Reader(const std::string &file_name);
42 
43 
44  /**
45  * @brief Constructor
46  *
47  * @param[in] input_stream
48  */
49  explicit Reader(std::istream &input_stream);
50 
51 
52  bool descend(const std::string &child_name);
53  void ascend();
54 
55 
56  std::size_t startArray();
57  void endArray();
58  void shiftArray();
59 
60 
61  bool startRoot(const std::string &name);
62  void endRoot(const std::string &name);
63 
64 
65 #define ARILES_BASIC_TYPE(type) void readElement(type &element);
66 
68 
69 #undef ARILES_BASIC_TYPE
70  };
71  } // namespace ns_msgpack
72 } // namespace ariles
#define ARILES_BASIC_TYPES_LIST
Definition: helpers.h:105
class ARILES_VISIBILITY_ATTRIBUTE Reader
Definition: reader.h:23
ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_NUMERIC_TYPES_LIST) void Writer
Definition: writer.cpp:224
#define ARILES_VISIBILITY_ATTRIBUTE
Definition: helpers.h:69
Definition: basic.h:17
Configuration reader class.
Definition: reader.h:29