Go to the documentation of this file. 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"
47 unsigned int id(
void)
const {
return id_; }
50 operator unsigned int(
void)
const {
return id_; }
60 const std::vector<std::string>&
strings()
const {
return vecPair_->second.first; }
63 const std::vector<double>&
doubles()
const;
110 using Names = tbb::concurrent_vector<StringHolder, tbb::zero_allocator<StringHolder>>;
118 using vecpair_type = std::pair<bool, std::pair<std::vector<std::string>, std::vector<double>>>;
124 #endif // DetectorDescription_Core_DDValue_h
void init(const std::string &)
StringHolder & operator=(const StringHolder &)=delete
bool operator==(const DDValue &v) const
Two DDValues are equal only if their id() is equal AND their values are equal.
std::ostream & operator<<(std::ostream &o, const DDValue &v)
DDValuePair operator[](unsigned int i) const
DDValue(void)
create a unnamed emtpy value. One can assing a named DDValue to it.
std::atomic< unsigned int > value_
static NamesToIndicies & indexer()
tbb::concurrent_vector< StringHolder, tbb::zero_allocator< StringHolder > > Names
bool isEvaluated(void) const
true, if values are numerical evaluated; else false.
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))
tbb::concurrent_unordered_map< std::string, AtomicUInt > NamesToIndicies
unsigned int size() const
the size of the stored value-pairs (std::string,double)
static Names initializeNames()
StringHolder(std::string iString)
AtomicUInt & operator=(const AtomicUInt &iOther)
AtomicUInt(const AtomicUInt &iOther)
std::pair< bool, std::pair< std::vector< std::string >, std::vector< double > >> vecpair_type
void setEvalState(bool newState)
set to true, if the double-values (method DDValue::doubles()) make sense
std::shared_ptr< vecpair_type > vecPair_
unsigned int id(void) const
returns the ID of the DDValue
StringHolder(StringHolder const &iOther)
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
std::atomic< std::string * > string_
AtomicUInt(unsigned int iValue)
const std::string & name(void) const
the name of the DDValue
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue