Ariles
ariles.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-2020 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 #ifndef ARILES2_DISABLE
17 # define ARILES2_ENABLED
18 #endif
19 
20 
21 #include "internal/helpers.h"
22 
23 #include "visitors/process.h"
24 #include "visitors/defaults.h"
25 #include "visitors/prewrite.h"
26 #include "visitors/finalize.h"
27 #include "visitors/count.h"
28 #include "visitors/count_missing.h"
29 #include "visitors/read.h"
30 #include "visitors/write.h"
31 #include "visitors/config.h"
32 
33 // These defines are always necessary
34 #define ARILES2_TYPED_ENTRY_(v, entry, type) ARILES2_TYPED_NAMED_ENTRY(v, type, entry##_, entry)
35 #define ARILES2_TYPED_ENTRY(v, entry, type) ARILES2_TYPED_NAMED_ENTRY(v, type, entry, entry)
36 
37 
38 #ifdef ARILES2_ENABLED
39 # define ARILES2_INITIALIZE <ariles2/members/all.h>
40 
41 # define ARILES2_PARENT(v, entry) ARILES2_PARENT_##v(v, entry)
42 # define ARILES2_NAMED_ENTRY(v, entry, name) ARILES2_NAMED_ENTRY_##v(v, entry, name)
43 
44 # define ARILES2_ENTRY_(v, entry) ARILES2_NAMED_ENTRY(v, entry##_, entry)
45 # define ARILES2_ENTRY(v, entry) ARILES2_NAMED_ENTRY(v, entry, entry)
46 
47 // ----------------------------
48 
49 # include "adapters/basic.h"
50 
51 # ifndef ARILES2_DEFAULT_VISITORS
52 # define ARILES2_DEFAULT_VISITORS \
53  ARILES2_VISITOR(count) \
54  ARILES2_VISITOR(count_missing) \
55  ARILES2_VISITOR(finalize) \
56  ARILES2_VISITOR(prewrite) \
57  ARILES2_VISITOR(defaults) \
58  ARILES2_VISITOR(read) \
59  ARILES2_VISITOR(write)
60 # endif
61 
62 namespace ariles2
63 {
65 # define ARILES2_VISITOR(visitor) , public ariles2::visitor::Base
67 # undef ARILES2_VISITOR
68  {
69  protected:
71  {
72  }
74  {
75  }
76 
77  public:
78 # define ARILES2_VISITOR(visitor) ARILES2_BASE_METHODS_##visitor
80 # undef ARILES2_VISITOR
81  };
82 } // namespace ariles2
83 
84 #else
85 
86 # define ARILES2_DISABLED
87 # define ARILES2_INITIALIZE <ariles2/members/variables.h>
88 
89 namespace ariles2
90 {
91  // Some classes may inherit from this
92  class DefaultBase
93  {
94  protected:
95  /**
96  * @brief Protected destructor: prevent destruction of derived
97  * classes via base pointer.
98  */
99  ~DefaultBase()
100  {
101  }
102  DefaultBase()
103  {
104  }
105 
106  public:
107  };
108 } // namespace ariles2
109 
110 #endif
#define ARILES2_DEFAULT_VISITORS
Definition: ariles.h:52
Definition: basic.h:17