DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbe::config::api::set::noactions Namespace Reference

Functions

template<typename T>
void attribute (inner::configobject::tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T NewValueData, bool NotEmit=false)
template<typename T>
void aclass (inner::configobject::tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T NewValueData, bool NotEmit=false)
template<typename T>
void anenum (inner::configobject::tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T NewValueData, bool NotEmit=false)
template<typename T>
void adate (inner::configobject::tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T NewValueData, bool NotEmit=false)
template<typename T>
void atime (inner::configobject::tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T NewValueData, bool NotEmit=false)
void relation (dbe::inner::configobject::tref src, dunedaq::conffwk::relationship_t const &edge, std::vector< dbe::inner::configobject::tref > const &targets)
void relation (dbe::inner::configobject::tref object, dunedaq::conffwk::relationship_t const &arelation, std::vector< dbe::cokey > const &keys)
void relation (tref src, dunedaq::conffwk::relationship_t const &edge, std::vector< tref > const &targets)

Function Documentation

◆ aclass()

template<typename T>
void dbe::config::api::set::noactions::aclass ( inner::configobject::tref Object,
dunedaq::conffwk::attribute_t const & AttributeData,
T NewValueData,
bool NotEmit = false )

Definition at line 171 of file config_api.hpp.

172{
173 if (not confaccessor::enabled()) {
174 throw daq::dbe::ChangeNotAllowed(ERS_HERE);
175 }
176
177 try {
178 Object.set_class(AttributeData.p_name, NewValueData);
179
180 if (!NotEmit) {
182 }
183 } catch (dunedaq::conffwk::Exception const& error) {
184 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, error);
185 }
186}
#define ERS_HERE
static bool enabled()
void force_emit_object_changed(QString const &, dref const)
static confaccessor & ref()
void set_class(std::string const &name, std::string const &val)
Factory couldn t std::string alg_name Invalid configuration error
Definition Issues.hpp:34

◆ adate()

template<typename T>
void dbe::config::api::set::noactions::adate ( inner::configobject::tref Object,
dunedaq::conffwk::attribute_t const & AttributeData,
T NewValueData,
bool NotEmit = false )

Definition at line 192 of file config_api.hpp.

193{
194 if (not confaccessor::enabled()) {
195 throw daq::dbe::ChangeNotAllowed(ERS_HERE);
196 }
197
198 try {
199 Object.set_date(AttributeData.p_name, NewValueData);
200
201 if (!NotEmit) {
203 }
204
205 } catch (dunedaq::conffwk::Exception const& error) {
206 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, error);
207 }
208}
void set_date(std::string const &name, std::string const &val)

◆ anenum()

template<typename T>
void dbe::config::api::set::noactions::anenum ( inner::configobject::tref Object,
dunedaq::conffwk::attribute_t const & AttributeData,
T NewValueData,
bool NotEmit = false )

Definition at line 150 of file config_api.hpp.

151{
152 if (not confaccessor::enabled()) {
153 throw daq::dbe::ChangeNotAllowed(ERS_HERE);
154 }
155
156 try {
157 Object.set_enum(AttributeData.p_name, NewValueData);
158
159 if (!NotEmit) {
161 }
162 } catch (dunedaq::conffwk::Exception const& error) {
163 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, error);
164 }
165}
void set_enum(std::string const &name, std::string const &val)

◆ atime()

template<typename T>
void dbe::config::api::set::noactions::atime ( inner::configobject::tref Object,
dunedaq::conffwk::attribute_t const & AttributeData,
T NewValueData,
bool NotEmit = false )

Definition at line 214 of file config_api.hpp.

215{
216 if (not confaccessor::enabled()) {
217 throw daq::dbe::ChangeNotAllowed(ERS_HERE);
218 }
219
220 try {
221 Object.set_time(AttributeData.p_name, NewValueData);
222
223 if (!NotEmit) {
225 }
226 } catch (dunedaq::conffwk::Exception const& error) {
227 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, error);
228 }
229}
void set_time(std::string const &name, std::string const &val)

◆ attribute()

template<typename T>
void dbe::config::api::set::noactions::attribute ( inner::configobject::tref Object,
dunedaq::conffwk::attribute_t const & AttributeData,
T NewValueData,
bool NotEmit = false )

Change the value of an attribute and set it appropriately to new values

Parameters
objectrefis the reference to the object to be modified
attribute_infoa single or multi-value attribute, with name, and class information
attribute_valuesis a list (can have only one) of values

Definition at line 129 of file config_api.hpp.

130{
131 if (not confaccessor::enabled()) {
132 throw daq::dbe::ChangeNotAllowed(ERS_HERE);
133 }
134
135 try {
136 Object.set_by_ref(AttributeData.p_name, NewValueData);
137
138 if (!NotEmit) {
140 }
141 } catch (dunedaq::conffwk::Exception const& error) {
142 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, error);
143 }
144}
void set_by_ref(std::string const &name, U &val)

◆ relation() [1/3]

void dbe::config::api::set::noactions::relation ( dbe::inner::configobject::tref object,
dunedaq::conffwk::relationship_t const & arelation,
std::vector< dbe::cokey > const & keys )

Link an object with one or many other objects

object->objects

objects linked must be of the relation class type

Parameters
objectfrom which an outgoing link is set
relation_infothe associate relation type information
object_namesthe name of the objects to be linked

Definition at line 40 of file config_api_set.cpp.

41{
42 std::vector<dbe::inner::configobject::tref> trefs;
43
44 for (dbe::cokey const& key : keys) {
45 trefs.push_back(dbe::inner::dbcontroller::get(key));
46 }
47
48 dbe::config::api::set::noactions::relation(object, arelation, trefs);
49}
static configobject::tref get(dbe::cokey const &desc)
void relation(dbe::inner::configobject::tref src, dunedaq::conffwk::relationship_t const &edge, std::vector< dbe::inner::configobject::tref > const &targets)
config_object_key cokey

◆ relation() [2/3]

void dbe::config::api::set::noactions::relation ( dbe::inner::configobject::tref src,
dunedaq::conffwk::relationship_t const & edge,
std::vector< dbe::inner::configobject::tref > const & targets )

Link an object with one or many other objects directly by acting on the reference

object->objects

objects linked must be of the relation class type

Parameters
anobject from which an outgoing link is set
relationinformation for the edge
alist of objects to link to

◆ relation() [3/3]

void dbe::config::api::set::noactions::relation ( tref src,
dunedaq::conffwk::relationship_t const & edge,
std::vector< tref > const & targets )

Definition at line 52 of file config_api_set.cpp.

53{
54 try {
55 if (not targets.empty()) {
56 if (info::relation::is_simple(edge)) {
57 src.set_obj(edge.p_name, targets.back());
58 } else {
59 src.set_objs(edge.p_name, targets);
60 }
61 } else {
62 src.set_obj_null(edge.p_name, info::relation::is_simple(edge));
63 }
64 } catch (dunedaq::conffwk::Exception const& e) {
65 throw daq::dbe::ObjectChangeWasNotSuccessful(ERS_HERE, config::errors::parse(e));
66 }
67}
void set_objs(std::string const &name, std::vector< T > const &others, bool skip_non_null_check=false)
void set_obj_null(std::string const &name, bool is_simple, bool skip_non_null_check=false)
void set_obj(std::string const &name, T const &other, bool skip_non_null_check=false)
bool is_simple(dunedaq::conffwk::relationship_t const &)
std::string const parse(ers::Issue const &)