GCC Code Coverage Report


Directory: ./
File: src/Representation/Representation.cpp
Date: 2026-05-19 15:42:59
Exec Total Coverage
Lines: 481 635 75.7%
Functions: 169 222 76.1%
Branches: 86 242 35.5%

Line Branch Exec Source
1 /***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5 ****************************************/
6
7
8 #include "Representation.h"
9
10 using namespace Swarm;
11
12 ///Get the name of the class Data for PhoenixTypeStream
13 /** @return name of the class Data for PhoenixTypeStream
14 */
15 template<>
16 1 std::string phoenix_getTypeName<Data >(){
17
1/1
✓ Branch 0 (4→5) taken 1 times.
2 return "Data";
18 }
19
20 ///Check Stream for a Data
21 /** @param fieldDescription : description of the field to be checked
22 * @param data : data to be checked
23 * @param reference : reference of the check
24 * @param out : ostream used to collect feed back in case of error (std::cerr or a logger)
25 * @return true on success, false otherwise
26 */
27 5 bool CheckStream<Swarm::Data>::check_stream(const std::string & fieldDescription, const Swarm::Data & data, const Swarm::Data & reference, std::ostream & out){
28 5 bool b(true);
29
4/4
✓ Branch 0 (2→3) taken 5 times.
✓ Branch 2 (3→4) taken 5 times.
✓ Branch 4 (4→5) taken 5 times.
✓ Branch 6 (5→6) taken 5 times.
5 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- Data::name", data.getName(), reference.getName(), out);
30
4/4
✓ Branch 0 (7→8) taken 5 times.
✓ Branch 2 (8→9) taken 5 times.
✓ Branch 4 (9→10) taken 5 times.
✓ Branch 6 (10→11) taken 5 times.
5 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- Data::description", data.getDescription(), reference.getDescription(), out);
31
4/4
✓ Branch 0 (12→13) taken 5 times.
✓ Branch 2 (13→14) taken 5 times.
✓ Branch 4 (14→15) taken 5 times.
✓ Branch 6 (15→16) taken 5 times.
5 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- Data::type", data.getType(), reference.getType(), out);
32
4/4
✓ Branch 0 (17→18) taken 5 times.
✓ Branch 2 (18→19) taken 5 times.
✓ Branch 4 (19→20) taken 5 times.
✓ Branch 6 (20→21) taken 5 times.
5 b &= CheckStream<DataStreamMsg>::check_stream(fieldDescription + "\n- Data::value", data.getValue(), reference.getValue(), out);
33 5 return b;
34 }
35
36
37 ///Constructor of class Data
38
2/2
✓ Branch 0 (3→4) taken 1190 times.
✓ Branch 2 (4→5) taken 1190 times.
1190 Data::Data(){
39
1/1
✓ Branch 0 (6→7) taken 1190 times.
1190 initialisationData();
40 1190 }
41
42 ///Destructor of class Data
43 1191 Data::~Data(){
44
45 1191 }
46
47 ///Copy Constructor of class Data
48 /** @param other : Data we want ot copy
49 */
50
2/2
✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
1 Data::Data(const Data & other){
51
1/1
✓ Branch 0 (6→7) taken 1 times.
1 copyData(other);
52 1 }
53
54 ///Operator = of class Data
55 /** @param other : Data we want ot copy
56 * @return copied class Data
57 */
58 37 Data & Data::operator = (const Data & other){
59 37 copyData(other);
60 37 return *this;
61 }
62
63 ///Sets the name of the Data
64 /** @param name : name of the Data
65 */
66 1 void Data::setName(const PString & name){
67 1 p_name = name;
68 1 }
69
70 ///Sets the description of the Data
71 /** @param description : description of the Data
72 */
73 1 void Data::setDescription(const PString & description){
74 1 p_description = description;
75 1 }
76
77 ///Sets the type of the Data
78 /** @param type : type of the Data
79 */
80 26 void Data::setType(const PString & type){
81 26 p_type = type;
82 26 }
83
84 ///Sets the value of the Data
85 /** @param value : value of the Data
86 */
87 void Data::setValue(const DataStreamMsg & value){
88 p_value = value;
89 }
90
91 ///Gets the name of the Data
92 /** @return name of the Data
93 */
94 14 const PString & Data::getName() const{
95 14 return p_name;
96 }
97
98 ///Gets the name of the Data
99 /** @return name of the Data
100 */
101 4 PString & Data::getName(){
102 4 return p_name;
103 }
104
105 ///Gets the description of the Data
106 /** @return description of the Data
107 */
108 14 const PString & Data::getDescription() const{
109 14 return p_description;
110 }
111
112 ///Gets the description of the Data
113 /** @return description of the Data
114 */
115 4 PString & Data::getDescription(){
116 4 return p_description;
117 }
118
119 ///Gets the type of the Data
120 /** @return type of the Data
121 */
122 57 const PString & Data::getType() const{
123 57 return p_type;
124 }
125
126 ///Gets the type of the Data
127 /** @return type of the Data
128 */
129 18 PString & Data::getType(){
130 18 return p_type;
131 }
132
133 ///Gets the value of the Data
134 /** @return value of the Data
135 */
136 29 const DataStreamMsg & Data::getValue() const{
137 29 return p_value;
138 }
139
140 ///Gets the value of the Data
141 /** @return value of the Data
142 */
143 48 DataStreamMsg & Data::getValue(){
144 48 return p_value;
145 }
146
147 ///Copy Function of class Data
148 /** @param other : Data we want ot copy
149 */
150 38 void Data::copyData(const Data & other){
151 38 p_name = other.p_name;
152 38 p_description = other.p_description;
153 38 p_type = other.p_type;
154 38 p_value = other.p_value;
155 38 }
156
157 ///Initialisation Function of class Data
158 1190 void Data::initialisationData(){
159 1190 p_name = "";
160 1190 p_description = "";
161 1190 p_type = "";
162 1190 }
163
164 ///Get the name of the class Function for PhoenixTypeStream
165 /** @return name of the class Function for PhoenixTypeStream
166 */
167 template<>
168 1 std::string phoenix_getTypeName<Function >(){
169
1/1
✓ Branch 0 (4→5) taken 1 times.
2 return "Function";
170 }
171
172 ///Check Stream for a Function
173 /** @param fieldDescription : description of the field to be checked
174 * @param data : data to be checked
175 * @param reference : reference of the check
176 * @param out : ostream used to collect feed back in case of error (std::cerr or a logger)
177 * @return true on success, false otherwise
178 */
179 bool CheckStream<Swarm::Function>::check_stream(const std::string & fieldDescription, const Swarm::Function & data, const Swarm::Function & reference, std::ostream & out){
180 bool b(true);
181 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- Function::name", data.getName(), reference.getName(), out);
182 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- Function::description", data.getDescription(), reference.getDescription(), out);
183 b &= CheckStream<std::vector<Swarm::Data>>::check_stream(fieldDescription + "\n- Function::vecParam", data.getVecParam(), reference.getVecParam(), out);
184 b &= CheckStream<Swarm::Data>::check_stream(fieldDescription + "\n- Function::returnValue", data.getReturnValue(), reference.getReturnValue(), out);
185 return b;
186 }
187
188
189 ///Constructor of class Function
190
2/2
✓ Branch 0 (3→4) taken 2 times.
✓ Branch 2 (5→6) taken 2 times.
2 Function::Function(){
191
1/1
✓ Branch 0 (6→7) taken 2 times.
2 initialisationFunction();
192 2 }
193
194 ///Destructor of class Function
195 3 Function::~Function(){
196
197 3 }
198
199 ///Copy Constructor of class Function
200 /** @param other : Function we want ot copy
201 */
202
2/2
✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (5→6) taken 1 times.
1 Function::Function(const Function & other){
203
1/1
✓ Branch 0 (6→7) taken 1 times.
1 copyFunction(other);
204 1 }
205
206 ///Operator = of class Function
207 /** @param other : Function we want ot copy
208 * @return copied class Function
209 */
210 1 Function & Function::operator = (const Function & other){
211 1 copyFunction(other);
212 1 return *this;
213 }
214
215 ///Sets the name of the Function
216 /** @param name : name of the Function
217 */
218 1 void Function::setName(const PString & name){
219 1 p_name = name;
220 1 }
221
222 ///Sets the description of the Function
223 /** @param description : description of the Function
224 */
225 1 void Function::setDescription(const PString & description){
226 1 p_description = description;
227 1 }
228
229 ///Sets the vecParam of the Function
230 /** @param vecParam : vecParam of the Function
231 */
232 void Function::setVecParam(const std::vector<Swarm::Data> & vecParam){
233 p_vecParam = vecParam;
234 }
235
236 ///Sets the returnValue of the Function
237 /** @param returnValue : returnValue of the Function
238 */
239 void Function::setReturnValue(const Swarm::Data & returnValue){
240 p_returnValue = returnValue;
241 }
242
243 ///Gets the name of the Function
244 /** @return name of the Function
245 */
246 4 const PString & Function::getName() const{
247 4 return p_name;
248 }
249
250 ///Gets the name of the Function
251 /** @return name of the Function
252 */
253 4 PString & Function::getName(){
254 4 return p_name;
255 }
256
257 ///Gets the description of the Function
258 /** @return description of the Function
259 */
260 4 const PString & Function::getDescription() const{
261 4 return p_description;
262 }
263
264 ///Gets the description of the Function
265 /** @return description of the Function
266 */
267 4 PString & Function::getDescription(){
268 4 return p_description;
269 }
270
271 ///Gets the vecParam of the Function
272 /** @return vecParam of the Function
273 */
274 const std::vector<Swarm::Data> & Function::getVecParam() const{
275 return p_vecParam;
276 }
277
278 ///Gets the vecParam of the Function
279 /** @return vecParam of the Function
280 */
281 std::vector<Swarm::Data> & Function::getVecParam(){
282 return p_vecParam;
283 }
284
285 ///Gets the returnValue of the Function
286 /** @return returnValue of the Function
287 */
288 const Swarm::Data & Function::getReturnValue() const{
289 return p_returnValue;
290 }
291
292 ///Gets the returnValue of the Function
293 /** @return returnValue of the Function
294 */
295 Swarm::Data & Function::getReturnValue(){
296 return p_returnValue;
297 }
298
299 ///Copy Function of class Function
300 /** @param other : Function we want ot copy
301 */
302 2 void Function::copyFunction(const Function & other){
303 2 p_name = other.p_name;
304 2 p_description = other.p_description;
305 2 p_vecParam = other.p_vecParam;
306 2 p_returnValue = other.p_returnValue;
307 2 }
308
309 ///Initialisation Function of class Function
310 2 void Function::initialisationFunction(){
311 2 p_name = "";
312 2 p_description = "";
313 2 }
314
315 ///Get the name of the class Message for PhoenixTypeStream
316 /** @return name of the class Message for PhoenixTypeStream
317 */
318 template<>
319 2 std::string phoenix_getTypeName<Message >(){
320
1/1
✓ Branch 0 (4→5) taken 2 times.
4 return "Message";
321 }
322
323 ///Check Stream for a Message
324 /** @param fieldDescription : description of the field to be checked
325 * @param data : data to be checked
326 * @param reference : reference of the check
327 * @param out : ostream used to collect feed back in case of error (std::cerr or a logger)
328 * @return true on success, false otherwise
329 */
330 5 bool CheckStream<Swarm::Message>::check_stream(const std::string & fieldDescription, const Swarm::Message & data, const Swarm::Message & reference, std::ostream & out){
331 5 bool b(true);
332
4/4
✓ Branch 0 (2→3) taken 5 times.
✓ Branch 2 (3→4) taken 5 times.
✓ Branch 4 (4→5) taken 5 times.
✓ Branch 6 (5→6) taken 5 times.
5 b &= CheckStream<time_t>::check_stream(fieldDescription + "\n- Message::sendTime", data.getSendTime(), reference.getSendTime(), out);
333
4/4
✓ Branch 0 (7→8) taken 5 times.
✓ Branch 2 (8→9) taken 5 times.
✓ Branch 4 (9→10) taken 5 times.
✓ Branch 6 (10→11) taken 5 times.
5 b &= CheckStream<size_t>::check_stream(fieldDescription + "\n- Message::id", data.getId(), reference.getId(), out);
334
4/4
✓ Branch 0 (12→13) taken 5 times.
✓ Branch 2 (13→14) taken 5 times.
✓ Branch 4 (14→15) taken 5 times.
✓ Branch 6 (15→16) taken 5 times.
5 b &= CheckStream<bool>::check_stream(fieldDescription + "\n- Message::isConfirmationNeeded", data.getIsConfirmationNeeded(), reference.getIsConfirmationNeeded(), out);
335
4/4
✓ Branch 0 (17→18) taken 5 times.
✓ Branch 2 (18→19) taken 5 times.
✓ Branch 4 (19→20) taken 5 times.
✓ Branch 6 (20→21) taken 5 times.
5 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- Message::sender", data.getSender(), reference.getSender(), out);
336
4/4
✓ Branch 0 (22→23) taken 5 times.
✓ Branch 2 (23→24) taken 5 times.
✓ Branch 4 (24→25) taken 5 times.
✓ Branch 6 (25→26) taken 5 times.
5 b &= CheckStream<std::vector<PString>>::check_stream(fieldDescription + "\n- Message::vecRecver", data.getVecRecver(), reference.getVecRecver(), out);
337
4/4
✓ Branch 0 (27→28) taken 5 times.
✓ Branch 2 (28→29) taken 5 times.
✓ Branch 4 (29→30) taken 5 times.
✓ Branch 6 (30→31) taken 5 times.
5 b &= CheckStream<MessageType::MessageType>::check_stream(fieldDescription + "\n- Message::type", data.getType(), reference.getType(), out);
338
4/4
✓ Branch 0 (32→33) taken 5 times.
✓ Branch 2 (33→34) taken 5 times.
✓ Branch 4 (34→35) taken 5 times.
✓ Branch 6 (35→36) taken 5 times.
5 b &= CheckStream<Swarm::Data>::check_stream(fieldDescription + "\n- Message::data", data.getData(), reference.getData(), out);
339 5 return b;
340 }
341
342
343 ///Constructor of class Message
344
1/1
✓ Branch 0 (4→5) taken 1155 times.
1155 Message::Message(){
345
1/1
✓ Branch 0 (5→6) taken 1155 times.
1155 initialisationMessage();
346 1155 }
347
348 ///Destructor of class Message
349 1156 Message::~Message(){
350
351 1156 }
352
353 ///Copy Constructor of class Message
354 /** @param other : Message we want ot copy
355 */
356
1/1
✓ Branch 0 (4→5) taken 1 times.
1 Message::Message(const Message & other){
357
1/1
✓ Branch 0 (5→6) taken 1 times.
1 copyMessage(other);
358 1 }
359
360 ///Operator = of class Message
361 /** @param other : Message we want ot copy
362 * @return copied class Message
363 */
364 14 Message & Message::operator = (const Message & other){
365 14 copyMessage(other);
366 14 return *this;
367 }
368
369 ///Sets the sendTime of the Message
370 /** @param sendTime : sendTime of the Message
371 */
372 29 void Message::setSendTime(const time_t & sendTime){
373 29 p_sendTime = sendTime;
374 29 }
375
376 ///Sets the id of the Message
377 /** @param id : id of the Message
378 */
379 39 void Message::setId(size_t id){
380 39 p_id = id;
381 39 }
382
383 ///Sets the isConfirmationNeeded of the Message
384 /** @param isConfirmationNeeded : isConfirmationNeeded of the Message
385 */
386 17 void Message::setIsConfirmationNeeded(bool isConfirmationNeeded){
387 17 p_isConfirmationNeeded = isConfirmationNeeded;
388 17 }
389
390 ///Sets the sender of the Message
391 /** @param sender : sender of the Message
392 */
393 31 void Message::setSender(const PString & sender){
394 31 p_sender = sender;
395 31 }
396
397 ///Sets the vecRecver of the Message
398 /** @param vecRecver : vecRecver of the Message
399 */
400 void Message::setVecRecver(const std::vector<PString> & vecRecver){
401 p_vecRecver = vecRecver;
402 }
403
404 ///Sets the type of the Message
405 /** @param type : type of the Message
406 */
407 36 void Message::setType(const MessageType::MessageType & type){
408 36 p_type = type;
409 36 }
410
411 ///Sets the data of the Message
412 /** @param data : data of the Message
413 */
414 17 void Message::setData(const Swarm::Data & data){
415 17 p_data = data;
416 17 }
417
418 ///Gets the sendTime of the Message
419 /** @return sendTime of the Message
420 */
421 2102 const time_t & Message::getSendTime() const{
422 2102 return p_sendTime;
423 }
424
425 ///Gets the sendTime of the Message
426 /** @return sendTime of the Message
427 */
428 10 time_t & Message::getSendTime(){
429 10 return p_sendTime;
430 }
431
432 ///Gets the id of the Message
433 /** @return id of the Message
434 */
435 26 size_t Message::getId() const{
436 26 return p_id;
437 }
438
439 ///Gets the id of the Message
440 /** @return id of the Message
441 */
442 22 size_t & Message::getId(){
443 22 return p_id;
444 }
445
446 ///Gets the isConfirmationNeeded of the Message
447 /** @return isConfirmationNeeded of the Message
448 */
449 34 bool Message::getIsConfirmationNeeded() const{
450 34 return p_isConfirmationNeeded;
451 }
452
453 ///Gets the isConfirmationNeeded of the Message
454 /** @return isConfirmationNeeded of the Message
455 */
456 26 bool & Message::getIsConfirmationNeeded(){
457 26 return p_isConfirmationNeeded;
458 }
459
460 ///Gets the sender of the Message
461 /** @return sender of the Message
462 */
463 14 const PString & Message::getSender() const{
464 14 return p_sender;
465 }
466
467 ///Gets the sender of the Message
468 /** @return sender of the Message
469 */
470 23 PString & Message::getSender(){
471 23 return p_sender;
472 }
473
474 ///Gets the vecRecver of the Message
475 /** @return vecRecver of the Message
476 */
477 6281 const std::vector<PString> & Message::getVecRecver() const{
478 6281 return p_vecRecver;
479 }
480
481 ///Gets the vecRecver of the Message
482 /** @return vecRecver of the Message
483 */
484 29 std::vector<PString> & Message::getVecRecver(){
485 29 return p_vecRecver;
486 }
487
488 ///Gets the type of the Message
489 /** @return type of the Message
490 */
491 10 const MessageType::MessageType & Message::getType() const{
492 10 return p_type;
493 }
494
495 ///Gets the type of the Message
496 /** @return type of the Message
497 */
498 46 MessageType::MessageType & Message::getType(){
499 46 return p_type;
500 }
501
502 ///Gets the data of the Message
503 /** @return data of the Message
504 */
505 18 const Swarm::Data & Message::getData() const{
506 18 return p_data;
507 }
508
509 ///Gets the data of the Message
510 /** @return data of the Message
511 */
512 32 Swarm::Data & Message::getData(){
513 32 return p_data;
514 }
515
516 ///Copy Function of class Message
517 /** @param other : Message we want ot copy
518 */
519 15 void Message::copyMessage(const Message & other){
520 15 p_sendTime = other.p_sendTime;
521 15 p_id = other.p_id;
522 15 p_isConfirmationNeeded = other.p_isConfirmationNeeded;
523 15 p_sender = other.p_sender;
524 15 p_vecRecver = other.p_vecRecver;
525 15 p_type = other.p_type;
526 15 p_data = other.p_data;
527 15 }
528
529 ///Initialisation Function of class Message
530 1155 void Message::initialisationMessage(){
531 1155 p_id = 0lu;
532 1155 p_isConfirmationNeeded = false;
533 1155 p_sender = "";
534 1155 }
535
536 ///Get the name of the class VecStat for PhoenixTypeStream
537 /** @return name of the class VecStat for PhoenixTypeStream
538 */
539 template<>
540 1 std::string phoenix_getTypeName<VecStat >(){
541
1/1
✓ Branch 0 (4→5) taken 1 times.
2 return "VecStat";
542 }
543
544 ///Check Stream for a VecStat
545 /** @param fieldDescription : description of the field to be checked
546 * @param data : data to be checked
547 * @param reference : reference of the check
548 * @param out : ostream used to collect feed back in case of error (std::cerr or a logger)
549 * @return true on success, false otherwise
550 */
551 bool CheckStream<Swarm::VecStat>::check_stream(const std::string & fieldDescription, const Swarm::VecStat & data, const Swarm::VecStat & reference, std::ostream & out){
552 bool b(true);
553 b &= CheckStream<std::vector<size_t>>::check_stream(fieldDescription + "\n- VecStat::nbEvent", data.getNbEvent(), reference.getNbEvent(), out);
554 b &= CheckStream<std::vector<time_t>>::check_stream(fieldDescription + "\n- VecStat::startTimestamp", data.getStartTimestamp(), reference.getStartTimestamp(), out);
555 b &= CheckStream<std::vector<time_t>>::check_stream(fieldDescription + "\n- VecStat::endTimestamp", data.getEndTimestamp(), reference.getEndTimestamp(), out);
556 b &= CheckStream<std::vector<float>>::check_stream(fieldDescription + "\n- VecStat::min", data.getMin(), reference.getMin(), out);
557 b &= CheckStream<std::vector<float>>::check_stream(fieldDescription + "\n- VecStat::max", data.getMax(), reference.getMax(), out);
558 b &= CheckStream<std::vector<float>>::check_stream(fieldDescription + "\n- VecStat::average", data.getAverage(), reference.getAverage(), out);
559 b &= CheckStream<std::vector<float>>::check_stream(fieldDescription + "\n- VecStat::rate", data.getRate(), reference.getRate(), out);
560 b &= CheckStream<std::vector<std::vector<float> >>::check_stream(fieldDescription + "\n- VecStat::vecRateQuantile", data.getVecRateQuantile(), reference.getVecRateQuantile(), out);
561 b &= CheckStream<std::vector<float>>::check_stream(fieldDescription + "\n- VecStat::rateEventBelowLowerBound", data.getRateEventBelowLowerBound(), reference.getRateEventBelowLowerBound(), out);
562 b &= CheckStream<std::vector<float>>::check_stream(fieldDescription + "\n- VecStat::rateEventAboveUpperBound", data.getRateEventAboveUpperBound(), reference.getRateEventAboveUpperBound(), out);
563 return b;
564 }
565
566
567 ///Constructor of class VecStat
568 483 VecStat::VecStat(){
569
1/1
✓ Branch 0 (12→13) taken 483 times.
483 initialisationVecStat();
570 483 }
571
572 ///Destructor of class VecStat
573 491 VecStat::~VecStat(){
574
575 491 }
576
577 ///Copy Constructor of class VecStat
578 /** @param other : VecStat we want ot copy
579 */
580 8 VecStat::VecStat(const VecStat & other){
581
1/1
✓ Branch 0 (12→13) taken 8 times.
8 copyVecStat(other);
582 8 }
583
584 ///Operator = of class VecStat
585 /** @param other : VecStat we want ot copy
586 * @return copied class VecStat
587 */
588 241 VecStat & VecStat::operator = (const VecStat & other){
589 241 copyVecStat(other);
590 241 return *this;
591 }
592
593 ///Sets the nbEvent of the VecStat
594 /** @param nbEvent : nbEvent of the VecStat
595 */
596 void VecStat::setNbEvent(const std::vector<size_t> & nbEvent){
597 p_nbEvent = nbEvent;
598 }
599
600 ///Sets the startTimestamp of the VecStat
601 /** @param startTimestamp : startTimestamp of the VecStat
602 */
603 void VecStat::setStartTimestamp(const std::vector<time_t> & startTimestamp){
604 p_startTimestamp = startTimestamp;
605 }
606
607 ///Sets the endTimestamp of the VecStat
608 /** @param endTimestamp : endTimestamp of the VecStat
609 */
610 void VecStat::setEndTimestamp(const std::vector<time_t> & endTimestamp){
611 p_endTimestamp = endTimestamp;
612 }
613
614 ///Sets the min of the VecStat
615 /** @param min : min of the VecStat
616 */
617 void VecStat::setMin(const std::vector<float> & min){
618 p_min = min;
619 }
620
621 ///Sets the max of the VecStat
622 /** @param max : max of the VecStat
623 */
624 void VecStat::setMax(const std::vector<float> & max){
625 p_max = max;
626 }
627
628 ///Sets the average of the VecStat
629 /** @param average : average of the VecStat
630 */
631 void VecStat::setAverage(const std::vector<float> & average){
632 p_average = average;
633 }
634
635 ///Sets the rate of the VecStat
636 /** @param rate : rate of the VecStat
637 */
638 void VecStat::setRate(const std::vector<float> & rate){
639 p_rate = rate;
640 }
641
642 ///Sets the vecRateQuantile of the VecStat
643 /** @param vecRateQuantile : vecRateQuantile of the VecStat
644 */
645 void VecStat::setVecRateQuantile(const std::vector<std::vector<float> > & vecRateQuantile){
646 p_vecRateQuantile = vecRateQuantile;
647 }
648
649 ///Sets the rateEventBelowLowerBound of the VecStat
650 /** @param rateEventBelowLowerBound : rateEventBelowLowerBound of the VecStat
651 */
652 void VecStat::setRateEventBelowLowerBound(const std::vector<float> & rateEventBelowLowerBound){
653 p_rateEventBelowLowerBound = rateEventBelowLowerBound;
654 }
655
656 ///Sets the rateEventAboveUpperBound of the VecStat
657 /** @param rateEventAboveUpperBound : rateEventAboveUpperBound of the VecStat
658 */
659 void VecStat::setRateEventAboveUpperBound(const std::vector<float> & rateEventAboveUpperBound){
660 p_rateEventAboveUpperBound = rateEventAboveUpperBound;
661 }
662
663 ///Gets the nbEvent of the VecStat
664 /** @return nbEvent of the VecStat
665 */
666 2 const std::vector<size_t> & VecStat::getNbEvent() const{
667 2 return p_nbEvent;
668 }
669
670 ///Gets the nbEvent of the VecStat
671 /** @return nbEvent of the VecStat
672 */
673 241 std::vector<size_t> & VecStat::getNbEvent(){
674 241 return p_nbEvent;
675 }
676
677 ///Gets the startTimestamp of the VecStat
678 /** @return startTimestamp of the VecStat
679 */
680 const std::vector<time_t> & VecStat::getStartTimestamp() const{
681 return p_startTimestamp;
682 }
683
684 ///Gets the startTimestamp of the VecStat
685 /** @return startTimestamp of the VecStat
686 */
687 241 std::vector<time_t> & VecStat::getStartTimestamp(){
688 241 return p_startTimestamp;
689 }
690
691 ///Gets the endTimestamp of the VecStat
692 /** @return endTimestamp of the VecStat
693 */
694 const std::vector<time_t> & VecStat::getEndTimestamp() const{
695 return p_endTimestamp;
696 }
697
698 ///Gets the endTimestamp of the VecStat
699 /** @return endTimestamp of the VecStat
700 */
701 241 std::vector<time_t> & VecStat::getEndTimestamp(){
702 241 return p_endTimestamp;
703 }
704
705 ///Gets the min of the VecStat
706 /** @return min of the VecStat
707 */
708 const std::vector<float> & VecStat::getMin() const{
709 return p_min;
710 }
711
712 ///Gets the min of the VecStat
713 /** @return min of the VecStat
714 */
715 241 std::vector<float> & VecStat::getMin(){
716 241 return p_min;
717 }
718
719 ///Gets the max of the VecStat
720 /** @return max of the VecStat
721 */
722 const std::vector<float> & VecStat::getMax() const{
723 return p_max;
724 }
725
726 ///Gets the max of the VecStat
727 /** @return max of the VecStat
728 */
729 241 std::vector<float> & VecStat::getMax(){
730 241 return p_max;
731 }
732
733 ///Gets the average of the VecStat
734 /** @return average of the VecStat
735 */
736 const std::vector<float> & VecStat::getAverage() const{
737 return p_average;
738 }
739
740 ///Gets the average of the VecStat
741 /** @return average of the VecStat
742 */
743 241 std::vector<float> & VecStat::getAverage(){
744 241 return p_average;
745 }
746
747 ///Gets the rate of the VecStat
748 /** @return rate of the VecStat
749 */
750 const std::vector<float> & VecStat::getRate() const{
751 return p_rate;
752 }
753
754 ///Gets the rate of the VecStat
755 /** @return rate of the VecStat
756 */
757 240 std::vector<float> & VecStat::getRate(){
758 240 return p_rate;
759 }
760
761 ///Gets the vecRateQuantile of the VecStat
762 /** @return vecRateQuantile of the VecStat
763 */
764 const std::vector<std::vector<float> > & VecStat::getVecRateQuantile() const{
765 return p_vecRateQuantile;
766 }
767
768 ///Gets the vecRateQuantile of the VecStat
769 /** @return vecRateQuantile of the VecStat
770 */
771 11935 std::vector<std::vector<float> > & VecStat::getVecRateQuantile(){
772 11935 return p_vecRateQuantile;
773 }
774
775 ///Gets the rateEventBelowLowerBound of the VecStat
776 /** @return rateEventBelowLowerBound of the VecStat
777 */
778 const std::vector<float> & VecStat::getRateEventBelowLowerBound() const{
779 return p_rateEventBelowLowerBound;
780 }
781
782 ///Gets the rateEventBelowLowerBound of the VecStat
783 /** @return rateEventBelowLowerBound of the VecStat
784 */
785 240 std::vector<float> & VecStat::getRateEventBelowLowerBound(){
786 240 return p_rateEventBelowLowerBound;
787 }
788
789 ///Gets the rateEventAboveUpperBound of the VecStat
790 /** @return rateEventAboveUpperBound of the VecStat
791 */
792 const std::vector<float> & VecStat::getRateEventAboveUpperBound() const{
793 return p_rateEventAboveUpperBound;
794 }
795
796 ///Gets the rateEventAboveUpperBound of the VecStat
797 /** @return rateEventAboveUpperBound of the VecStat
798 */
799 240 std::vector<float> & VecStat::getRateEventAboveUpperBound(){
800 240 return p_rateEventAboveUpperBound;
801 }
802
803 ///Copy Function of class VecStat
804 /** @param other : VecStat we want ot copy
805 */
806 249 void VecStat::copyVecStat(const VecStat & other){
807 249 p_nbEvent = other.p_nbEvent;
808 249 p_startTimestamp = other.p_startTimestamp;
809 249 p_endTimestamp = other.p_endTimestamp;
810 249 p_min = other.p_min;
811 249 p_max = other.p_max;
812 249 p_average = other.p_average;
813 249 p_rate = other.p_rate;
814 249 p_vecRateQuantile = other.p_vecRateQuantile;
815 249 p_rateEventBelowLowerBound = other.p_rateEventBelowLowerBound;
816 249 p_rateEventAboveUpperBound = other.p_rateEventAboveUpperBound;
817 249 }
818
819 ///Initialisation Function of class VecStat
820 483 void VecStat::initialisationVecStat(){
821 483 }
822
823 ///Get the name of the class Stat for PhoenixTypeStream
824 /** @return name of the class Stat for PhoenixTypeStream
825 */
826 template<>
827 7 std::string phoenix_getTypeName<Stat >(){
828
1/1
✓ Branch 0 (4→5) taken 7 times.
14 return "Stat";
829 }
830
831 ///Check Stream for a Stat
832 /** @param fieldDescription : description of the field to be checked
833 * @param data : data to be checked
834 * @param reference : reference of the check
835 * @param out : ostream used to collect feed back in case of error (std::cerr or a logger)
836 * @return true on success, false otherwise
837 */
838 bool CheckStream<Swarm::Stat>::check_stream(const std::string & fieldDescription, const Swarm::Stat & data, const Swarm::Stat & reference, std::ostream & out){
839 bool b(true);
840 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- Stat::name", data.getName(), reference.getName(), out);
841 b &= CheckStream<std::map<PString, Swarm::VecStat >>::check_stream(fieldDescription + "\n- Stat::mapStatComputing", data.getMapStatComputing(), reference.getMapStatComputing(), out);
842 b &= CheckStream<std::map<DaemonName, std::map<DataType, Swarm::VecStat > >>::check_stream(fieldDescription + "\n- Stat::mapStatCommunication", data.getMapStatCommunication(), reference.getMapStatCommunication(), out);
843 return b;
844 }
845
846
847 ///Constructor of class Stat
848 246 Stat::Stat(){
849
1/1
✓ Branch 0 (5→6) taken 246 times.
246 initialisationStat();
850 246 }
851
852 ///Destructor of class Stat
853 249 Stat::~Stat(){
854
855 249 }
856
857 ///Copy Constructor of class Stat
858 /** @param other : Stat we want ot copy
859 */
860 3 Stat::Stat(const Stat & other){
861
1/1
✓ Branch 0 (5→6) taken 3 times.
3 copyStat(other);
862 3 }
863
864 ///Operator = of class Stat
865 /** @param other : Stat we want ot copy
866 * @return copied class Stat
867 */
868 3 Stat & Stat::operator = (const Stat & other){
869 3 copyStat(other);
870 3 return *this;
871 }
872
873 ///Sets the name of the Stat
874 /** @param name : name of the Stat
875 */
876 240 void Stat::setName(const PString & name){
877 240 p_name = name;
878 240 }
879
880 ///Sets the mapStatComputing of the Stat
881 /** @param mapStatComputing : mapStatComputing of the Stat
882 */
883 void Stat::setMapStatComputing(const std::map<PString, Swarm::VecStat > & mapStatComputing){
884 p_mapStatComputing = mapStatComputing;
885 }
886
887 ///Sets the mapStatCommunication of the Stat
888 /** @param mapStatCommunication : mapStatCommunication of the Stat
889 */
890 void Stat::setMapStatCommunication(const std::map<DaemonName, std::map<DataType, Swarm::VecStat > > & mapStatCommunication){
891 p_mapStatCommunication = mapStatCommunication;
892 }
893
894 ///Gets the name of the Stat
895 /** @return name of the Stat
896 */
897 6 const PString & Stat::getName() const{
898 6 return p_name;
899 }
900
901 ///Gets the name of the Stat
902 /** @return name of the Stat
903 */
904 4 PString & Stat::getName(){
905 4 return p_name;
906 }
907
908 ///Gets the mapStatComputing of the Stat
909 /** @return mapStatComputing of the Stat
910 */
911 const std::map<PString, Swarm::VecStat > & Stat::getMapStatComputing() const{
912 return p_mapStatComputing;
913 }
914
915 ///Gets the mapStatComputing of the Stat
916 /** @return mapStatComputing of the Stat
917 */
918 241 std::map<PString, Swarm::VecStat > & Stat::getMapStatComputing(){
919 241 return p_mapStatComputing;
920 }
921
922 ///Gets the mapStatCommunication of the Stat
923 /** @return mapStatCommunication of the Stat
924 */
925 const std::map<DaemonName, std::map<DataType, Swarm::VecStat > > & Stat::getMapStatCommunication() const{
926 return p_mapStatCommunication;
927 }
928
929 ///Gets the mapStatCommunication of the Stat
930 /** @return mapStatCommunication of the Stat
931 */
932 7 std::map<DaemonName, std::map<DataType, Swarm::VecStat > > & Stat::getMapStatCommunication(){
933 7 return p_mapStatCommunication;
934 }
935
936 ///Copy Function of class Stat
937 /** @param other : Stat we want ot copy
938 */
939 6 void Stat::copyStat(const Stat & other){
940 6 p_name = other.p_name;
941 6 p_mapStatComputing = other.p_mapStatComputing;
942 6 p_mapStatCommunication = other.p_mapStatCommunication;
943 6 }
944
945 ///Initialisation Function of class Stat
946 246 void Stat::initialisationStat(){
947 246 p_name = "";
948 246 }
949
950 ///Get the name of the class StatAccumulator for PhoenixTypeStream
951 /** @return name of the class StatAccumulator for PhoenixTypeStream
952 */
953 template<>
954 1 std::string phoenix_getTypeName<StatAccumulator >(){
955
1/1
✓ Branch 0 (4→5) taken 1 times.
2 return "StatAccumulator";
956 }
957
958 ///Check Stream for a StatAccumulator
959 /** @param fieldDescription : description of the field to be checked
960 * @param data : data to be checked
961 * @param reference : reference of the check
962 * @param out : ostream used to collect feed back in case of error (std::cerr or a logger)
963 * @return true on success, false otherwise
964 */
965 bool CheckStream<Swarm::StatAccumulator>::check_stream(const std::string & fieldDescription, const Swarm::StatAccumulator & data, const Swarm::StatAccumulator & reference, std::ostream & out){
966 bool b(true);
967 b &= CheckStream<size_t>::check_stream(fieldDescription + "\n- StatAccumulator::nbEvent", data.getNbEvent(), reference.getNbEvent(), out);
968 b &= CheckStream<float>::check_stream(fieldDescription + "\n- StatAccumulator::sum", data.getSum(), reference.getSum(), out);
969 b &= CheckStream<float>::check_stream(fieldDescription + "\n- StatAccumulator::min", data.getMin(), reference.getMin(), out);
970 b &= CheckStream<float>::check_stream(fieldDescription + "\n- StatAccumulator::max", data.getMax(), reference.getMax(), out);
971 b &= CheckStream<std::vector<size_t>>::check_stream(fieldDescription + "\n- StatAccumulator::vecHistogram", data.getVecHistogram(), reference.getVecHistogram(), out);
972 b &= CheckStream<float>::check_stream(fieldDescription + "\n- StatAccumulator::histLowerBound", data.getHistLowerBound(), reference.getHistLowerBound(), out);
973 b &= CheckStream<float>::check_stream(fieldDescription + "\n- StatAccumulator::histUpperBound", data.getHistUpperBound(), reference.getHistUpperBound(), out);
974 b &= CheckStream<size_t>::check_stream(fieldDescription + "\n- StatAccumulator::nbEventBelowLowerBound", data.getNbEventBelowLowerBound(), reference.getNbEventBelowLowerBound(), out);
975 b &= CheckStream<size_t>::check_stream(fieldDescription + "\n- StatAccumulator::nbEventAboveUpperBound", data.getNbEventAboveUpperBound(), reference.getNbEventAboveUpperBound(), out);
976 return b;
977 }
978
979
980 ///Constructor of class StatAccumulator
981 39 StatAccumulator::StatAccumulator(){
982
1/1
✓ Branch 0 (3→4) taken 39 times.
39 initialisationStatAccumulator();
983 39 }
984
985 ///Destructor of class StatAccumulator
986 40 StatAccumulator::~StatAccumulator(){
987
988 40 }
989
990 ///Copy Constructor of class StatAccumulator
991 /** @param other : StatAccumulator we want ot copy
992 */
993 1 StatAccumulator::StatAccumulator(const StatAccumulator & other){
994
1/1
✓ Branch 0 (3→4) taken 1 times.
1 copyStatAccumulator(other);
995 1 }
996
997 ///Operator = of class StatAccumulator
998 /** @param other : StatAccumulator we want ot copy
999 * @return copied class StatAccumulator
1000 */
1001 19 StatAccumulator & StatAccumulator::operator = (const StatAccumulator & other){
1002 19 copyStatAccumulator(other);
1003 19 return *this;
1004 }
1005
1006 ///Sets the nbEvent of the StatAccumulator
1007 /** @param nbEvent : nbEvent of the StatAccumulator
1008 */
1009 273 void StatAccumulator::setNbEvent(size_t nbEvent){
1010 273 p_nbEvent = nbEvent;
1011 273 }
1012
1013 ///Sets the sum of the StatAccumulator
1014 /** @param sum : sum of the StatAccumulator
1015 */
1016 35 void StatAccumulator::setSum(float sum){
1017 35 p_sum = sum;
1018 35 }
1019
1020 ///Sets the min of the StatAccumulator
1021 /** @param min : min of the StatAccumulator
1022 */
1023 31 void StatAccumulator::setMin(float min){
1024 31 p_min = min;
1025 31 }
1026
1027 ///Sets the max of the StatAccumulator
1028 /** @param max : max of the StatAccumulator
1029 */
1030 26 void StatAccumulator::setMax(float max){
1031 26 p_max = max;
1032 26 }
1033
1034 ///Sets the vecHistogram of the StatAccumulator
1035 /** @param vecHistogram : vecHistogram of the StatAccumulator
1036 */
1037 19 void StatAccumulator::setVecHistogram(const std::vector<size_t> & vecHistogram){
1038 19 p_vecHistogram = vecHistogram;
1039 19 }
1040
1041 ///Sets the histLowerBound of the StatAccumulator
1042 /** @param histLowerBound : histLowerBound of the StatAccumulator
1043 */
1044 20 void StatAccumulator::setHistLowerBound(float histLowerBound){
1045 20 p_histLowerBound = histLowerBound;
1046 20 }
1047
1048 ///Sets the histUpperBound of the StatAccumulator
1049 /** @param histUpperBound : histUpperBound of the StatAccumulator
1050 */
1051 20 void StatAccumulator::setHistUpperBound(float histUpperBound){
1052 20 p_histUpperBound = histUpperBound;
1053 20 }
1054
1055 ///Sets the nbEventBelowLowerBound of the StatAccumulator
1056 /** @param nbEventBelowLowerBound : nbEventBelowLowerBound of the StatAccumulator
1057 */
1058 19 void StatAccumulator::setNbEventBelowLowerBound(size_t nbEventBelowLowerBound){
1059 19 p_nbEventBelowLowerBound = nbEventBelowLowerBound;
1060 19 }
1061
1062 ///Sets the nbEventAboveUpperBound of the StatAccumulator
1063 /** @param nbEventAboveUpperBound : nbEventAboveUpperBound of the StatAccumulator
1064 */
1065 26 void StatAccumulator::setNbEventAboveUpperBound(size_t nbEventAboveUpperBound){
1066 26 p_nbEventAboveUpperBound = nbEventAboveUpperBound;
1067 26 }
1068
1069 ///Gets the nbEvent of the StatAccumulator
1070 /** @return nbEvent of the StatAccumulator
1071 */
1072 723 size_t StatAccumulator::getNbEvent() const{
1073 723 return p_nbEvent;
1074 }
1075
1076 ///Gets the nbEvent of the StatAccumulator
1077 /** @return nbEvent of the StatAccumulator
1078 */
1079 59 size_t & StatAccumulator::getNbEvent(){
1080 59 return p_nbEvent;
1081 }
1082
1083 ///Gets the sum of the StatAccumulator
1084 /** @return sum of the StatAccumulator
1085 */
1086 243 float StatAccumulator::getSum() const{
1087 243 return p_sum;
1088 }
1089
1090 ///Gets the sum of the StatAccumulator
1091 /** @return sum of the StatAccumulator
1092 */
1093 17 float & StatAccumulator::getSum(){
1094 17 return p_sum;
1095 }
1096
1097 ///Gets the min of the StatAccumulator
1098 /** @return min of the StatAccumulator
1099 */
1100 243 float StatAccumulator::getMin() const{
1101 243 return p_min;
1102 }
1103
1104 ///Gets the min of the StatAccumulator
1105 /** @return min of the StatAccumulator
1106 */
1107 17 float & StatAccumulator::getMin(){
1108 17 return p_min;
1109 }
1110
1111 ///Gets the max of the StatAccumulator
1112 /** @return max of the StatAccumulator
1113 */
1114 243 float StatAccumulator::getMax() const{
1115 243 return p_max;
1116 }
1117
1118 ///Gets the max of the StatAccumulator
1119 /** @return max of the StatAccumulator
1120 */
1121 17 float & StatAccumulator::getMax(){
1122 17 return p_max;
1123 }
1124
1125 ///Gets the vecHistogram of the StatAccumulator
1126 /** @return vecHistogram of the StatAccumulator
1127 */
1128 23882 const std::vector<size_t> & StatAccumulator::getVecHistogram() const{
1129 23882 return p_vecHistogram;
1130 }
1131
1132 ///Gets the vecHistogram of the StatAccumulator
1133 /** @return vecHistogram of the StatAccumulator
1134 */
1135 527 std::vector<size_t> & StatAccumulator::getVecHistogram(){
1136 527 return p_vecHistogram;
1137 }
1138
1139 ///Gets the histLowerBound of the StatAccumulator
1140 /** @return histLowerBound of the StatAccumulator
1141 */
1142 4 float StatAccumulator::getHistLowerBound() const{
1143 4 return p_histLowerBound;
1144 }
1145
1146 ///Gets the histLowerBound of the StatAccumulator
1147 /** @return histLowerBound of the StatAccumulator
1148 */
1149 55 float & StatAccumulator::getHistLowerBound(){
1150 55 return p_histLowerBound;
1151 }
1152
1153 ///Gets the histUpperBound of the StatAccumulator
1154 /** @return histUpperBound of the StatAccumulator
1155 */
1156 4 float StatAccumulator::getHistUpperBound() const{
1157 4 return p_histUpperBound;
1158 }
1159
1160 ///Gets the histUpperBound of the StatAccumulator
1161 /** @return histUpperBound of the StatAccumulator
1162 */
1163 38 float & StatAccumulator::getHistUpperBound(){
1164 38 return p_histUpperBound;
1165 }
1166
1167 ///Gets the nbEventBelowLowerBound of the StatAccumulator
1168 /** @return nbEventBelowLowerBound of the StatAccumulator
1169 */
1170 243 size_t StatAccumulator::getNbEventBelowLowerBound() const{
1171 243 return p_nbEventBelowLowerBound;
1172 }
1173
1174 ///Gets the nbEventBelowLowerBound of the StatAccumulator
1175 /** @return nbEventBelowLowerBound of the StatAccumulator
1176 */
1177 6 size_t & StatAccumulator::getNbEventBelowLowerBound(){
1178 6 return p_nbEventBelowLowerBound;
1179 }
1180
1181 ///Gets the nbEventAboveUpperBound of the StatAccumulator
1182 /** @return nbEventAboveUpperBound of the StatAccumulator
1183 */
1184 243 size_t StatAccumulator::getNbEventAboveUpperBound() const{
1185 243 return p_nbEventAboveUpperBound;
1186 }
1187
1188 ///Gets the nbEventAboveUpperBound of the StatAccumulator
1189 /** @return nbEventAboveUpperBound of the StatAccumulator
1190 */
1191 13 size_t & StatAccumulator::getNbEventAboveUpperBound(){
1192 13 return p_nbEventAboveUpperBound;
1193 }
1194
1195 ///Copy Function of class StatAccumulator
1196 /** @param other : StatAccumulator we want ot copy
1197 */
1198 20 void StatAccumulator::copyStatAccumulator(const StatAccumulator & other){
1199 20 p_nbEvent = other.p_nbEvent;
1200 20 p_sum = other.p_sum;
1201 20 p_min = other.p_min;
1202 20 p_max = other.p_max;
1203 20 p_vecHistogram = other.p_vecHistogram;
1204 20 p_histLowerBound = other.p_histLowerBound;
1205 20 p_histUpperBound = other.p_histUpperBound;
1206 20 p_nbEventBelowLowerBound = other.p_nbEventBelowLowerBound;
1207 20 p_nbEventAboveUpperBound = other.p_nbEventAboveUpperBound;
1208 20 }
1209
1210 ///Initialisation Function of class StatAccumulator
1211 39 void StatAccumulator::initialisationStatAccumulator(){
1212 39 p_nbEvent = 0lu;
1213 39 p_sum = 0.0f;
1214 39 p_min = 0.0f;
1215 39 p_max = 0.0f;
1216 39 p_histLowerBound = 0.0f;
1217 39 p_histUpperBound = 0.0f;
1218 39 p_nbEventBelowLowerBound = 0lu;
1219 39 p_nbEventAboveUpperBound = 0lu;
1220 39 }
1221
1222 ///Get the name of the class DaemonStatAccumulator for PhoenixTypeStream
1223 /** @return name of the class DaemonStatAccumulator for PhoenixTypeStream
1224 */
1225 template<>
1226 1 std::string phoenix_getTypeName<DaemonStatAccumulator >(){
1227
1/1
✓ Branch 0 (4→5) taken 1 times.
2 return "DaemonStatAccumulator";
1228 }
1229
1230 ///Check Stream for a DaemonStatAccumulator
1231 /** @param fieldDescription : description of the field to be checked
1232 * @param data : data to be checked
1233 * @param reference : reference of the check
1234 * @param out : ostream used to collect feed back in case of error (std::cerr or a logger)
1235 * @return true on success, false otherwise
1236 */
1237 bool CheckStream<Swarm::DaemonStatAccumulator>::check_stream(const std::string & fieldDescription, const Swarm::DaemonStatAccumulator & data, const Swarm::DaemonStatAccumulator & reference, std::ostream & out){
1238 bool b(true);
1239 b &= CheckStream<std::map<PString, Swarm::StatAccumulator >>::check_stream(fieldDescription + "\n- DaemonStatAccumulator::mapStatComputing", data.getMapStatComputing(), reference.getMapStatComputing(), out);
1240 b &= CheckStream<std::map<DaemonName, std::map<DataType, Swarm::StatAccumulator > >>::check_stream(fieldDescription + "\n- DaemonStatAccumulator::mapStatCommunication", data.getMapStatCommunication(), reference.getMapStatCommunication(), out);
1241 return b;
1242 }
1243
1244
1245 ///Constructor of class DaemonStatAccumulator
1246 122 DaemonStatAccumulator::DaemonStatAccumulator(){
1247
1/1
✓ Branch 0 (4→5) taken 122 times.
122 initialisationDaemonStatAccumulator();
1248 122 }
1249
1250 ///Destructor of class DaemonStatAccumulator
1251 123 DaemonStatAccumulator::~DaemonStatAccumulator(){
1252
1253 123 }
1254
1255 ///Copy Constructor of class DaemonStatAccumulator
1256 /** @param other : DaemonStatAccumulator we want ot copy
1257 */
1258 1 DaemonStatAccumulator::DaemonStatAccumulator(const DaemonStatAccumulator & other){
1259
1/1
✓ Branch 0 (4→5) taken 1 times.
1 copyDaemonStatAccumulator(other);
1260 1 }
1261
1262 ///Operator = of class DaemonStatAccumulator
1263 /** @param other : DaemonStatAccumulator we want ot copy
1264 * @return copied class DaemonStatAccumulator
1265 */
1266 25 DaemonStatAccumulator & DaemonStatAccumulator::operator = (const DaemonStatAccumulator & other){
1267 25 copyDaemonStatAccumulator(other);
1268 25 return *this;
1269 }
1270
1271 ///Sets the mapStatComputing of the DaemonStatAccumulator
1272 /** @param mapStatComputing : mapStatComputing of the DaemonStatAccumulator
1273 */
1274 void DaemonStatAccumulator::setMapStatComputing(const std::map<PString, Swarm::StatAccumulator > & mapStatComputing){
1275 p_mapStatComputing = mapStatComputing;
1276 }
1277
1278 ///Sets the mapStatCommunication of the DaemonStatAccumulator
1279 /** @param mapStatCommunication : mapStatCommunication of the DaemonStatAccumulator
1280 */
1281 void DaemonStatAccumulator::setMapStatCommunication(const std::map<DaemonName, std::map<DataType, Swarm::StatAccumulator > > & mapStatCommunication){
1282 p_mapStatCommunication = mapStatCommunication;
1283 }
1284
1285 ///Gets the mapStatComputing of the DaemonStatAccumulator
1286 /** @return mapStatComputing of the DaemonStatAccumulator
1287 */
1288 const std::map<PString, Swarm::StatAccumulator > & DaemonStatAccumulator::getMapStatComputing() const{
1289 return p_mapStatComputing;
1290 }
1291
1292 ///Gets the mapStatComputing of the DaemonStatAccumulator
1293 /** @return mapStatComputing of the DaemonStatAccumulator
1294 */
1295 977 std::map<PString, Swarm::StatAccumulator > & DaemonStatAccumulator::getMapStatComputing(){
1296 977 return p_mapStatComputing;
1297 }
1298
1299 ///Gets the mapStatCommunication of the DaemonStatAccumulator
1300 /** @return mapStatCommunication of the DaemonStatAccumulator
1301 */
1302 const std::map<DaemonName, std::map<DataType, Swarm::StatAccumulator > > & DaemonStatAccumulator::getMapStatCommunication() const{
1303 return p_mapStatCommunication;
1304 }
1305
1306 ///Gets the mapStatCommunication of the DaemonStatAccumulator
1307 /** @return mapStatCommunication of the DaemonStatAccumulator
1308 */
1309 744 std::map<DaemonName, std::map<DataType, Swarm::StatAccumulator > > & DaemonStatAccumulator::getMapStatCommunication(){
1310 744 return p_mapStatCommunication;
1311 }
1312
1313 ///Copy Function of class DaemonStatAccumulator
1314 /** @param other : DaemonStatAccumulator we want ot copy
1315 */
1316 26 void DaemonStatAccumulator::copyDaemonStatAccumulator(const DaemonStatAccumulator & other){
1317 26 p_mapStatComputing = other.p_mapStatComputing;
1318 26 p_mapStatCommunication = other.p_mapStatCommunication;
1319 26 }
1320
1321 ///Initialisation Function of class DaemonStatAccumulator
1322 122 void DaemonStatAccumulator::initialisationDaemonStatAccumulator(){
1323 122 }
1324
1325 ///Get the name of the class DaemonConfig for PhoenixTypeStream
1326 /** @return name of the class DaemonConfig for PhoenixTypeStream
1327 */
1328 template<>
1329 1 std::string phoenix_getTypeName<DaemonConfig >(){
1330
1/1
✓ Branch 0 (4→5) taken 1 times.
2 return "DaemonConfig";
1331 }
1332
1333 ///Check Stream for a DaemonConfig
1334 /** @param fieldDescription : description of the field to be checked
1335 * @param data : data to be checked
1336 * @param reference : reference of the check
1337 * @param out : ostream used to collect feed back in case of error (std::cerr or a logger)
1338 * @return true on success, false otherwise
1339 */
1340 bool CheckStream<Swarm::DaemonConfig>::check_stream(const std::string & fieldDescription, const Swarm::DaemonConfig & data, const Swarm::DaemonConfig & reference, std::ostream & out){
1341 bool b(true);
1342 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- DaemonConfig::hostName", data.getHostName(), reference.getHostName(), out);
1343 b &= CheckStream<size_t>::check_stream(fieldDescription + "\n- DaemonConfig::receivingPort", data.getReceivingPort(), reference.getReceivingPort(), out);
1344 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- DaemonConfig::name", data.getName(), reference.getName(), out);
1345 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- DaemonConfig::description", data.getDescription(), reference.getDescription(), out);
1346 b &= CheckStream<std::map<PString, time_t>>::check_stream(fieldDescription + "\n- DaemonConfig::mapTimeout", data.getMapTimeout(), reference.getMapTimeout(), out);
1347 b &= CheckStream<size_t>::check_stream(fieldDescription + "\n- DaemonConfig::statNbBin", data.getStatNbBin(), reference.getStatNbBin(), out);
1348 b &= CheckStream<float>::check_stream(fieldDescription + "\n- DaemonConfig::statHistLowerBound", data.getStatHistLowerBound(), reference.getStatHistLowerBound(), out);
1349 b &= CheckStream<float>::check_stream(fieldDescription + "\n- DaemonConfig::statHistUpperBound", data.getStatHistUpperBound(), reference.getStatHistUpperBound(), out);
1350 b &= CheckStream<time_t>::check_stream(fieldDescription + "\n- DaemonConfig::statTimerPeriodMs", data.getStatTimerPeriodMs(), reference.getStatTimerPeriodMs(), out);
1351 b &= CheckStream<Swarm::DaemonStatAccumulator>::check_stream(fieldDescription + "\n- DaemonConfig::daemonStatAccumulator", data.getDaemonStatAccumulator(), reference.getDaemonStatAccumulator(), out);
1352 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- DaemonConfig::statDaemonName", data.getStatDaemonName(), reference.getStatDaemonName(), out);
1353 return b;
1354 }
1355
1356
1357 ///Constructor of class DaemonConfig
1358
4/4
✓ Branch 0 (3→4) taken 119 times.
✓ Branch 2 (4→5) taken 119 times.
✓ Branch 4 (6→7) taken 119 times.
✓ Branch 6 (7→8) taken 119 times.
119 DaemonConfig::DaemonConfig(){
1359
1/1
✓ Branch 0 (8→9) taken 119 times.
119 initialisationDaemonConfig();
1360 119 }
1361
1362 ///Destructor of class DaemonConfig
1363 120 DaemonConfig::~DaemonConfig(){
1364
1365 120 }
1366
1367 ///Copy Constructor of class DaemonConfig
1368 /** @param other : DaemonConfig we want ot copy
1369 */
1370
4/4
✓ Branch 0 (3→4) taken 1 times.
✓ Branch 2 (4→5) taken 1 times.
✓ Branch 4 (6→7) taken 1 times.
✓ Branch 6 (7→8) taken 1 times.
1 DaemonConfig::DaemonConfig(const DaemonConfig & other){
1371
1/1
✓ Branch 0 (8→9) taken 1 times.
1 copyDaemonConfig(other);
1372 1 }
1373
1374 ///Operator = of class DaemonConfig
1375 /** @param other : DaemonConfig we want ot copy
1376 * @return copied class DaemonConfig
1377 */
1378 23 DaemonConfig & DaemonConfig::operator = (const DaemonConfig & other){
1379 23 copyDaemonConfig(other);
1380 23 return *this;
1381 }
1382
1383 ///Sets the hostName of the DaemonConfig
1384 /** @param hostName : hostName of the DaemonConfig
1385 */
1386 48 void DaemonConfig::setHostName(const PString & hostName){
1387 48 p_hostName = hostName;
1388 48 }
1389
1390 ///Sets the receivingPort of the DaemonConfig
1391 /** @param receivingPort : receivingPort of the DaemonConfig
1392 */
1393 45 void DaemonConfig::setReceivingPort(size_t receivingPort){
1394 45 p_receivingPort = receivingPort;
1395 45 }
1396
1397 ///Sets the name of the DaemonConfig
1398 /** @param name : name of the DaemonConfig
1399 */
1400 92 void DaemonConfig::setName(const PString & name){
1401 92 p_name = name;
1402 92 }
1403
1404 ///Sets the description of the DaemonConfig
1405 /** @param description : description of the DaemonConfig
1406 */
1407 45 void DaemonConfig::setDescription(const PString & description){
1408 45 p_description = description;
1409 45 }
1410
1411 ///Sets the mapTimeout of the DaemonConfig
1412 /** @param mapTimeout : mapTimeout of the DaemonConfig
1413 */
1414 20 void DaemonConfig::setMapTimeout(const std::map<PString, time_t> & mapTimeout){
1415 20 p_mapTimeout = mapTimeout;
1416 20 }
1417
1418 ///Sets the statNbBin of the DaemonConfig
1419 /** @param statNbBin : statNbBin of the DaemonConfig
1420 */
1421 45 void DaemonConfig::setStatNbBin(size_t statNbBin){
1422 45 p_statNbBin = statNbBin;
1423 45 }
1424
1425 ///Sets the statHistLowerBound of the DaemonConfig
1426 /** @param statHistLowerBound : statHistLowerBound of the DaemonConfig
1427 */
1428 45 void DaemonConfig::setStatHistLowerBound(float statHistLowerBound){
1429 45 p_statHistLowerBound = statHistLowerBound;
1430 45 }
1431
1432 ///Sets the statHistUpperBound of the DaemonConfig
1433 /** @param statHistUpperBound : statHistUpperBound of the DaemonConfig
1434 */
1435 45 void DaemonConfig::setStatHistUpperBound(float statHistUpperBound){
1436 45 p_statHistUpperBound = statHistUpperBound;
1437 45 }
1438
1439 ///Sets the statTimerPeriodMs of the DaemonConfig
1440 /** @param statTimerPeriodMs : statTimerPeriodMs of the DaemonConfig
1441 */
1442 44 void DaemonConfig::setStatTimerPeriodMs(const time_t & statTimerPeriodMs){
1443 44 p_statTimerPeriodMs = statTimerPeriodMs;
1444 44 }
1445
1446 ///Sets the daemonStatAccumulator of the DaemonConfig
1447 /** @param daemonStatAccumulator : daemonStatAccumulator of the DaemonConfig
1448 */
1449 void DaemonConfig::setDaemonStatAccumulator(const Swarm::DaemonStatAccumulator & daemonStatAccumulator){
1450 p_daemonStatAccumulator = daemonStatAccumulator;
1451 }
1452
1453 ///Sets the statDaemonName of the DaemonConfig
1454 /** @param statDaemonName : statDaemonName of the DaemonConfig
1455 */
1456 6 void DaemonConfig::setStatDaemonName(const PString & statDaemonName){
1457 6 p_statDaemonName = statDaemonName;
1458 6 }
1459
1460 ///Gets the hostName of the DaemonConfig
1461 /** @return hostName of the DaemonConfig
1462 */
1463 4 const PString & DaemonConfig::getHostName() const{
1464 4 return p_hostName;
1465 }
1466
1467 ///Gets the hostName of the DaemonConfig
1468 /** @return hostName of the DaemonConfig
1469 */
1470 78 PString & DaemonConfig::getHostName(){
1471 78 return p_hostName;
1472 }
1473
1474 ///Gets the receivingPort of the DaemonConfig
1475 /** @return receivingPort of the DaemonConfig
1476 */
1477 4 size_t DaemonConfig::getReceivingPort() const{
1478 4 return p_receivingPort;
1479 }
1480
1481 ///Gets the receivingPort of the DaemonConfig
1482 /** @return receivingPort of the DaemonConfig
1483 */
1484 114 size_t & DaemonConfig::getReceivingPort(){
1485 114 return p_receivingPort;
1486 }
1487
1488 ///Gets the name of the DaemonConfig
1489 /** @return name of the DaemonConfig
1490 */
1491 6 const PString & DaemonConfig::getName() const{
1492 6 return p_name;
1493 }
1494
1495 ///Gets the name of the DaemonConfig
1496 /** @return name of the DaemonConfig
1497 */
1498 822 PString & DaemonConfig::getName(){
1499 822 return p_name;
1500 }
1501
1502 ///Gets the description of the DaemonConfig
1503 /** @return description of the DaemonConfig
1504 */
1505 4 const PString & DaemonConfig::getDescription() const{
1506 4 return p_description;
1507 }
1508
1509 ///Gets the description of the DaemonConfig
1510 /** @return description of the DaemonConfig
1511 */
1512 7 PString & DaemonConfig::getDescription(){
1513 7 return p_description;
1514 }
1515
1516 ///Gets the mapTimeout of the DaemonConfig
1517 /** @return mapTimeout of the DaemonConfig
1518 */
1519 const std::map<PString, time_t> & DaemonConfig::getMapTimeout() const{
1520 return p_mapTimeout;
1521 }
1522
1523 ///Gets the mapTimeout of the DaemonConfig
1524 /** @return mapTimeout of the DaemonConfig
1525 */
1526 4173 std::map<PString, time_t> & DaemonConfig::getMapTimeout(){
1527 4173 return p_mapTimeout;
1528 }
1529
1530 ///Gets the statNbBin of the DaemonConfig
1531 /** @return statNbBin of the DaemonConfig
1532 */
1533 4 size_t DaemonConfig::getStatNbBin() const{
1534 4 return p_statNbBin;
1535 }
1536
1537 ///Gets the statNbBin of the DaemonConfig
1538 /** @return statNbBin of the DaemonConfig
1539 */
1540 19 size_t & DaemonConfig::getStatNbBin(){
1541 19 return p_statNbBin;
1542 }
1543
1544 ///Gets the statHistLowerBound of the DaemonConfig
1545 /** @return statHistLowerBound of the DaemonConfig
1546 */
1547 4 float DaemonConfig::getStatHistLowerBound() const{
1548 4 return p_statHistLowerBound;
1549 }
1550
1551 ///Gets the statHistLowerBound of the DaemonConfig
1552 /** @return statHistLowerBound of the DaemonConfig
1553 */
1554 19 float & DaemonConfig::getStatHistLowerBound(){
1555 19 return p_statHistLowerBound;
1556 }
1557
1558 ///Gets the statHistUpperBound of the DaemonConfig
1559 /** @return statHistUpperBound of the DaemonConfig
1560 */
1561 4 float DaemonConfig::getStatHistUpperBound() const{
1562 4 return p_statHistUpperBound;
1563 }
1564
1565 ///Gets the statHistUpperBound of the DaemonConfig
1566 /** @return statHistUpperBound of the DaemonConfig
1567 */
1568 19 float & DaemonConfig::getStatHistUpperBound(){
1569 19 return p_statHistUpperBound;
1570 }
1571
1572 ///Gets the statTimerPeriodMs of the DaemonConfig
1573 /** @return statTimerPeriodMs of the DaemonConfig
1574 */
1575 const time_t & DaemonConfig::getStatTimerPeriodMs() const{
1576 return p_statTimerPeriodMs;
1577 }
1578
1579 ///Gets the statTimerPeriodMs of the DaemonConfig
1580 /** @return statTimerPeriodMs of the DaemonConfig
1581 */
1582 9 time_t & DaemonConfig::getStatTimerPeriodMs(){
1583 9 return p_statTimerPeriodMs;
1584 }
1585
1586 ///Gets the daemonStatAccumulator of the DaemonConfig
1587 /** @return daemonStatAccumulator of the DaemonConfig
1588 */
1589 const Swarm::DaemonStatAccumulator & DaemonConfig::getDaemonStatAccumulator() const{
1590 return p_daemonStatAccumulator;
1591 }
1592
1593 ///Gets the daemonStatAccumulator of the DaemonConfig
1594 /** @return daemonStatAccumulator of the DaemonConfig
1595 */
1596 1721 Swarm::DaemonStatAccumulator & DaemonConfig::getDaemonStatAccumulator(){
1597 1721 return p_daemonStatAccumulator;
1598 }
1599
1600 ///Gets the statDaemonName of the DaemonConfig
1601 /** @return statDaemonName of the DaemonConfig
1602 */
1603 4 const PString & DaemonConfig::getStatDaemonName() const{
1604 4 return p_statDaemonName;
1605 }
1606
1607 ///Gets the statDaemonName of the DaemonConfig
1608 /** @return statDaemonName of the DaemonConfig
1609 */
1610 523 PString & DaemonConfig::getStatDaemonName(){
1611 523 return p_statDaemonName;
1612 }
1613
1614 ///Copy Function of class DaemonConfig
1615 /** @param other : DaemonConfig we want ot copy
1616 */
1617 24 void DaemonConfig::copyDaemonConfig(const DaemonConfig & other){
1618 24 p_hostName = other.p_hostName;
1619 24 p_receivingPort = other.p_receivingPort;
1620 24 p_name = other.p_name;
1621 24 p_description = other.p_description;
1622 24 p_mapTimeout = other.p_mapTimeout;
1623 24 p_statNbBin = other.p_statNbBin;
1624 24 p_statHistLowerBound = other.p_statHistLowerBound;
1625 24 p_statHistUpperBound = other.p_statHistUpperBound;
1626 24 p_statTimerPeriodMs = other.p_statTimerPeriodMs;
1627 24 p_daemonStatAccumulator = other.p_daemonStatAccumulator;
1628 24 p_statDaemonName = other.p_statDaemonName;
1629 24 }
1630
1631 ///Initialisation Function of class DaemonConfig
1632 119 void DaemonConfig::initialisationDaemonConfig(){
1633 119 p_hostName = "";
1634 119 p_receivingPort = 0lu;
1635 119 p_name = "";
1636 119 p_description = "";
1637 119 p_statNbBin = 0lu;
1638 119 p_statHistLowerBound = 0.0f;
1639 119 p_statHistUpperBound = 0.0f;
1640 119 p_statDaemonName = "";
1641 119 }
1642
1643