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