Ariles
Loading...
Searching...
No Matches
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
10
11#ifdef ARILES2_ENABLED
12# define ARILES2_TYPED_NAMED_ENTRY(v, type, entry, name) ARILES2_NAMED_ENTRY(v, entry, name)
13
14public:
15// -----
16// generic (templated) visitors
17# ifndef ARILES_DOXYGEN_PROCESSING
18# ifdef ARILES2_ENTRIES
19# include "visit_generic_parent.h"
20
21// clang-format off
23// clang-format on
24
25# endif
26# endif
27// -----
28
29
30// -----
31// Define node name
32# ifndef ARILES2_DEFAULT_ID
33# define ARILES2_DEFAULT_ID ""
34# endif
35
36 const std::string &
37 arilesDefaultID() const override
38{
39 static_assert(
40 std::is_base_of_v<ariles2::Ariles, typename std::decay<decltype(*this)>::type>,
41 "Class where ARILES2_INITIALIZE is included must inherit from an ariles class.");
42 static const std::string name(ARILES2_DEFAULT_ID);
43 return (name);
44}
45// -----
46
47
48// -----
49// visitor-specific methods
50# ifndef ARILES2_VISITORS
51# define ARILES2_VISITORS ARILES2_DEFAULT_VISITORS
52# endif
53
54# define ARILES2_VISITOR(visitor) ARILES2_METHODS_##visitor
55ARILES2_VISITORS
56# undef ARILES2_VISITOR
57
58# ifdef ARILES2_ENTRIES
59# define ARILES2_VISITOR(visitor) ARILES2_VISIT_##visitor
60ARILES2_VISITORS
61# undef ARILES2_VISITOR
62# endif
63
64# undef ARILES2_VISITORS
65// -----
66
67
68# undef ARILES2_TYPED_NAMED_ENTRY
69#endif // ARILES2_ENABLED
70
71#undef ARILES2_DEFAULT_ID
#define ARILES2_DEFAULT_ID
#define ARILES2_VISIT_generic_parent