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 211 of file config_api.hpp.

214{
215 if ( not confaccessor::enabled() )
216 {
217 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
218 }
219
220 try
221 {
222 Object.set_class ( AttributeData.p_name, NewValueData );
223
224 if ( !NotEmit )
225 {
227 }
228 }
229 catch ( dunedaq::conffwk::Exception const & error )
230 {
231 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
232 }
233}
#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 238 of file config_api.hpp.

241{
242 if ( not confaccessor::enabled() )
243 {
244 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
245 }
246
247 try
248 {
249 Object.set_date ( AttributeData.p_name, NewValueData );
250
251 if ( !NotEmit )
252 {
254 }
255
256 }
257 catch ( dunedaq::conffwk::Exception const & error )
258 {
259 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
260 }
261}
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 184 of file config_api.hpp.

187{
188 if ( not confaccessor::enabled() )
189 {
190 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
191 }
192
193 try
194 {
195 Object.set_enum ( AttributeData.p_name, NewValueData );
196
197 if ( !NotEmit )
198 {
200 }
201 }
202 catch ( dunedaq::conffwk::Exception const & error )
203 {
204 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
205 }
206}
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 266 of file config_api.hpp.

269{
270 if ( not confaccessor::enabled() )
271 {
272 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
273 }
274
275 try
276 {
277 Object.set_time ( AttributeData.p_name, NewValueData );
278
279 if ( !NotEmit )
280 {
282 }
283 }
284 catch ( dunedaq::conffwk::Exception const & error )
285 {
286 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
287 }
288}
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 156 of file config_api.hpp.

160{
161 if ( not confaccessor::enabled() )
162 {
163 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
164 }
165
166 try
167 {
168 Object.set_by_ref ( AttributeData.p_name, NewValueData );
169
170 if ( !NotEmit )
171 {
173 }
174 }
175 catch ( dunedaq::conffwk::Exception const & error )
176 {
177 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
178 }
179}
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 44 of file config_api_set.cpp.

46{
47 std::vector<dbe::inner::configobject::tref> trefs;
48
49 for ( dbe::cokey const & key : keys )
50 {
51 trefs.push_back ( dbe::inner::dbcontroller::get ( key ) );
52 }
53
54 dbe::config::api::set::noactions::relation ( object, arelation, trefs );
55}
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 57 of file config_api_set.cpp.

59{
60 try
61 {
62 if ( not targets.empty() )
63 {
64 if ( info::relation::is_simple ( edge ) )
65 {
66 src.set_obj ( edge.p_name, targets.back() );
67 }
68 else
69 {
70 src.set_objs ( edge.p_name, targets );
71 }
72 }
73 else
74 {
75 src.set_obj_null( edge.p_name, info::relation::is_simple(edge) );
76 }
77 }
78 catch ( dunedaq::conffwk::Exception const & e )
79 {
80 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, config::errors::parse ( e ) );
81 }
82}
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 &)