DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::conffwk::relationship_t Struct Reference

#include <Schema.hpp>

Public Member Functions

 relationship_t (const std::string &name, const std::string &type, bool can_be_null, bool is_multi_value, bool is_aggregation, const std::string &description)
 relationship_t ()
void print (std::ostream &out, const std::string &prefix="") const

Static Public Member Functions

static const char * card2str (cardinality_t cardinality)

Public Attributes

std::string p_name
std::string p_type
cardinality_t p_cardinality
bool p_is_aggregation
std::string p_description

Detailed Description

The description of relationship.

Definition at line 120 of file Schema.hpp.

Constructor & Destructor Documentation

◆ relationship_t() [1/2]

dunedaq::conffwk::relationship_t::relationship_t ( const std::string & name,
const std::string & type,
bool can_be_null,
bool is_multi_value,
bool is_aggregation,
const std::string & description )

Create relationship description

Definition at line 115 of file ConfigurationImpl.cpp.

118 :
119 p_name (name),
120 p_type (type),
122 (can_be_null && !is_multi_value) ? zero_or_one :
123 (can_be_null && is_multi_value ) ? zero_or_many :
124 (!can_be_null && is_multi_value ) ? one_or_many :
126 ),
127 p_is_aggregation (is_aggregation),
128 p_description (description)
129 { ; }

◆ relationship_t() [2/2]

dunedaq::conffwk::relationship_t::relationship_t ( )
inline

Default constructor for Python binding

Definition at line 142 of file Schema.hpp.

142{ ; }

Member Function Documentation

◆ card2str()

const char * dunedaq::conffwk::relationship_t::card2str ( cardinality_t cardinality)
static

Return string corresponding to given cardinality

Definition at line 131 of file ConfigurationImpl.cpp.

132 {
133 switch(cardinality) {
134 case zero_or_one: return "zero or one";
135 case zero_or_many: return "zero or many";
136 case only_one: return "one";
137 case one_or_many: return "one or many";
138 default: return "unknown";
139 }
140 }

◆ print()

void dunedaq::conffwk::relationship_t::print ( std::ostream & out,
const std::string & prefix = "" ) const

Print description of relationship to stream.

Parameters
outthe output stream
prefixoptional shift output using prefix

Definition at line 142 of file ConfigurationImpl.cpp.

143 {
144 out
145 << prefix << "relationship \'" << p_name << "\'\n"
146 << prefix << " class type: \'" << p_type << "\'\n"
147 << prefix << " cardinality: \'" << card2str(p_cardinality) << "\'\n"
148 << prefix << " is aggregation: \'" << bool2str(p_is_aggregation) << "\'\n"
149 << prefix << " description: \'" << p_description << '\'';
150 }
const char * bool2str(bool value)
FELIX Initialization std::string initerror FELIX queue timed out
static const char * card2str(cardinality_t cardinality)

Member Data Documentation

◆ p_cardinality

cardinality_t dunedaq::conffwk::relationship_t::p_cardinality

the relationship cardinality

Definition at line 124 of file Schema.hpp.

◆ p_description

std::string dunedaq::conffwk::relationship_t::p_description

the description text of relationship

Definition at line 126 of file Schema.hpp.

◆ p_is_aggregation

bool dunedaq::conffwk::relationship_t::p_is_aggregation

if true, the relationship is an aggregation (composite); otherwise the relationship is simple (weak)

Definition at line 125 of file Schema.hpp.

◆ p_name

std::string dunedaq::conffwk::relationship_t::p_name

the relationship name

Definition at line 122 of file Schema.hpp.

◆ p_type

std::string dunedaq::conffwk::relationship_t::p_type

the relationship class type

Definition at line 123 of file Schema.hpp.


The documentation for this struct was generated from the following files: