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

116{
117 switch ( attribute_info.p_type )
118 {
120 {
121 if ( attribute_info.p_is_multi_value )
122 {
123 commands::modobj (
124 Object, attribute_info,
125 convert::to<std::vector<bool>> ( values, attribute_info.p_int_format ) );
126 }
127 else
128 {
129 commands::modobj ( Object, attribute_info,
130 convert::to<bool> ( values, attribute_info.p_int_format ) );
131 }
132
133 break;
134 }
135
141 {
142 if ( attribute_info.p_is_multi_value )
143 {
144 commands::modobj ( Object, attribute_info,
145 convert::to<std::vector<std::string>> ( values ) );
146 }
147 else
148 {
149 commands::modobj ( Object, attribute_info, convert::to<std::string> ( values ) );
150 }
151
152 break;
153 }
154
156 {
157 if ( attribute_info.p_is_multi_value )
158 {
159 commands::modobj (
160 Object, attribute_info,
161 convert::to<std::vector<float>> ( values, attribute_info.p_int_format ) );
162 }
163 else
164 {
165 commands::modobj ( Object, attribute_info,
166 convert::to<float> ( values, attribute_info.p_int_format ) );
167 }
168
169 break;
170 }
171
173 {
174 if ( attribute_info.p_is_multi_value )
175 {
176 commands::modobj (
177 Object, attribute_info,
178 convert::to<std::vector<double>> ( values, attribute_info.p_int_format ) );
179 }
180 else
181 {
182 commands::modobj ( Object, attribute_info,
183 convert::to<double> ( values, attribute_info.p_int_format ) );
184 }
185
186 break;
187 }
188
190 {
191 if ( attribute_info.p_is_multi_value )
192 {
193 commands::modobj (
194 Object, attribute_info,
195 convert::to<std::vector<int8_t>> ( values, attribute_info.p_int_format ) );
196 }
197 else
198 {
199 commands::modobj ( Object, attribute_info,
200 convert::to<int8_t> ( values, attribute_info.p_int_format ) );
201 }
202
203 break;
204 }
205
207 {
208 if ( attribute_info.p_is_multi_value )
209 {
210 commands::modobj (
211 Object, attribute_info,
212 convert::to<std::vector<int16_t>> ( values, attribute_info.p_int_format ) );
213 }
214 else
215 {
216 commands::modobj ( Object, attribute_info,
217 convert::to<int16_t> ( values, attribute_info.p_int_format ) );
218 }
219
220 break;
221 }
222
224 {
225 if ( attribute_info.p_is_multi_value )
226 {
227 commands::modobj (
228 Object, attribute_info,
229 convert::to<std::vector<int32_t>> ( values, attribute_info.p_int_format ) );
230 }
231 else
232 {
233 commands::modobj ( Object, attribute_info,
234 convert::to<int32_t> ( values, attribute_info.p_int_format ) );
235 }
236
237 break;
238 }
239
241 {
242 if ( attribute_info.p_is_multi_value )
243 {
244 commands::modobj (
245 Object, attribute_info,
246 convert::to<std::vector<int64_t>> ( values, attribute_info.p_int_format ) );
247 }
248 else
249 {
250 commands::modobj ( Object, attribute_info,
251 convert::to<int64_t> ( values, attribute_info.p_int_format ) );
252 }
253
254 break;
255 }
256
258 {
259 if ( attribute_info.p_is_multi_value )
260 {
261 commands::modobj (
262 Object, attribute_info,
263 convert::to<std::vector<u_int8_t>> ( values, attribute_info.p_int_format ) );
264 }
265 else
266 {
267 commands::modobj ( Object, attribute_info,
268 convert::to<u_int8_t> ( values, attribute_info.p_int_format ) );
269 }
270
271 break;
272 }
273
275 {
276 if ( attribute_info.p_is_multi_value )
277 {
278 commands::modobj (
279 Object, attribute_info,
280 convert::to<std::vector<u_int16_t>> ( values, attribute_info.p_int_format ) );
281 }
282 else
283 {
284 commands::modobj (
285 Object, attribute_info,
286 convert::to<u_int16_t> ( values, attribute_info.p_int_format ) );
287 }
288
289 break;
290 }
291
293 {
294 if ( attribute_info.p_is_multi_value )
295 {
296 commands::modobj (
297 Object, attribute_info,
298 convert::to<std::vector<u_int32_t>> ( values, attribute_info.p_int_format ) );
299 }
300 else
301 {
302 commands::modobj (
303 Object, attribute_info,
304 convert::to<u_int32_t> ( values, attribute_info.p_int_format ) );
305 }
306
307 break;
308 }
309
311 {
312 if ( attribute_info.p_is_multi_value ) commands::modobj (
313 Object, attribute_info,
314 convert::to<std::vector<u_int64_t>> ( values, attribute_info.p_int_format ) );
315 else commands::modobj (
316 Object, attribute_info,
317 convert::to<u_int64_t> ( values, attribute_info.p_int_format ) );
318
319 break;
320 }
321
322 default:
323 break;
324 }
325}

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

101{
102 std::vector<std::string> targetnames;
103
104 for ( QString const & name : targets )
105 {
106 targetnames.push_back ( name.toStdString() );
107 }
108
109 commands::modobj ( src, edge, targetnames );
110}