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

Namespaces

namespace  noactions

Functions

void attribute (dbe::inner::configobject::tref objectref, dunedaq::conffwk::attribute_t const &attribute_info, QStringList const &attribute_values)
void relation (dbe::inner::configobject::tref src, dunedaq::conffwk::relationship_t const &edge, QStringList const &targets)

Function Documentation

◆ attribute()

void dbe::config::api::set::attribute ( dbe::inner::configobject::tref objectref,
dunedaq::conffwk::attribute_t const & attribute_info,
QStringList const & attribute_values )

Change the value of an attribute and set it appropriately to new values by generating action commands, register this to the undo stack

Parameters
objectref
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 119 of file config_api_set.cpp.

121{
122 switch ( attribute_info.p_type )
123 {
125 {
126 if ( attribute_info.p_is_multi_value )
127 {
129 Object, attribute_info,
130 convert::to<std::vector<bool>> ( values, attribute_info.p_int_format ) );
131 }
132 else
133 {
134 commands::modobj ( Object, attribute_info,
135 convert::to<bool> ( values, attribute_info.p_int_format ) );
136 }
137
138 break;
139 }
140
146 {
147 if ( attribute_info.p_is_multi_value )
148 {
149 commands::modobj ( Object, attribute_info,
150 convert::to<std::vector<std::string>> ( values ) );
151 }
152 else
153 {
154 commands::modobj ( Object, attribute_info, convert::to<std::string> ( values ) );
155 }
156
157 break;
158 }
159
161 {
162 if ( attribute_info.p_is_multi_value )
163 {
165 Object, attribute_info,
166 convert::to<std::vector<float>> ( values, attribute_info.p_int_format ) );
167 }
168 else
169 {
170 commands::modobj ( Object, attribute_info,
171 convert::to<float> ( values, attribute_info.p_int_format ) );
172 }
173
174 break;
175 }
176
178 {
179 if ( attribute_info.p_is_multi_value )
180 {
182 Object, attribute_info,
183 convert::to<std::vector<double>> ( values, attribute_info.p_int_format ) );
184 }
185 else
186 {
187 commands::modobj ( Object, attribute_info,
188 convert::to<double> ( values, attribute_info.p_int_format ) );
189 }
190
191 break;
192 }
193
195 {
196 if ( attribute_info.p_is_multi_value )
197 {
199 Object, attribute_info,
200 convert::to<std::vector<int8_t>> ( values, attribute_info.p_int_format ) );
201 }
202 else
203 {
204 commands::modobj ( Object, attribute_info,
205 convert::to<int8_t> ( values, attribute_info.p_int_format ) );
206 }
207
208 break;
209 }
210
212 {
213 if ( attribute_info.p_is_multi_value )
214 {
216 Object, attribute_info,
217 convert::to<std::vector<int16_t>> ( values, attribute_info.p_int_format ) );
218 }
219 else
220 {
221 commands::modobj ( Object, attribute_info,
222 convert::to<int16_t> ( values, attribute_info.p_int_format ) );
223 }
224
225 break;
226 }
227
229 {
230 if ( attribute_info.p_is_multi_value )
231 {
233 Object, attribute_info,
234 convert::to<std::vector<int32_t>> ( values, attribute_info.p_int_format ) );
235 }
236 else
237 {
238 commands::modobj ( Object, attribute_info,
239 convert::to<int32_t> ( values, attribute_info.p_int_format ) );
240 }
241
242 break;
243 }
244
246 {
247 if ( attribute_info.p_is_multi_value )
248 {
250 Object, attribute_info,
251 convert::to<std::vector<int64_t>> ( values, attribute_info.p_int_format ) );
252 }
253 else
254 {
255 commands::modobj ( Object, attribute_info,
256 convert::to<int64_t> ( values, attribute_info.p_int_format ) );
257 }
258
259 break;
260 }
261
263 {
264 if ( attribute_info.p_is_multi_value )
265 {
267 Object, attribute_info,
268 convert::to<std::vector<u_int8_t>> ( values, attribute_info.p_int_format ) );
269 }
270 else
271 {
272 commands::modobj ( Object, attribute_info,
273 convert::to<u_int8_t> ( values, attribute_info.p_int_format ) );
274 }
275
276 break;
277 }
278
280 {
281 if ( attribute_info.p_is_multi_value )
282 {
284 Object, attribute_info,
285 convert::to<std::vector<u_int16_t>> ( values, attribute_info.p_int_format ) );
286 }
287 else
288 {
290 Object, attribute_info,
291 convert::to<u_int16_t> ( values, attribute_info.p_int_format ) );
292 }
293
294 break;
295 }
296
298 {
299 if ( attribute_info.p_is_multi_value )
300 {
302 Object, attribute_info,
303 convert::to<std::vector<u_int32_t>> ( values, attribute_info.p_int_format ) );
304 }
305 else
306 {
308 Object, attribute_info,
309 convert::to<u_int32_t> ( values, attribute_info.p_int_format ) );
310 }
311
312 break;
313 }
314
316 {
317 if ( attribute_info.p_is_multi_value ) commands::modobj (
318 Object, attribute_info,
319 convert::to<std::vector<u_int64_t>> ( values, attribute_info.p_int_format ) );
320 else commands::modobj (
321 Object, attribute_info,
322 convert::to<u_int64_t> ( values, attribute_info.p_int_format ) );
323
324 break;
325 }
326
327 default:
328 break;
329 }
330}
void modobj(tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T Value)
int8_t to< int8_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int64_t to< u_int64_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
int16_t to< int16_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int8_t to< u_int8_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
int64_t to< int64_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
T to(QStringList const &DataList)
std::string to< std::string >(QStringList const &DataList)
int32_t to< int32_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int32_t to< u_int32_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
double to< double >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int16_t to< u_int16_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
float to< float >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)

◆ relation()

void dbe::config::api::set::relation ( dbe::inner::configobject::tref src,
dunedaq::conffwk::relationship_t const & edge,
QStringList const & targets )

Link an object with one or many other objects by generating action commands, register this to the undo stack

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 104 of file config_api_set.cpp.

106{
107 std::vector<std::string> targetnames;
108
109 for ( QString const & name : targets )
110 {
111 targetnames.push_back ( name.toStdString() );
112 }
113
114 commands::modobj ( src, edge, targetnames );
115}