DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
A bit field of 64bits that allows convenient declaration. More...
#include <BitField64.h>
Public Member Functions | |
virtual | ~BitField64 () |
BitField64 ()=delete | |
BitField64 (const std::string &initString) | |
BitField64 (const BitFieldCoder *coder) | |
Initialize from existing BitFieldCoder. More... | |
CellID | getValue () const |
void | setValue (CellID value) |
void | setValue (unsigned low_Word, unsigned high_Word) |
BitField64 & | operator() (CellID val) |
void | reset () |
BitFieldValue | operator[] (size_t idx) |
unsigned | highestBit () const |
size_t | size () const |
size_t | index (const std::string &name) const |
BitFieldValue | operator[] (const std::string &name) |
unsigned | lowWord () const |
unsigned | highWord () const |
std::string | fieldDescription () const |
std::string | valueString () const |
Protected Attributes | |
bool | _owner {true} |
CellID | _value {} |
const BitFieldCoder * | _coder {} |
Friends | |
std::ostream & | operator<< (std::ostream &os, const BitField64 &b) |
A bit field of 64bits that allows convenient declaration.
and manipulation of sub fields of various widths.
Example:
BitField64 b("layer:7,system:-3,barrel:3,theta:32:11,phi:11" ) ;
b[ "layer" ] = 123 ;
b[ "system" ] = -4 ;
b[ "barrel" ] = 7 ;
b[ "theta" ] = 180 ;
b[ "phi" ] = 270 ;
...
int theta = b["theta"] ;
...
unsigned phiIndex = b.index("phi") ;
int phi = b[ phiIndex ] ;
Sep-2017: FG: re-implemented as lightweight wrapper around BitFieldCoder
Definition at line 110 of file BitField64.h.
|
inlinevirtual |
Definition at line 116 of file BitField64.h.
|
delete |
No default c'tor
|
inline |
The c'tor takes an initialization string of the form:
<fieldDesc>[,<fieldDesc>...]
fieldDesc = name:[start]:[-]length
where:
name: The name of the field
start: The start bit of the field. If omitted assumed to start immediately following previous field, or at the least significant bit if the first field.
length: The number of bits in the field. If preceeded by '-' the field is signed, otherwise unsigned.
Bit numbering is from the least significant bit (bit 0) to the most significant (bit 63).
Example: "layer:7,system:-3,barrel:3,theta:32:11,phi:11"
Definition at line 138 of file BitField64.h.
|
inline |
Initialize from existing BitFieldCoder.
Definition at line 143 of file BitField64.h.
|
inline |
Return a valid description string of all fields
Definition at line 216 of file BitField64.h.
|
inline |
Returns the current 64bit value
Definition at line 149 of file BitField64.h.
|
inline |
Highest bit used in fields [0-63]
Definition at line 183 of file BitField64.h.
|
inline |
The high word, bits 32-63
Definition at line 211 of file BitField64.h.
|
inline |
Index for field named 'name'
Definition at line 190 of file BitField64.h.
|
inline |
The low word, bits 0-31
Definition at line 207 of file BitField64.h.
|
inline |
Operator for setting a new value and accessing the BitField directly
Definition at line 162 of file BitField64.h.
|
inline |
Access to field through name .
Definition at line 194 of file BitField64.h.
|
inline |
Acces to field through index
Definition at line 170 of file BitField64.h.
|
inline |
Reset - same as setValue(0) - useful if the same encoder is used for many objects.
Definition at line 166 of file BitField64.h.
|
inline |
Set a new 64bit value - bits not used in description are set to 0.
Definition at line 153 of file BitField64.h.
|
inline |
Set a new 64bit value given as high and low 32bit words.
Definition at line 157 of file BitField64.h.
|
inline |
Number of values
Definition at line 186 of file BitField64.h.
std::string dd4hep::DDSegmentation::BitField64::valueString | ( | ) | const |
Return a string with a comma separated list of the current sub field values
Definition at line 22 of file BitField64.cpp.
|
friend |
Operator for dumping BitField64 to streams
Definition at line 37 of file BitField64.cpp.
|
protected |
Definition at line 231 of file BitField64.h.
|
protected |
Definition at line 229 of file BitField64.h.
|
protected |
Definition at line 230 of file BitField64.h.