1 #ifndef DetectorDescription_Core_DDValue_h
2 #define DetectorDescription_Core_DDValue_h
12 #include "tbb/concurrent_unordered_map.h"
13 #include "tbb/concurrent_vector.h"
48 unsigned int id(
void)
const {
return id_; }
51 operator unsigned int(
void)
const {
return id_; }
61 const std::vector<std::string>&
strings()
const {
return vecPair_->second.first; }
64 const std::vector<double>&
doubles()
const;
102 value_ = iOther.
value_.load();
111 using Names = tbb::concurrent_vector<StringHolder, edm::zero_allocator<StringHolder>>;
119 using vecpair_type = std::pair<bool, std::pair<std::vector<std::string>, std::vector<double>>>;
125 #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
tbb::concurrent_vector< StringHolder, edm::zero_allocator< StringHolder >> Names
StringHolder(StringHolder const &iOther)
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.
tbb::concurrent_unordered_map< std::string, AtomicUInt > NamesToIndicies
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.
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