Helper class for BitFieldCoder that corresponds to one field value.
More...
#include <BitFieldCoder.h>
Helper class for BitFieldCoder that corresponds to one field value.
Definition at line 49 of file BitFieldCoder.h.
gar::geo::BitFieldValue::BitFieldValue |
( |
| ) |
|
|
default |
gar::geo::BitFieldValue::BitFieldValue |
( |
const std::string & |
name, |
|
|
unsigned |
offset, |
|
|
int |
signedWidth |
|
) |
| |
The standard c'tor.
- Parameters
-
name | name of the field |
offset | offset of field |
signedWidth | width of field, negative if field is signed |
Definition at line 10 of file BitFieldCoder.cxx.
17 s <<
" BitFieldValue '" <<
_name <<
"': out of range - offset : " 20 throw( std::runtime_error( s.str() ) ) ;
30 _maxVal = ( 1LL << ( _width - 1 ) ) - 1 ;
gar::geo::BitFieldValue::~BitFieldValue |
( |
| ) |
|
|
default |
bool gar::geo::BitFieldValue::isSigned |
( |
| ) |
const |
|
inline |
True if field is interpreted as signed
Definition at line 87 of file BitFieldCoder.h.
ulong64 gar::geo::BitFieldValue::mask |
( |
| ) |
const |
|
inline |
int gar::geo::BitFieldValue::maxValue |
( |
| ) |
const |
|
inline |
int gar::geo::BitFieldValue::minValue |
( |
| ) |
const |
|
inline |
const std::string& gar::geo::BitFieldValue::name |
( |
| ) |
const |
|
inline |
unsigned gar::geo::BitFieldValue::offset |
( |
| ) |
const |
|
inline |
void gar::geo::BitFieldValue::set |
( |
long64 & |
bitfield, |
|
|
long64 |
value |
|
) |
| const |
Definition at line 59 of file BitFieldCoder.cxx.
62 if( in < _minVal || in >
_maxVal ) {
65 s <<
" BitFieldValue '" <<
_name <<
"': out of range : " << in
66 <<
" for width " <<
_width ;
68 throw( std::runtime_error( s.str() ) );
long64 gar::geo::BitFieldValue::value |
( |
long64 |
bitfield | ) |
const |
calculate this field's value given an external 64 bit bitmap
Definition at line 39 of file BitFieldCoder.cxx.
44 if( ( val & ( 1LL << (
_width - 1 ) ) ) != 0 )
unsigned gar::geo::BitFieldValue::width |
( |
| ) |
const |
|
inline |
bool gar::geo::BitFieldValue::_isSigned {} |
|
protected |
ulong64 gar::geo::BitFieldValue::_mask {} |
|
protected |
int gar::geo::BitFieldValue::_maxVal {} |
|
protected |
int gar::geo::BitFieldValue::_minVal {} |
|
protected |
unsigned gar::geo::BitFieldValue::_offset {} |
|
protected |
unsigned gar::geo::BitFieldValue::_width {} |
|
protected |
The documentation for this class was generated from the following files: