1 #ifndef DetectorDescription_Core_DDValue_h
2 #define DetectorDescription_Core_DDValue_h
9 #include "tbb/concurrent_vector.h"
10 #include "tbb/concurrent_unordered_map.h"
30 explicit DDValue(
const char * );
44 explicit DDValue(
unsigned int );
49 unsigned int id(
void )
const {
return id_; }
52 operator unsigned int(
void )
const {
return id_; }
62 const std::vector<std::string> &
strings()
const {
return vecPair_->second.first; }
65 const std::vector<double> &
doubles()
const;
69 unsigned int size()
const {
107 value_ = iOther.
value_.load();
116 using Names = tbb::concurrent_vector<StringHolder,tbb::zero_allocator<StringHolder>>;
124 using vecpair_type = std::pair<bool, std::pair<std::vector<std::string>, std::vector<double>>>;
130 #endif // DetectorDescription_Core_DDValue_h
const std::string & name(void) const
the name of the DDValue
DDValue(void)
create a unnamed emtpy value. One can assing a named DDValue to it.
AtomicUInt(const AtomicUInt &iOther)
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
StringHolder(StringHolder const &iOther)
tbb::concurrent_vector< StringHolder, tbb::zero_allocator< StringHolder >> Names
void setEvalState(bool newState)
set to true, if the double-values (method DDValue::doubles()) make sense
std::ostream & operator<<(std::ostream &out, const ALILine &li)
StringHolder(std::string iString)
unsigned int id(void) const
returns the ID of the DDValue
AtomicUInt & operator=(const AtomicUInt &iOther)
bool isEvaluated(void) const
true, if values are numerical evaluated; else false.
std::atomic< std::string * > string_
static Names initializeNames()
static NamesToIndicies & indexer()
void init(const std::string &)
AtomicUInt(unsigned int iValue)
bool operator==(const DDValue &v) const
Two DDValues are equal only if their id() is equal AND their values are equal.
tbb::concurrent_unordered_map< std::string, AtomicUInt > NamesToIndicies
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
std::shared_ptr< vecpair_type > vecPair_
StringHolder & operator=(const StringHolder &)=delete
DDValuePair operator[](unsigned int i) const
std::atomic< unsigned int > value_
bool operator<(const DDValue &) const
A DDValue a is smaller than a DDValue b if (a.id()<b.id()) OR (a.id()==b.id() and value(a)<value(b)) ...
unsigned int size() const
the size of the stored value-pairs (std::string,double)
std::pair< bool, std::pair< std::vector< std::string >, std::vector< double >>> vecpair_type