Ariles
octave.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 #define ARILES_VISITOR_INCLUDED_octave
14 
16 #include <ariles/internal/node.h>
17 #include <ariles/visitors/config.h>
18 
19 
20 namespace ariles
21 {
22  namespace ns_octave
23  {
24  namespace impl
25  {
27  }
28 
29 
30  /**
31  * @brief Configuration writer class
32  */
34  {
35  protected:
36  typedef impl::Writer Impl;
39 
40 
41  public:
42  explicit Writer(const std::string &file_name);
43  explicit Writer(std::ostream &output_stream);
44 
45 
46  const serialization::Features &getSerializationFeatures() const;
47 
48 
49  void flush();
50 
51 
52  void descend(const std::string &map_name);
53  void ascend();
54 
55 
56  void startMap(const std::size_t /*num_entries*/)
57  {
58  }
59  void endMap()
60  {
61  }
62 
63 
64  void startArray(const std::size_t size, const bool compact = false);
65  void shiftArray();
66  void endArray();
67 
68 
69  void startMatrix(const bool compact = false);
70  void startMatrixRow();
71  void endMatrixRow();
72  void endMatrix();
73 
74 
75 #define ARILES_BASIC_TYPE(type) void writeElement(const type &element);
76 
78 
79 #undef ARILES_BASIC_TYPE
80  };
81  } // namespace ns_octave
82 } // namespace ariles
83 
84 
85 namespace ariles
86 {
87  /**
88  * @brief Octave visitor.
89  */
91  {
93  };
94 } // namespace ariles
Configuration writer class.
Definition: octave.h:33
ARILES_SHARED_PTR< impl::Writer > ImplPtr
Definition: octave.h:37
ariles::cfgwrite::Visitor< ns_octave::Writer > Writer
Definition: octave.h:92
impl::Writer Impl
Definition: octave.h:36
#define ARILES_BASIC_TYPES_LIST
Definition: helpers.h:105
void startMap(const std::size_t)
Starts a nested map in the configuration file.
Definition: octave.h:56
class ARILES_VISIBILITY_ATTRIBUTE Writer
Definition: octave.h:26
ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_NUMERIC_TYPES_LIST) void Writer
Definition: writer.cpp:224
#define ARILES_VISIBILITY_ATTRIBUTE
Definition: helpers.h:69
void endMap()
Ends a nested map in the configuration file.
Definition: octave.h:59
Definition: basic.h:17