Ariles
methods.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4  @copyright 2014-2017 INRIA. Licensed under the Apache License, Version 2.0.
5  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
6  @copyright 2017-2020 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
7  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
8 
9  @brief Inclusion of this file results in generation of functions which
10  read and write entries 'ARILES_ENTRIES' defined in the including
11  header from / to a configuration file.
12 */
13 
14 
15 #ifdef ARILES_ENABLED
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 # ifndef ARILES_DOXYGEN_PROCESSING
23 
24 public:
25 # ifdef ARILES_ENTRIES
26 
27 # define ARILES_NAMED_ENTRY(entry, name)
28 # define ARILES_PARENT(entry) entry::arilesVisit(visitor, parameters);
29 
30 template <class t_Visitor>
31 void arilesVisitParents(t_Visitor &visitor, const typename t_Visitor::Parameters &parameters)
32 {
33  ARILES_UNUSED_ARG(visitor);
34  ARILES_UNUSED_ARG(parameters);
37 }
38 
39 
40 template <class t_Visitor>
41 void arilesVisitParents(t_Visitor &visitor, const typename t_Visitor::Parameters &parameters) const
42 {
43  ARILES_UNUSED_ARG(visitor);
44  ARILES_UNUSED_ARG(parameters);
47 }
48 
49 # undef ARILES_PARENT
50 # undef ARILES_NAMED_ENTRY
51 
52 
53 # define ARILES_NAMED_ENTRY(entry, name) visitor(entry, name, parameters);
54 # define ARILES_PARENT(entry)
55 
56 template <class t_Visitor>
57 void arilesVisit(t_Visitor &visitor, const typename t_Visitor::Parameters &parameters)
58 {
59  ARILES_UNUSED_ARG(visitor);
60  ARILES_UNUSED_ARG(parameters);
62  arilesVisitParents(visitor, parameters);
64 }
65 
66 
67 template <class t_Visitor>
68 void arilesVisit(t_Visitor &visitor, const typename t_Visitor::Parameters &parameters) const
69 {
70  ARILES_UNUSED_ARG(visitor);
71  ARILES_UNUSED_ARG(parameters);
73  arilesVisitParents(visitor, parameters);
75 }
76 
77 # undef ARILES_PARENT
78 # undef ARILES_NAMED_ENTRY
79 
80 
81 
82 # define ARILES_NAMED_ENTRY(entry, name) visitor(entry, other.entry, name, parameters);
83 # define ARILES_PARENT(entry) entry::arilesVisit(visitor, other, parameters);
84 
85 template <class t_Visitor, class t_Other>
86 void arilesVisit(t_Visitor &visitor, const t_Other &other, const typename t_Visitor::Parameters &parameters) const
87 {
88  ARILES_UNUSED_ARG(visitor);
89  ARILES_UNUSED_ARG(other);
90  ARILES_UNUSED_ARG(parameters);
93 }
94 
95 # undef ARILES_PARENT
96 # undef ARILES_NAMED_ENTRY
97 
98 
99 # undef ARILES_TYPED_NAMED_ENTRY
100 # endif
101 # endif
102 
103 
104 public:
105 // Define node name
106 # ifdef ARILES_DEFAULT_ID
107 const std::string &arilesDefaultID() const
108 {
109  static const std::string name(ARILES_DEFAULT_ID);
110  return (name);
111 }
112 # else
113 # if 2 == ARILES_API_VERSION
114 const std::string &arilesDefaultID() const
115 {
116  static const std::string name("");
117  return (name);
118 }
119 # endif
120 # endif
121 
122 
123 # ifndef ARILES_VISITORS
124 # define ARILES_VISITORS ARILES_DEFAULT_VISITORS
125 # endif
126 
127 # define ARILES_VISITOR(visitor) ARILES_METHODS_##visitor
128 
129 ARILES_VISITORS
130 
131 # undef ARILES_VISITOR
132 # undef ARILES_VISITORS
133 
134 
135 #endif // ARILES_ENABLED
136 
137 #undef ARILES_DEFAULT_ID
#define ARILES_TRACE_FUNCTION
Definition: trace.h:118
#define ARILES_ENTRIES