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 113 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 108 of file ConfigurationImpl.cpp.

111 :
112 p_name (name),
113 p_type (type),
115 (can_be_null && !is_multi_value) ? zero_or_one :
116 (can_be_null && is_multi_value ) ? zero_or_many :
117 (!can_be_null && is_multi_value ) ? one_or_many :
119 ),
120 p_is_aggregation (is_aggregation),
121 p_description (description)
122 { ; }

◆ relationship_t() [2/2]

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

Default constructor for Python binding

Definition at line 135 of file Schema.hpp.

135{ ; }

Member Function Documentation

◆ card2str()

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

Return string corresponding to given cardinality

Definition at line 124 of file ConfigurationImpl.cpp.

125 {
126 switch(cardinality) {
127 case zero_or_one: return "zero or one";
128 case zero_or_many: return "zero or many";
129 case only_one: return "one";
130 case one_or_many: return "one or many";
131 default: return "unknown";
132 }
133 }

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

136 {
137 out
138 << prefix << "relationship \'" << p_name << "\'\n"
139 << prefix << " class type: \'" << p_type << "\'\n"
140 << prefix << " cardinality: \'" << card2str(p_cardinality) << "\'\n"
141 << prefix << " is aggregation: \'" << bool2str(p_is_aggregation) << "\'\n"
142 << prefix << " description: \'" << p_description << '\'';
143 }
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 117 of file Schema.hpp.

◆ p_description

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

the description text of relationship

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

◆ p_name

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

the relationship name

Definition at line 115 of file Schema.hpp.

◆ p_type

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

the relationship class type

Definition at line 116 of file Schema.hpp.


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