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

#include <Schema.hpp>

Public Member Functions

 attribute_t (const std::string &name, type_t type, const std::string &range, int_format_t int_format, bool is_not_null, bool is_multi_value, const std::string &default_value, const std::string &description)
 attribute_t ()
void print (std::ostream &out, const std::string &prefix="") const

Static Public Member Functions

static const char * type2str (type_t type)
static const char * type (type_t type)
static const char * format2str (int_format_t format)

Public Attributes

std::string p_name
type_t p_type
std::string p_range
int_format_t p_int_format
bool p_is_not_null
bool p_is_multi_value
std::string p_default_value
std::string p_description

Detailed Description

The description of attribute.

Definition at line 59 of file Schema.hpp.

Constructor & Destructor Documentation

◆ attribute_t() [1/2]

dunedaq::conffwk::attribute_t::attribute_t ( const std::string & name,
type_t type,
const std::string & range,
int_format_t int_format,
bool is_not_null,
bool is_multi_value,
const std::string & default_value,
const std::string & description )

Create attribute description

Definition at line 19 of file ConfigurationImpl.cpp.

23 :
24 p_name (name),
25 p_type (type),
26 p_range (range),
27 p_int_format (int_format),
28 p_is_not_null (is_not_null),
29 p_is_multi_value (is_multi_value),
30 p_default_value (default_value),
31 p_description (description)
32 { ; }
DAC value out of range
Message.
Definition DACNode.hpp:32
static const char * type(type_t type)

◆ attribute_t() [2/2]

dunedaq::conffwk::attribute_t::attribute_t ( )
inline

Default constructor for Python binding

Definition at line 86 of file Schema.hpp.

86{ ; }

Member Function Documentation

◆ format2str()

const char * dunedaq::conffwk::attribute_t::format2str ( int_format_t format)
static

Return string corresponding to given integer value representation format

Parameters
formatthe integer value representation format

Definition at line 80 of file ConfigurationImpl.cpp.

81 {
82 switch(type) {
83 case oct_int_format: return "octal";
84 case dec_int_format: return "decimal";
85 case hex_int_format: return "hexadecimal";
86 default: return "not applicable";
87 }
88 }

◆ print()

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

Print description of attribute to stream.

Parameters
outthe output stream
prefixoptional shift output using prefix

Definition at line 90 of file ConfigurationImpl.cpp.

91 {
92 out
93 << prefix << "attribute \'" << p_name << "\'\n"
94 << prefix << " type: \'" << type2str(p_type) << "\'\n"
95 << prefix << " range: \'" << p_range << "\'\n";
96
98 out << prefix << " integer format: \'" << format2str(p_int_format) << "\'\n";
99 }
100
101 out
102 << prefix << " is not null: " << bool2str(p_is_not_null) << '\n'
103 << prefix << " is multi-value: " << bool2str(p_is_multi_value) << '\n'
104 << prefix << " default value: \'" << p_default_value << "\'\n"
105 << prefix << " description: \'" << p_description << '\'';
106 }
const char * bool2str(bool value)
FELIX Initialization std::string initerror FELIX queue timed out
static const char * type2str(type_t type)
static const char * format2str(int_format_t format)

◆ type()

const char * dunedaq::conffwk::attribute_t::type ( type_t type)
static

Return short string (oks data type) corresponding to given data type

Parameters
typethe data type

Definition at line 57 of file ConfigurationImpl.cpp.

58 {
59 switch(type) {
60 case bool_type: return "bool";
61 case s8_type: return "s8";
62 case u8_type: return "u8";
63 case s16_type: return "s16";
64 case u16_type: return "u16";
65 case s32_type: return "s32";
66 case u32_type: return "u32";
67 case s64_type: return "s64";
68 case u64_type: return "u64";
69 case float_type: return "float";
70 case double_type: return "double";
71 case date_type: return "date";
72 case time_type: return "time";
73 case string_type: return "string";
74 case enum_type: return "enum";
75 case class_type: return "class";
76 default: return "unknown";
77 }
78 }

◆ type2str()

const char * dunedaq::conffwk::attribute_t::type2str ( type_t type)
static

Return string corresponding to given data type

Parameters
typethe data type

Definition at line 34 of file ConfigurationImpl.cpp.

35 {
36 switch(type) {
37 case bool_type: return "boolean";
38 case s8_type: return "8-bits signed integer";
39 case u8_type: return "8-bits unsigned integer";
40 case s16_type: return "16-bits signed integer";
41 case u16_type: return "16-bits unsigned integer";
42 case s32_type: return "32-bits signed integer";
43 case u32_type: return "32-bits unsigned integer";
44 case s64_type: return "64-bits signed integer";
45 case u64_type: return "64-bits unsigned integer";
46 case float_type: return "float";
47 case double_type: return "double";
48 case date_type: return "date";
49 case time_type: return "time";
50 case string_type: return "string";
51 case enum_type: return "enumeration";
52 case class_type: return "class reference";
53 default: return "unknown";
54 }
55 }

Member Data Documentation

◆ p_default_value

std::string dunedaq::conffwk::attribute_t::p_default_value

the default value of attribute

Definition at line 67 of file Schema.hpp.

◆ p_description

std::string dunedaq::conffwk::attribute_t::p_description

the description text of attribute

Definition at line 68 of file Schema.hpp.

◆ p_int_format

int_format_t dunedaq::conffwk::attribute_t::p_int_format

the representation format for integer values

Definition at line 64 of file Schema.hpp.

◆ p_is_multi_value

bool dunedaq::conffwk::attribute_t::p_is_multi_value

if true, the value of attribute is a list of primitive values (e.g. list of strings, list of integer numbers, etc.)

Definition at line 66 of file Schema.hpp.

◆ p_is_not_null

bool dunedaq::conffwk::attribute_t::p_is_not_null

if true, the value of attribute cannot be null

Definition at line 65 of file Schema.hpp.

◆ p_name

std::string dunedaq::conffwk::attribute_t::p_name

the attribute name

Definition at line 61 of file Schema.hpp.

◆ p_range

std::string dunedaq::conffwk::attribute_t::p_range

the attribute range in UML syntax (e.g.: "A,B,C..D,*..F,G..*" => value can be A, B, greater or equal to C and less or equal to D, less or equal to F, greater or equal to G)

Definition at line 63 of file Schema.hpp.

◆ p_type

type_t dunedaq::conffwk::attribute_t::p_type

the attribute type

Definition at line 62 of file Schema.hpp.


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