Ariles
serialization.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @copyright 2017-2020 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 #include "common.h"
14 
15 #include "../configurable_flags.h"
16 
17 #ifndef ARILES_API_VERSION
18 # error "ARILES_API_VERSION is not defined, probably unhandled includion order, add explicit definition of ARILES_API_VERSION."
19 #endif
20 
21 
22 namespace ariles
23 {
24  namespace serialization
25  {
26  class ARILES_VISIBILITY_ATTRIBUTE Features : public ariles::Flags<unsigned int, serialization::Features>
27  {
28  public:
29  enum Flags
30  {
31  RESET = 0,
32  SLOPPY_MAPS_SUPPORTED = 1,
33  NATIVE_MATRIX_SUPPORTED = 2,
34  SLOPPY_PAIRS_SUPPORTED = 4,
35 
36  DEFAULT = RESET
37  };
38 
39 
40  public:
42  {
43  setDefaults();
44  }
45 
46  Features(const unsigned int flags, const Action action_type = REPLACE)
47  {
48  initialize(flags, action_type);
49  }
50 
51 
52  void setDefaults()
53  {
54  flags_ = DEFAULT;
55  }
56  };
57 
58 
59  class ARILES_VISIBILITY_ATTRIBUTE Base : public visitor::Base<ariles::ConfigurableFlags>
60  {
61  public:
63 
64  public:
66 
67  template <class t_Ariles>
68  const Parameters &getParameters(const t_Ariles &ariles_class) const
69  {
70  return (ariles_class.arilesGetParameters(*this));
71  }
72 
73 
74  virtual const Features &getSerializationFeatures() const = 0;
75 #if 1 == ARILES_API_VERSION
76  const Features &getBridgeFlags() const
77  {
78  return (getSerializationFeatures());
79  }
80 #endif
81  };
82  } // namespace serialization
83 } // namespace ariles
const Parameters & getParameters(const t_Ariles &ariles_class) const
Definition: serialization.h:68
Features(const unsigned int flags, const Action action_type=REPLACE)
Definition: serialization.h:46
ariles::ConfigurableFlags Parameters
Definition: serialization.h:62
#define ARILES_VISIBILITY_ATTRIBUTE
Definition: helpers.h:69
Definition: basic.h:17