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

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

236{
237 if ( not confaccessor::enabled() )
238 {
239 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
240 }
241
242 try
243 {
244 Object.set_date ( AttributeData.p_name, NewValueData );
245
246 if ( !NotEmit )
247 {
248 confaccessor::ref().force_emit_object_changed ( "", Object );
249 }
250
251 }
252 catch ( dunedaq::conffwk::Exception const & error )
253 {
254 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
255 }
256}
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 179 of file config_api.hpp.

182{
183 if ( not confaccessor::enabled() )
184 {
185 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
186 }
187
188 try
189 {
190 Object.set_enum ( AttributeData.p_name, NewValueData );
191
192 if ( !NotEmit )
193 {
194 confaccessor::ref().force_emit_object_changed ( "", Object );
195 }
196 }
197 catch ( dunedaq::conffwk::Exception const & error )
198 {
199 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
200 }
201}
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 261 of file config_api.hpp.

264{
265 if ( not confaccessor::enabled() )
266 {
267 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
268 }
269
270 try
271 {
272 Object.set_time ( AttributeData.p_name, NewValueData );
273
274 if ( !NotEmit )
275 {
276 confaccessor::ref().force_emit_object_changed ( "", Object );
277 }
278 }
279 catch ( dunedaq::conffwk::Exception const & error )
280 {
281 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
282 }
283}
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 151 of file config_api.hpp.

155{
156 if ( not confaccessor::enabled() )
157 {
158 throw daq::dbe::ChangeNotAllowed ( ERS_HERE );
159 }
160
161 try
162 {
163 Object.set_by_ref ( AttributeData.p_name, NewValueData );
164
165 if ( !NotEmit )
166 {
167 confaccessor::ref().force_emit_object_changed ( "", Object );
168 }
169 }
170 catch ( dunedaq::conffwk::Exception const & error )
171 {
172 throw daq::dbe::ObjectChangeWasNotSuccessful ( ERS_HERE, error );
173 }
174}
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 39 of file config_api_set.cpp.

41{
42 std::vector<dbe::inner::configobject::tref> trefs;
43
44 for ( dbe::cokey const & key : keys )
45 {
46 trefs.push_back ( dbe::inner::dbcontroller::get ( key ) );
47 }
48
49 dbe::config::api::set::noactions::relation ( object, arelation, trefs );
50}
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)

◆ 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.

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