MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
Attribute.h
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2023 The HepMC collaboration (see AUTHORS for details)
5//
6#ifndef HEPMC3_ATTRIBUTE_H
7#define HEPMC3_ATTRIBUTE_H
22#include <cstdio> // sprintf
23#include <string>
24#include <limits>
25#include <sstream>
26#include <iomanip>
27#include <map>
28
29#include "HepMC3/GenParticle_fwd.h"
30#include "HepMC3/GenVertex_fwd.h"
31
33using std::string;
34
35namespace HepMC3 {
36
38class GenEvent;
39
41class GenRunInfo;
42
44class Attribute {
45//
46// Constructors
47//
48public:
50 //Note: m_event should be set to nullptr in case event is deleted!
51 Attribute():m_is_parsed(true) { m_event=nullptr; }
52
54 virtual ~Attribute() {}
55
56protected:
65 //Note: m_event should be set to nullptr n case event is deleted!
66 explicit Attribute(const std::string &st):m_is_parsed(false),m_string(st) { m_event=nullptr; }
67
69 friend class GenEvent;
70
71//
72// Virtual Functions
73//
74public:
77 virtual bool from_string(const std::string & att) = 0;
78
81 virtual bool init() {
82 return true;
83 }
84
90 virtual bool init(const GenRunInfo & ) {
91 return true;
92 }
93
95 virtual bool to_string(std::string &att) const = 0;
96
97//
98// Accessors
99//
100public:
102 bool is_parsed() const { return m_is_parsed; }
103
105 const std::string& unparsed_string() const { return m_string; }
106
108 const GenEvent * event() const {
109 return m_event;
110 }
111
113 GenParticlePtr particle() {
114 return m_particle;
115 }
116
118 ConstGenParticlePtr particle() const {
119 return std::const_pointer_cast<GenParticle>(m_particle);
120 }
121
123 GenVertexPtr vertex() {
124 return m_vertex;
125 }
126
128 ConstGenVertexPtr vertex() const {
129 return std::const_pointer_cast<GenVertex>(m_vertex);
130 }
131
132protected:
134 void set_is_parsed(bool flag) { m_is_parsed = flag; }
135
137 void set_unparsed_string(const std::string &st) { m_string = st; }
138
139//
140// Fields
141//
142private:
143 bool m_is_parsed;
144 std::string m_string;
145 const GenEvent * m_event;
147 GenParticlePtr m_particle;
148 GenVertexPtr m_vertex;
149};
150
157class IntAttribute : public Attribute {
158public:
159
161 IntAttribute():Attribute(),m_val(0) {}
162
164 IntAttribute(int val):Attribute(),m_val(val) {}
165
167 bool from_string(const std::string &att) override {
168 m_val = atoi( att.c_str() );
169 set_is_parsed(true);
170 return true;
171 }
172
174 bool to_string(std::string &att) const override {
175 att = std::to_string(m_val);
176 return true;
177 }
178
180 int value() const {
181 return m_val;
182 }
183
185 void set_value(const int& i) {
186 m_val = i;
187 set_is_parsed(true);
188 }
189
190private:
191 int m_val;
192};
193
200class LongAttribute : public Attribute {
201public:
202
204 LongAttribute(): Attribute(), m_val(0) {}
205
207 LongAttribute(long val): Attribute(), m_val(val) {}
208
210 bool from_string(const std::string &att) override {
211 m_val = atol( att.c_str() );
212 set_is_parsed(true);
213 return true;
214 }
215
217 bool to_string(std::string &att) const override {
218 att = std::to_string(m_val);
219 return true;
220 }
221
223 long value() const {
224 return m_val;
225 }
226
228 void set_value(const long& l) {
229 m_val = l;
230 set_is_parsed(true);
231 }
232
233private:
234
235 long m_val;
236
237};
238
246public:
247
249 DoubleAttribute(): Attribute(), m_val(0.0) {}
250
252 DoubleAttribute(double val): Attribute(), m_val(val) {}
253
255 bool from_string(const std::string &att) override {
256 m_val = atof( att.c_str() );
257 set_is_parsed(true);
258 return true;
259 }
260
262 bool to_string(std::string &att) const override {
263 std::ostringstream oss;
264 oss << std::setprecision(std::numeric_limits<double>::digits10)
265 << m_val;
266 att = oss.str();
267 return true;
268 }
269
271 double value() const {
272 return m_val;
273 }
274
276 void set_value(const double& d) {
277 m_val = d;
278 set_is_parsed(true);
279 }
280
281private:
282
283 double m_val;
284};
285
292class FloatAttribute : public Attribute {
293public:
294
296 FloatAttribute(): Attribute(), m_val(0.0) {}
297
299 FloatAttribute(float val): Attribute(), m_val(val) {}
300
302 bool from_string(const std::string &att) override {
303 m_val = float(atof( att.c_str() ));
304 set_is_parsed(true);
305 return true;
306 }
307
309 bool to_string(std::string &att) const override {
310 std::ostringstream oss;
311 oss << std::setprecision(std::numeric_limits<float>::digits10)
312 << m_val;
313 att = oss.str();
314 return true;
315 }
316
318 float value() const {
319 return m_val;
320 }
321
323 void set_value(const float& f) {
324 m_val = f;
325 set_is_parsed(true);
326 }
327
328private:
329
330 float m_val;
331};
332
344public:
345
348
355 StringAttribute(const std::string &st):Attribute(st) {}
356
358 bool from_string(const std::string &att) override {
360 return true;
361 }
362
364 bool to_string(std::string &att) const override {
365 att = unparsed_string();
366 return true;
367 }
368
370 std::string value() const {
371 return unparsed_string();
372 }
373
375 void set_value(const std::string& s) {
377 }
378
379};
380
387class CharAttribute : public Attribute {
388public:
389
391 CharAttribute():Attribute(),m_val(0) {}
392
394 CharAttribute(char val):Attribute(),m_val(val) {}
395
397 bool from_string(const std::string &att) override {
398 set_is_parsed(true);
399 if (att.size())
400 {
401 m_val = att.at(0);
402 return true;
403 }
404 return false;
405 }
406
408 bool to_string(std::string &att) const override {
409 att = std::to_string(m_val);
410 return true;
411 }
412
414 char value() const {
415 return m_val;
416 }
417
419 void set_value(const char& i) {
420 m_val = i;
421 set_is_parsed(true);
422 }
423
424private:
425 char m_val;
426};
427
435public:
436
438 LongLongAttribute(): Attribute(), m_val(0) {}
439
441 LongLongAttribute(long long val): Attribute(), m_val(val) {}
442
444 bool from_string(const std::string &att) override {
445 m_val = atoll( att.c_str() );
446 set_is_parsed(true);
447 return true;
448 }
449
451 bool to_string(std::string &att) const override {
452 att = std::to_string(m_val);
453 return true;
454 }
455
457 long long value() const {
458 return m_val;
459 }
460
462 void set_value(const long long& l) {
463 m_val = l;
464 set_is_parsed(true);
465 }
466
467private:
468
469 long long m_val;
470
471};
472
480public:
481
483 LongDoubleAttribute(): Attribute(), m_val(0.0) {}
484
486 LongDoubleAttribute(long double val): Attribute(), m_val(val) {}
487
489 bool from_string(const std::string &att) override {
490 m_val = strtold( att.c_str(),NULL);
491 set_is_parsed(true);
492 return true;
493 }
494
496 bool to_string(std::string &att) const override {
497 std::ostringstream oss;
498 oss << std::setprecision(std::numeric_limits<long double>::digits10)
499 << m_val;
500 att = oss.str();
501 return true;
502 }
503
505 long double value() const {
506 return m_val;
507 }
508
510 void set_value(const long double& d) {
511 m_val = d;
512 set_is_parsed(true);
513 }
514
515private:
516
517 long double m_val;
518};
519
520
521
528class UIntAttribute : public Attribute {
529public:
530
532 UIntAttribute():Attribute(),m_val(0) {}
533
535 UIntAttribute(unsigned int val):Attribute(),m_val(val) {}
536
538 bool from_string(const std::string &att) override {
539 m_val = strtoul(att.c_str(), NULL, 0);
540 set_is_parsed(true);
541 return true;
542 }
543
545 bool to_string(std::string &att) const override {
546 att = std::to_string(m_val);
547 return true;
548 }
549
551 unsigned int value() const {
552 return m_val;
553 }
554
556 void set_value(const unsigned int& i) {
557 m_val = i;
558 set_is_parsed(true);
559 }
560
561private:
562 unsigned int m_val;
563};
564
565
566
573class ULongAttribute : public Attribute {
574public:
575
577 ULongAttribute():Attribute(),m_val(0) {}
578
580 ULongAttribute(unsigned long val):Attribute(),m_val(val) {}
581
583 bool from_string(const std::string &att) override {
584 m_val = strtoul(att.c_str(), NULL, 0);
585 set_is_parsed(true);
586 return true;
587 }
588
590 bool to_string(std::string &att) const override {
591 att = std::to_string(m_val);
592 return true;
593 }
594
596 unsigned long value() const {
597 return m_val;
598 }
599
601 void set_value(const unsigned long& i) {
602 m_val = i;
603 set_is_parsed(true);
604 }
605
606private:
607 unsigned long m_val;
608};
609
610
618public:
619
622
624 ULongLongAttribute(unsigned long long val):Attribute(),m_val(val) {}
625
627 bool from_string(const std::string &att) override {
628 m_val = strtoull(att.c_str(), NULL, 0);
629 set_is_parsed(true);
630 return true;
631 }
632
634 bool to_string(std::string &att) const override {
635 att = std::to_string(m_val);
636 return true;
637 }
638
640 unsigned long long value() const {
641 return m_val;
642 }
643
645 void set_value(const unsigned long long& i) {
646 m_val = i;
647 set_is_parsed(true);
648 }
649
650private:
651 unsigned long long m_val;
652};
653
660class BoolAttribute : public Attribute {
661public:
662
664 BoolAttribute():Attribute(),m_val(false) {}
665
667 BoolAttribute(bool val):Attribute(),m_val(val) {}
668
670 bool from_string(const std::string &att) override {
671 if (att.size()!=1) return false;
672 if (att==std::string("1")) {m_val = true; return true;}
673 if (att==std::string("0")) {m_val = false; return true;}
674 set_is_parsed(true);
675 return false;
676 }
677
679 bool to_string(std::string &att) const override {
680 att = std::to_string(m_val);
681 return true;
682 }
683
685 bool value() const {
686 return m_val;
687 }
688
690 void set_value(const bool& i) {
691 m_val = i;
692 set_is_parsed(true);
693 }
694
695private:
696 bool m_val;
697};
698
706public:
707
710
712 VectorCharAttribute(std::vector<char> val):Attribute(),m_val(val) {}
713
715 bool from_string(const std::string &att) override {
716 char datafoo;
717 m_val.clear();
718 std::stringstream datastream(att);
719 while (datastream >> datafoo) m_val.emplace_back(datafoo);
720 set_is_parsed(true);
721 return true;
722 }
723
725 bool to_string(std::string &att) const override {
726 att.clear();
727 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
728 return true;
729 }
730
732 std::vector<char> value() const {
733 return m_val;
734
735 }
736
738 void set_value(const std::vector<char>& i) {
739 m_val = i;
740 set_is_parsed(true);
741 }
742
743private:
744 std::vector<char> m_val;
745};
746
754public:
755
758
760 VectorFloatAttribute(std::vector<float> val):Attribute(),m_val(val) {}
761
763 bool from_string(const std::string &att) override {
764 float datafoo;
765 m_val.clear();
766 std::stringstream datastream(att);
767 while (datastream >> datafoo) m_val.emplace_back(datafoo);
768 set_is_parsed(true);
769 return true;
770 }
771
773 bool to_string(std::string &att) const override {
774 att.clear();
775 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
776 return true;
777 }
778
780 std::vector<float> value() const {
781 return m_val;
782 }
783
785 void set_value(const std::vector<float>& i) {
786 m_val = i;
787 set_is_parsed(true);
788 }
789
790private:
791 std::vector<float> m_val;
792};
793
794
802public:
803
806
808 VectorLongDoubleAttribute(std::vector<long double> val):Attribute(),m_val(val) {}
809
811 bool from_string(const std::string &att) override {
812 long double datafoo;
813 m_val.clear();
814 std::stringstream datastream(att);
815 while (datastream >> datafoo) m_val.emplace_back(datafoo);
816 set_is_parsed(true);
817 return true;
818 }
819
821 bool to_string(std::string &att) const override {
822 att.clear();
823 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
824 return true;
825 }
826
828 std::vector<long double> value() const {
829 return m_val;
830 }
831
833 void set_value(const std::vector<long double>& i) {
834 m_val = i;
835 set_is_parsed(true);
836 }
837
838private:
839 std::vector<long double> m_val;
840};
841
842
843
851public:
852
855
857 VectorLongLongAttribute(std::vector<long long> val):Attribute(),m_val(val) {}
858
860 bool from_string(const std::string &att) override {
861 long long datafoo;
862 m_val.clear();
863 std::stringstream datastream(att);
864 while (datastream >> datafoo) m_val.emplace_back(datafoo);
865 set_is_parsed(true);
866 return true;
867 }
868
870 bool to_string(std::string &att) const override {
871 att.clear();
872 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
873 return true;
874 }
875
877 std::vector<long long> value() const {
878 return m_val;
879 }
880
882 void set_value(const std::vector<long long>& i) {
883 m_val = i;
884 set_is_parsed(true);
885 }
886
887private:
888 std::vector<long long> m_val;
889};
890
898public:
899
902
904 VectorUIntAttribute(std::vector<unsigned int> val):Attribute(),m_val(val) {}
905
907 bool from_string(const std::string &att) override {
908 unsigned int datafoo;
909 m_val.clear();
910 std::stringstream datastream(att);
911 while (datastream >> datafoo) m_val.emplace_back(datafoo);
912 set_is_parsed(true);
913 return true;
914 }
915
917 bool to_string(std::string &att) const override {
918 att.clear();
919 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
920 return true;
921 }
922
924 std::vector<unsigned int> value() const {
925 return m_val;
926 }
927
929 void set_value(const std::vector<unsigned int>& i) {
930 m_val = i;
931 set_is_parsed(true);
932 }
933
934private:
935 std::vector<unsigned int> m_val;
936};
937
945public:
946
949
951 VectorULongAttribute(std::vector<unsigned long> val):Attribute(),m_val(val) {}
952
954 bool from_string(const std::string &att) override {
955 unsigned long datafoo;
956 m_val.clear();
957 std::stringstream datastream(att);
958 while (datastream >> datafoo) m_val.emplace_back(datafoo);
959 set_is_parsed(true);
960 return true;
961 }
962
964 bool to_string(std::string &att) const override {
965 att.clear();
966 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
967 return true;
968 }
969
971 std::vector<unsigned long> value() const {
972 return m_val;
973 }
974
976 void set_value(const std::vector<unsigned long>& i) {
977 m_val = i;
978 set_is_parsed(true);
979 }
980
981private:
982 std::vector<unsigned long> m_val;
983};
984
985
993public:
994
997
999 VectorULongLongAttribute(std::vector<unsigned long long> val):Attribute(),m_val(val) {}
1000
1002 bool from_string(const std::string &att) override {
1003 unsigned long long datafoo;
1004 m_val.clear();
1005 std::stringstream datastream(att);
1006 while (datastream >> datafoo) m_val.emplace_back(datafoo);
1007 set_is_parsed(true);
1008 return true;
1009 }
1010
1012 bool to_string(std::string &att) const override {
1013 att.clear();
1014 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
1015 return true;
1016 }
1017
1019 std::vector<unsigned long long> value() const {
1020 return m_val;
1021 }
1022
1024 void set_value(const std::vector<unsigned long long>& i) {
1025 m_val = i;
1026 set_is_parsed(true);
1027 }
1028
1029private:
1030 std::vector<unsigned long long> m_val;
1031};
1032
1040public:
1041
1044
1046 VectorIntAttribute(std::vector<int> val):Attribute(),m_val(val) {}
1047
1049 bool from_string(const std::string &att) override {
1050 int datafoo;
1051 m_val.clear();
1052 std::stringstream datastream(att);
1053 while (datastream >> datafoo) m_val.emplace_back(datafoo);
1054 set_is_parsed(true);
1055 return true;
1056 }
1057
1059 bool to_string(std::string &att) const override {
1060 att.clear();
1061 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
1062 return true;
1063 }
1064
1066 std::vector<int> value() const {
1067 return m_val;
1068
1069 }
1070
1072 void set_value(const std::vector<int>& i) {
1073 m_val = i;
1074 set_is_parsed(true);
1075 }
1076
1077private:
1078 std::vector<int> m_val;
1079};
1080
1088public:
1089
1092
1094 VectorLongIntAttribute(std::vector<long int> val):Attribute(),m_val(val) {}
1095
1097 bool from_string(const std::string &att) override {
1098 long int datafoo;
1099 m_val.clear();
1100 std::stringstream datastream(att);
1101 while (datastream >> datafoo) m_val.emplace_back(datafoo);
1102 set_is_parsed(true);
1103 return true;
1104 }
1105
1107 bool to_string(std::string &att) const override {
1108 att.clear();
1109 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
1110 return true;
1111 }
1112
1114 std::vector<long int> value() const {
1115 return m_val;
1116 }
1117
1119 void set_value(const std::vector<long int>& i) {
1120 m_val = i;
1121 set_is_parsed(true);
1122 }
1123
1124private:
1125 std::vector<long int> m_val;
1126};
1127
1135public:
1136
1139
1141 VectorDoubleAttribute(std::vector<double> val):Attribute(),m_val(val) {}
1142
1144 bool from_string(const std::string &att) override {
1145 double datafoo;
1146 m_val.clear();
1147 std::stringstream datastream(att);
1148 while (datastream >> datafoo) m_val.emplace_back(datafoo);
1149 set_is_parsed(true);
1150 return true;
1151 }
1152
1154 bool to_string(std::string &att) const override {
1155 att.clear();
1156 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
1157 return true;
1158 }
1159
1161 std::vector<double> value() const {
1162 return m_val;
1163 }
1164
1166 void set_value(const std::vector<double>& i) {
1167 m_val = i;
1168 set_is_parsed(true);
1169 }
1170
1171private:
1172 std::vector<double> m_val;
1173};
1174
1175
1183public:
1184
1187
1189 VectorStringAttribute(std::vector<std::string> val):Attribute(),m_val(val) {}
1190
1192 bool from_string(const string &att) override {
1193 size_t posb = att.find_first_not_of(' ');
1194 do {
1195 size_t pose = att.find_first_of(' ', posb);
1196 m_val.push_back(att.substr(posb, pose - posb));
1197 posb = att.find_first_not_of(' ', pose);
1198 } while (posb != std::string::npos);
1199 set_is_parsed(true);
1200 return true;
1201 }
1202
1204 bool to_string(std::string &att) const override {
1205 att.clear();
1206 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=a;}
1207 return true;
1208 }
1209
1211 std::vector<std::string> value() const {
1212 return m_val;
1213 }
1214
1216 void set_value(const std::vector<std::string>& i) {
1217 m_val = i;
1218 set_is_parsed(true);
1219 }
1220
1221private:
1222 std::vector<std::string> m_val;
1223};
1224
1225
1226} // namespace HepMC3
1227
1228#endif
virtual ~Attribute()
Virtual destructor.
Definition Attribute.h:54
virtual bool from_string(const std::string &att)=0
Fill class content from string.
void set_is_parsed(bool flag)
Set is_parsed flag.
Definition Attribute.h:134
const std::string & unparsed_string() const
Get unparsed string.
Definition Attribute.h:105
bool is_parsed() const
Check if this attribute is parsed.
Definition Attribute.h:102
GenParticlePtr particle()
Definition Attribute.h:113
void set_unparsed_string(const std::string &st)
Set unparsed string.
Definition Attribute.h:137
virtual bool init()
Optionally initialize the attribute after from_string.
Definition Attribute.h:81
virtual bool to_string(std::string &att) const =0
Fill string from class content.
ConstGenParticlePtr particle() const
Definition Attribute.h:118
GenVertexPtr vertex()
Definition Attribute.h:123
const GenEvent * event() const
Definition Attribute.h:108
virtual bool init(const GenRunInfo &)
Optionally initialize the attribute after from_string.
Definition Attribute.h:90
ConstGenVertexPtr vertex() const
Definition Attribute.h:128
friend class GenEvent
GenEvent is a friend.
Definition Attribute.h:69
Attribute(const std::string &st)
Protected constructor that allows to set string.
Definition Attribute.h:66
Attribute()
Default constructor.
Definition Attribute.h:51
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:670
bool value() const
get the value associated to this Attribute.
Definition Attribute.h:685
BoolAttribute()
Default constructor.
Definition Attribute.h:664
void set_value(const bool &i)
set the value associated to this Attribute.
Definition Attribute.h:690
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:679
BoolAttribute(bool val)
Constructor initializing attribute value.
Definition Attribute.h:667
void set_value(const char &i)
set the value associated to this Attribute.
Definition Attribute.h:419
CharAttribute()
Default constructor.
Definition Attribute.h:391
CharAttribute(char val)
Constructor initializing attribute value.
Definition Attribute.h:394
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:397
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:408
char value() const
get the value associated to this Attribute.
Definition Attribute.h:414
double value() const
get the value associated to this Attribute.
Definition Attribute.h:271
DoubleAttribute()
Default constructor.
Definition Attribute.h:249
void set_value(const double &d)
set the value associated to this Attribute.
Definition Attribute.h:276
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:255
DoubleAttribute(double val)
Constructor initializing attribute value.
Definition Attribute.h:252
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:262
FloatAttribute()
Default constructor.
Definition Attribute.h:296
void set_value(const float &f)
set the value associated to this Attribute.
Definition Attribute.h:323
float value() const
get the value associated to this Attribute.
Definition Attribute.h:318
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:302
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:309
FloatAttribute(float val)
Constructor initializing attribute value.
Definition Attribute.h:299
Stores event-related information.
Definition GenEvent.h:47
Stores run-related information.
Definition GenRunInfo.h:33
int value() const
get the value associated to this Attribute.
Definition Attribute.h:180
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:167
IntAttribute(int val)
Constructor initializing attribute value.
Definition Attribute.h:164
void set_value(const int &i)
set the value associated to this Attribute.
Definition Attribute.h:185
IntAttribute()
Default constructor.
Definition Attribute.h:161
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:174
void set_value(const long &l)
set the value associated to this Attribute.
Definition Attribute.h:228
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:210
long value() const
get the value associated to this Attribute.
Definition Attribute.h:223
LongAttribute()
Default constructor.
Definition Attribute.h:204
LongAttribute(long val)
Constructor initializing attribute value.
Definition Attribute.h:207
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:217
LongDoubleAttribute()
Default constructor.
Definition Attribute.h:483
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:489
void set_value(const long double &d)
set the value associated to this Attribute.
Definition Attribute.h:510
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:496
LongDoubleAttribute(long double val)
Constructor initializing attribute value.
Definition Attribute.h:486
long double value() const
get the value associated to this Attribute.
Definition Attribute.h:505
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:451
LongLongAttribute()
Default constructor.
Definition Attribute.h:438
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:444
LongLongAttribute(long long val)
Constructor initializing attribute value.
Definition Attribute.h:441
void set_value(const long long &l)
set the value associated to this Attribute.
Definition Attribute.h:462
long long value() const
get the value associated to this Attribute.
Definition Attribute.h:457
std::string value() const
get the value associated to this Attribute.
Definition Attribute.h:370
void set_value(const std::string &s)
set the value associated to this Attribute.
Definition Attribute.h:375
StringAttribute(const std::string &st)
String-based constructor.
Definition Attribute.h:355
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:364
StringAttribute()
Default constructor - empty string.
Definition Attribute.h:347
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:358
UIntAttribute()
Default constructor.
Definition Attribute.h:532
void set_value(const unsigned int &i)
set the value associated to this Attribute.
Definition Attribute.h:556
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:538
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:545
unsigned int value() const
get the value associated to this Attribute.
Definition Attribute.h:551
UIntAttribute(unsigned int val)
Constructor initializing attribute value.
Definition Attribute.h:535
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:583
ULongAttribute(unsigned long val)
Constructor initializing attribute value.
Definition Attribute.h:580
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:590
unsigned long value() const
get the value associated to this Attribute.
Definition Attribute.h:596
ULongAttribute()
Default constructor.
Definition Attribute.h:577
void set_value(const unsigned long &i)
set the value associated to this Attribute.
Definition Attribute.h:601
ULongLongAttribute(unsigned long long val)
Constructor initializing attribute value.
Definition Attribute.h:624
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:627
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:634
void set_value(const unsigned long long &i)
set the value associated to this Attribute.
Definition Attribute.h:645
ULongLongAttribute()
Default constructor.
Definition Attribute.h:621
unsigned long long value() const
get the value associated to this Attribute.
Definition Attribute.h:640
VectorCharAttribute(std::vector< char > val)
Constructor initializing attribute value.
Definition Attribute.h:712
void set_value(const std::vector< char > &i)
set the value associated to this Attribute.
Definition Attribute.h:738
std::vector< char > value() const
get the value associated to this Attribute.
Definition Attribute.h:732
VectorCharAttribute()
Default constructor.
Definition Attribute.h:709
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:725
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:715
VectorDoubleAttribute(std::vector< double > val)
Constructor initializing attribute value.
Definition Attribute.h:1141
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:1144
std::vector< double > value() const
get the value associated to this Attribute.
Definition Attribute.h:1161
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:1154
VectorDoubleAttribute()
Default constructor.
Definition Attribute.h:1138
void set_value(const std::vector< double > &i)
set the value associated to this Attribute.
Definition Attribute.h:1166
std::vector< float > value() const
get the value associated to this Attribute.
Definition Attribute.h:780
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:763
VectorFloatAttribute(std::vector< float > val)
Constructor initializing attribute value.
Definition Attribute.h:760
VectorFloatAttribute()
Default constructor.
Definition Attribute.h:757
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:773
void set_value(const std::vector< float > &i)
set the value associated to this Attribute.
Definition Attribute.h:785
void set_value(const std::vector< int > &i)
set the value associated to this Attribute.
Definition Attribute.h:1072
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:1059
std::vector< int > value() const
get the value associated to this Attribute.
Definition Attribute.h:1066
VectorIntAttribute(std::vector< int > val)
Constructor initializing attribute value.
Definition Attribute.h:1046
VectorIntAttribute()
Default constructor.
Definition Attribute.h:1043
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:1049
void set_value(const std::vector< long double > &i)
set the value associated to this Attribute.
Definition Attribute.h:833
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:811
std::vector< long double > value() const
get the value associated to this Attribute.
Definition Attribute.h:828
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:821
VectorLongDoubleAttribute(std::vector< long double > val)
Constructor initializing attribute value.
Definition Attribute.h:808
VectorLongDoubleAttribute()
Default constructor.
Definition Attribute.h:805
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:1097
VectorLongIntAttribute()
Default constructor.
Definition Attribute.h:1091
VectorLongIntAttribute(std::vector< long int > val)
Constructor initializing attribute value.
Definition Attribute.h:1094
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:1107
std::vector< long int > value() const
get the value associated to this Attribute.
Definition Attribute.h:1114
void set_value(const std::vector< long int > &i)
set the value associated to this Attribute.
Definition Attribute.h:1119
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:870
VectorLongLongAttribute(std::vector< long long > val)
Constructor initializing attribute value.
Definition Attribute.h:857
VectorLongLongAttribute()
Default constructor.
Definition Attribute.h:854
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:860
void set_value(const std::vector< long long > &i)
set the value associated to this Attribute.
Definition Attribute.h:882
std::vector< long long > value() const
get the value associated to this Attribute.
Definition Attribute.h:877
VectorStringAttribute(std::vector< std::string > val)
Constructor initializing attribute value.
Definition Attribute.h:1189
bool from_string(const string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:1192
std::vector< std::string > value() const
get the value associated to this Attribute.
Definition Attribute.h:1211
VectorStringAttribute()
Default constructor.
Definition Attribute.h:1186
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:1204
void set_value(const std::vector< std::string > &i)
set the value associated to this Attribute.
Definition Attribute.h:1216
VectorUIntAttribute()
Default constructor.
Definition Attribute.h:901
void set_value(const std::vector< unsigned int > &i)
set the value associated to this Attribute.
Definition Attribute.h:929
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:917
VectorUIntAttribute(std::vector< unsigned int > val)
Constructor initializing attribute value.
Definition Attribute.h:904
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:907
std::vector< unsigned int > value() const
get the value associated to this Attribute.
Definition Attribute.h:924
VectorULongAttribute()
Default constructor.
Definition Attribute.h:948
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:964
void set_value(const std::vector< unsigned long > &i)
set the value associated to this Attribute.
Definition Attribute.h:976
VectorULongAttribute(std::vector< unsigned long > val)
Constructor initializing attribute value.
Definition Attribute.h:951
std::vector< unsigned long > value() const
get the value associated to this Attribute.
Definition Attribute.h:971
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:954
void set_value(const std::vector< unsigned long long > &i)
set the value associated to this Attribute.
Definition Attribute.h:1024
VectorULongLongAttribute(std::vector< unsigned long long > val)
Constructor initializing attribute value.
Definition Attribute.h:999
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition Attribute.h:1002
std::vector< unsigned long long > value() const
get the value associated to this Attribute.
Definition Attribute.h:1019
VectorULongLongAttribute()
Default constructor.
Definition Attribute.h:996
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition Attribute.h:1012