-
Notifications
You must be signed in to change notification settings - Fork 60
/
datalayout.yaml
274 lines (240 loc) · 8.69 KB
/
datalayout.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
---
schema_version : 2
options :
# should getters / setters be prefixed with get / set?
getSyntax: False
# should POD members be exposed with getters/setters in classes that have them as members?
exposePODMembers: True
includeSubfolder: True
components :
ToBeDroppedStruct:
Description: "A struct to be dropped during schema evolution"
Members:
- int x
SimpleStruct:
Members:
- int x [mm]
- int y [mm]
- int z [mm]
- std::array<int, 4> p [mm]
# can also add c'tors:
ExtraCode :
declaration: "
SimpleStruct() : x(0),y(0),z(0) {}\n
SimpleStruct( const int* v) : x(v[0]),y(v[1]),z(v[2]) {}
"
NotSoSimpleStruct:
Description : "A not so simple struct"
Author : "Someone"
Members:
- SimpleStruct data [GeV] // component members can have descriptions and units
ex2::NamespaceStruct:
Members:
- int x
- int y
ex2::NamespaceInNamespaceStruct:
Members:
- ex2::NamespaceStruct data
nsp::AnotherNamespaceStruct:
Members:
- int x
- int y
StructWithFixedWithTypes:
Members:
- uint16_t fixedUnsigned16 // unsigned int with exactly 16 bits
- std::int64_t fixedInteger64 // int with exactly 64 bits
- int32_t fixedInteger32 // int with exactly 32 bits
CompWithInit:
Members:
- int i{42} // is there even another value to initialize ints to?
- std::array<double, 10> arr {1.2, 3.4} // half initialized double array
StructWithExtraCode:
Members:
- int x
ExtraCode:
declaration: "
int negate() { x = -x; return x; }\n
"
declarationFile: "extra_code/component_declarations.cc"
datatypes :
EventInfo:
Description : "Event info"
Author : "B. Hegner"
Members :
- int Number // event number
MutableExtraCode :
declaration: "void setNumber(int n) { Number( n ) ; } "
ExtraCode:
declaration: "int getNumber() const;"
implementation: "int {name}::getNumber() const { return Number(); }"
ExampleHit :
Description : "Example Hit"
Author : "B. Hegner"
Members:
- unsigned long long cellID // cellID
- double x [mm] // x-coordinate
- double y [mm] // y-coordinate
- double z [mm] // z-coordinate
- double energy [GeV] // measured energy deposit
ExampleMC :
Description : "Example MC-particle"
Author: "F.Gaede"
Members:
- double energy // energy
- int PDG // PDG code
OneToManyRelations:
- ExampleMC parents // parents
- ExampleMC daughters // daughters
ExampleCluster :
Description : "Cluster"
Author : "B. Hegner"
Members:
- double energy // cluster energy
OneToManyRelations:
- ExampleHit Hits // hits contained in the cluster
- ExampleCluster Clusters // sub clusters used to create this cluster
ExampleReferencingType :
Description : "Referencing Type"
Author : "B. Hegner"
OneToManyRelations:
- ExampleCluster Clusters // some refs to Clusters
- ExampleReferencingType Refs // refs into same type
ExampleWithVectorMember :
Description : "Type with a vector member"
Author : "B. Hegner"
VectorMembers:
- int count // various ADC counts
ExampleWithOneRelation :
Description : "Type with one relation member"
Author : "Benedikt Hegner"
OneToOneRelations:
- ExampleCluster cluster // a particular cluster
ExampleWithArrayComponent:
Description: "A type that has a component with an array"
Author: "Thomas Madlener"
Members:
- SimpleStruct s // a component that has an array
ExampleWithComponent :
Description : "Type with one component"
Author : "Benedikt Hegner"
Members :
- NotSoSimpleStruct component // a component
ExampleForCyclicDependency1 :
Description : "Type for cyclic dependency"
Author : "Benedikt Hegner"
OneToOneRelations :
- ExampleForCyclicDependency2 ref // a ref
ExampleForCyclicDependency2 :
Description : "Type for cyclic dependency"
Author : "Benedikt Hegner"
OneToOneRelations :
- ExampleForCyclicDependency1 ref // a ref
# ExampleWithArray :
# Description : "Type with an array"
# Author : "Benedikt Hegner"
# Members:
# - std::array<int,33> array // the array
ex42::ExampleWithNamespace :
Description : "Type with namespace and namespaced member"
Author : "Joschka Lingemann"
Members:
- ex2::NamespaceStruct component // a component
ex42::ExampleWithARelation :
Description : "Type with namespace and namespaced relation"
Author : "Joschka Lingemann"
Members:
- float number // just a number
OneToOneRelations :
- ex42::ExampleWithNamespace ref // a ref in a namespace
OneToManyRelations :
- ex42::ExampleWithNamespace refs // multiple refs in a namespace
ExampleWithDifferentNamespaceRelations:
Description: "Datatype using a namespaced relation without being in the same namespace"
Author: "Thomas Madlener"
OneToOneRelations:
- ex42::ExampleWithNamespace rel // a relation in a different namespace
OneToManyRelations:
- ex42::ExampleWithNamespace rels // relations in a different namespace
ExampleWithArray:
Description: "Datatype with an array member"
Author: "Joschka Lingemann"
Members:
- NotSoSimpleStruct arrayStruct // component that contains an array
- std::array<int,4> myArray // array-member without space to test regex
- std::array<int, 4> anotherArray2 // array-member with space to test regex
- std::array<int, 4> snail_case_array // snail case to test regex
- std::array<int, 4> snail_case_Array3 // mixing things up for regex
- std::array<ex2::NamespaceStruct, 4> structArray // an array containing structs
ExampleWithFixedWidthIntegers:
Description: "Datatype using fixed width integer types as members"
Author: "Thomas Madlener"
Members:
- std::int16_t fixedI16 // some integer with exactly 16 bits
- uint64_t fixedU64 // unsigned int with exactly 64 bits
- uint32_t fixedU32 // unsigned int with exactly 32 bits
- StructWithFixedWithTypes fixedWidthStruct // struct with more fixed width types
- std::array<int16_t, 2> fixedWidthArray // 32 bits split into two times 16 bits
ExampleWithUserInit:
Description: "Datatype with user defined initialization values"
Author: "Thomas Madlener"
Members:
- std::int16_t i16Val{42} // some int16 value
- std::array<float, 2> floats {3.14f, 1.23f} // some float values
- ex2::NamespaceStruct s{10, 11} // one that we happen to know works
- double d{9.876e5} // double val
- CompWithInit comp // To make sure that the default initializer of the component does what it should
ExampleWithInterfaceRelation:
Description: "Datatype that uses an interface type as one of its relations"
Author: "Thomas Madlener"
OneToOneRelations:
- TypeWithEnergy aSingleEnergyType // single relation
- ex42::AnotherTypeWithEnergy energyRelation // another single relation
OneToManyRelations:
- TypeWithEnergy manyEnergies // multiple relations
- ex42::AnotherTypeWithEnergy moreEnergies // multiple namespace relations
ExampleWithExternalExtraCode:
Description: "Type showing usage of 'declaration', 'implementation', 'declarationFile' and 'implementationFile' directives'"
Author: "Mateusz Jakub Fila"
Members:
- int number // a number
ExtraCode:
declaration:
"int add(int i) const;"
declarationFile: "extra_code/declarations.cc"
implementation:
"int {name}::add(int i) const { return number() + i; }"
implementationFile: "extra_code/implementations.cc"
MutableExtraCode:
declaration:
int add_inplace(int i);
declarationFile: "extra_code/mutable_declarations.cc"
implementation:
int {name}::add_inplace(int i) { return number() += i; }
implementationFile: "extra_code/mutable_implementations.cc"
nsp::EnergyInNamespace:
Description: "A type with energy in a namespace"
Author: "Thomas Madlener"
Members:
- double energy // energy
ExtraCode:
declaration:
"int PDG() const { return 42; }"
interfaces:
TypeWithEnergy:
Description: "Generic interface for all types with an energy member"
Author: "Thomas Madlener"
Types:
- ExampleHit
- ExampleMC
- ExampleCluster
Members:
- double energy // the energy
ex42::AnotherTypeWithEnergy:
Description: "Another interface type for making sure they also work in namespaces"
Author: "Thomas Madlener"
Types:
- ExampleMC
- nsp::EnergyInNamespace
Members:
- double energy // the energy
- int PDG // a pdg