Ariles
writer.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 writer class
28  */
29  class ARILES_VISIBILITY_ATTRIBUTE Writer : public ns_msgpack::Base<ariles::write::Visitor, impl::Writer>
30  {
31  public:
32  /**
33  * @brief Constructor
34  *
35  * @param[in] file_name
36  */
37  explicit Writer(const std::string &file_name);
38 
39 
40  /**
41  * @brief Constructor
42  *
43  * @param[out] output_stream
44  */
45  explicit Writer(std::ostream &output_stream);
46 
47 
48  void descend(const std::string &map_name);
49 
50 
51  void startMap(const std::size_t num_entries);
52 
53 
54  void flush();
55 
56 
57  void startArray(const std::size_t size, const bool /*compact*/ = false);
58 
59 
60  void startRoot(const std::string &name);
61  void endRoot(const std::string &name);
62 
63 
64 #define ARILES_BASIC_TYPE(type) void writeElement(const type &element);
65 
67 
68 #undef ARILES_BASIC_TYPE
69  };
70  } // namespace ns_msgpack
71 } // namespace ariles
Configuration writer class.
Definition: writer.h:29
#define ARILES_BASIC_TYPES_LIST
Definition: helpers.h:105
class ARILES_VISIBILITY_ATTRIBUTE Writer
Definition: writer.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