DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
relationship.hpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS oks source for the DUNE DAQ project.
3// Fork baseline commit: oks-08-03-04 (2022-04-14).
4// Renamed since fork: yes (from oks/relationship.h to include/oks/relationship.hpp).
5
14
15#ifndef OKS_RELATIONSHIP_H
16#define OKS_RELATIONSHIP_H
17
18#include "oks/defs.hpp"
19
20#include <string>
21
22namespace dunedaq {
23namespace oks {
24
25class OksClass;
28
30
31
97
99{
100 friend class OksKernel;
101 friend class OksClass;
102 friend struct OksData;
103 friend class OksObject;
104
105
106 public:
107
111
115
116
117
129
130 OksRelationship (const std::string& name, OksClass * p = nullptr);
131
132
151
152 OksRelationship (const std::string& name,
153 const std::string& type,
155 CardinalityConstraint high_cc,
156 bool composite,
157 bool exclusive,
158 bool dependent,
159 const std::string& description,
160 OksClass * p = nullptr);
161
162
163 bool operator==(const class OksRelationship &) const;
164
165 friend std::ostream& operator<<(std::ostream&, const OksRelationship&);
166
167
171
172 const std::string& get_name() const noexcept {return p_name;}
173
174
184
185 void set_name(const std::string&);
186
187
189
190 OksClass * get_class_type() const noexcept {return p_class_type;}
191
192
194
195 const std::string& get_type() const noexcept {return p_rclass;}
196
197
209
210 void set_type(const std::string& type);
211
212
214
215 const std::string& get_description() const noexcept {return p_description;}
216
224
225
226 void set_description(const std::string& description);
227
228
236
238
239
251
253
254
262
264
265
277
279
280
282
283 bool get_is_composite() const noexcept {return p_composite;}
284
285
309
310 void set_is_composite(bool composite);
311
312
314
315 bool get_is_exclusive() const noexcept {return p_exclusive;}
316
317
328
329 void set_is_exclusive(bool exclusive);
330
331
333
334 bool get_is_dependent() const noexcept {return p_dependent;}
335
336
348
349 void set_is_dependent(bool dependent);
350
351
353
354 static CardinalityConstraint str2card(const char *) noexcept;
355
356
358
359 static const char * card2str(CardinalityConstraint) noexcept;
360
361
362 private:
363
364 std::string p_name;
365 std::string p_rclass;
371 std::string p_description;
375
376
380
382 void save(OksXmlOutputStream&) const;
383
384
385
389
390 static const char relationship_xml_tag[];
391 static const char name_xml_attr[];
392 static const char description_xml_attr[];
393 static const char class_type_xml_attr[];
394 static const char low_cc_xml_attr[];
395 static const char high_cc_xml_attr[];
396 static const char is_composite_xml_attr[];
397 static const char is_exclusive_xml_attr[];
398 static const char is_dependent_xml_attr[];
399 static const char mv_implement_xml_attr[];
400 static const char ordered_xml_attr[];
401
402};
403
404} // namespace oks
405} // namespace dunedaq
406#endif
The OKS class.
Definition class.hpp:205
void set_type(const std::string &type)
Set relationship type.
static const char class_type_xml_attr[]
friend std::ostream & operator<<(std::ostream &, const OksRelationship &)
void set_is_exclusive(bool exclusive)
Set the composite relationship exclusive property.
bool get_is_exclusive() const noexcept
static const char ordered_xml_attr[]
static const char low_cc_xml_attr[]
static const char relationship_xml_tag[]
private method to save in XML stream
static const char mv_implement_xml_attr[]
bool get_is_composite() const noexcept
CardinalityConstraint p_high_cc
bool get_is_dependent() const noexcept
const std::string & get_name() const noexcept
static const char description_xml_attr[]
static const char is_composite_xml_attr[]
void set_is_dependent(bool dependent)
Set the composite relationship dependent property.
void set_is_composite(bool composite)
Set the composite relationship property.
CardinalityConstraint get_high_cardinality_constraint() const noexcept
Get relationship high cardinality constraint.
void set_high_cardinality_constraint(CardinalityConstraint)
Set relationship high cardinality constraint.
OksRelationship(const std::string &name, OksClass *p=nullptr)
OKS relationship simple constructor.
static const char is_exclusive_xml_attr[]
void save(OksXmlOutputStream &) const
private constructor from XML stream
void set_low_cardinality_constraint(CardinalityConstraint cc)
Set relationship low cardinality constraint.
static const char name_xml_attr[]
static const char * card2str(CardinalityConstraint) noexcept
const std::string & get_description() const noexcept
CardinalityConstraint get_low_cardinality_constraint() const noexcept
Get relationship low cardinality constraint.
void set_description(const std::string &description)
Set relationship description.
const std::string & get_type() const noexcept
static const char high_cc_xml_attr[]
bool operator==(const class OksRelationship &) const
CardinalityConstraint p_low_cc
OksClass * get_class_type() const noexcept
void set_name(const std::string &)
Set relationship name.
static const char is_dependent_xml_attr[]
static CardinalityConstraint str2card(const char *) noexcept
Including Qt Headers.
Definition module.cpp:16