|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
12 #ifndef DDSEGMENTATION_BITFIELDCODER_H
13 #define DDSEGMENTATION_BITFIELDCODER_H 1
23 namespace DDSegmentation {
116 typedef std::map<std::string, unsigned int>
IndexMap ;
152 return ( ( low_Word & 0xffffffffULL ) | ( ( high_Word & 0xffffffffULL ) << 32 ) ) ;
157 static unsigned lowWord(
CellID bitfield) {
return unsigned( bitfield & 0xffffFFFFUL ); }
166 return _fields.at(idx).value( bitfield ) ;
178 _fields.at(idx).set( bitfield , value ) ;
196 size_t index(
const std::string& name)
const ;
218 const std::vector<BitFieldElement>&
fields()
const {
229 void addField(
const std::string& name,
unsigned offset,
int width );
234 void init(
const std::string& initString) ;
StringTokenizer(std::vector< std::string > &tokens, char del)
BitFieldCoder(BitFieldCoder &&)=default
Move constructor.
BitFieldElement(const BitFieldElement &)=default
Copy constructor.
const BitFieldElement & operator[](unsigned idx) const
Helper class for BitFieldCoder that corresponds to one field value.
BitFieldElement(BitFieldElement &&)=default
Move constructor.
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
~BitFieldCoder()=default
Default destructor.
FieldID get(CellID bitfield, size_t idx) const
Helper class for string tokenization.
static unsigned highWord(CellID bitfield)
FieldID value(CellID bitfield) const
calculate this field's value given an external 64 bit bitmap
std::map< std::string, unsigned int > IndexMap
static CellID toLong(unsigned low_Word, unsigned high_Word)
const std::vector< BitFieldElement > & fields() const
std::vector< BitFieldElement > _fields
BitFieldElement & operator=(const BitFieldElement &)=default
Assignment operator.
unsigned highestBit() const
std::string valueString(CellID bitfield) const
void addField(const std::string &name, unsigned offset, int width)
BitFieldCoder(const std::string &initString)
std::vector< std::string > & _tokens
const BitFieldElement & operator[](const std::string &name) const
void set(CellID &bitfield, FieldID value) const
BitFieldCoder & operator=(const BitFieldCoder &)=default
Assignment operator.
const std::string & name() const
static unsigned lowWord(CellID bitfield)
void set(CellID &bitfield, const std::string &name, FieldID value) const
BitFieldCoder(const BitFieldCoder &)=default
Copy constructor.
void operator()(const char &c)
void set(CellID &bitfield, size_t idx, FieldID value) const
FieldID get(CellID bitfield, const std::string &name) const
~BitFieldElement()=default
Default destructor.
size_t index(const std::string &name) const
BitFieldCoder()=default
Default constructor.
Namespace for the AIDA detector description toolkit.
void init(const std::string &initString)
std::string fieldDescription() const
BitFieldElement()=default
Default constructor.