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 116 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 164 of file ConfigurationImpl.cpp.

170 : p_name(name)
171 , p_type(type)
172 , p_cardinality((can_be_null && !is_multi_value) ? zero_or_one
173 : (can_be_null && is_multi_value) ? zero_or_many
174 : (!can_be_null && is_multi_value) ? one_or_many
175 : only_one)
176 , p_is_aggregation(is_aggregation)
177 , p_description(description)
178{
179 ;
180}

◆ relationship_t() [2/2]

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

Default constructor for Python binding

Definition at line 137 of file Schema.hpp.

137{ ; }

Member Function Documentation

◆ card2str()

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

Return string corresponding to given cardinality

Definition at line 183 of file ConfigurationImpl.cpp.

184{
185 switch (cardinality) {
186 case zero_or_one:
187 return "zero or one";
188 case zero_or_many:
189 return "zero or many";
190 case only_one:
191 return "one";
192 case one_or_many:
193 return "one or many";
194 default:
195 return "unknown";
196 }
197}

◆ 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 200 of file ConfigurationImpl.cpp.

201{
202 out << prefix << "relationship \'" << p_name << "\'\n"
203 << prefix << " class type: \'" << p_type << "\'\n"
204 << prefix << " cardinality: \'" << card2str(p_cardinality) << "\'\n"
205 << prefix << " is aggregation: \'" << bool2str(p_is_aggregation) << "\'\n"
206 << prefix << " description: \'" << p_description << '\'';
207}
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 121 of file Schema.hpp.

◆ p_description

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

the description text of relationship

Definition at line 124 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 122 of file Schema.hpp.

◆ p_name

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

the relationship name

Definition at line 119 of file Schema.hpp.

◆ p_type

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

the relationship class type

Definition at line 120 of file Schema.hpp.


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