![]() |
PandaRoot
|
Base interface class for data storage and manipulation. Compatible with IO classes from MRF Suite. More...
#include <mrfdata_8b.h>
Public Member Functions | |
TMrfData_8b () | |
TMrfData_8b (UInt_t _reglengthbits, UInt_t _reglengthwords, UInt_t _lastreglengthbits, std::vector< UChar_t > _regdata) | |
void | setNumBits (const UInt_t &length) |
Sets the length of the binary data stream. More... | |
const UInt_t & | getNumBits () const |
Retrieves the length of the register in bits. More... | |
void | setNumWords (const UInt_t &length) |
Sets the length of the register to lengths words. More... | |
const UInt_t & | getNumWords () const |
Retrieves the length of the register in words. More... | |
void | setBit (const UInt_t &position, const bool &state) |
Sets or resets the bit at position. More... | |
bool | getBit (const UInt_t &position) const |
Determines if bit at position is set. More... | |
const UInt_t & | appendBit (const bool &state) |
Appends a bit to the data stream. More... | |
void | setWord (const UInt_t &position, const UChar_t &dataword, const bool &truncate_ok=false) |
Sets a complete data word at position to value. More... | |
void | setWordMasked (const UInt_t &position, const UChar_t &dataword, const UChar_t &mask=~0, const bool &truncate_ok=false) |
Sets a subset of bits in a word based on a mask. More... | |
const UChar_t & | getWord (const UInt_t &position) const |
Retrieves the word found at position. More... | |
const UChar_t & | appendWord (const UChar_t &dataword) |
void | setBitBlock (const UInt_t &position, const UInt_t &length, const UChar_t &value, const UInt_t &offset=0, const bool &reverse=false) |
Sets a bit block of given length to the least significant bits of value. More... | |
const UInt_t & | getBitBlock (const UInt_t &position, const UInt_t &length, const UInt_t &offset=0, const bool &reverse=false) const |
UInt_t | bitInBlock (const UInt_t &position) const |
Returns the word index which holds bit position. More... | |
void | clearDataStream () |
Sets a bitfield within the data storage based on the configuration stored in the map parameter bitmap. More... | |
bool | sameDataStream (const TMrfData_8b &other) const |
Checks data streams for equality. More... | |
void | importBinString (const std::string &data, const UInt_t &offset=0) |
Imports a data stream from a string representing binary digits. More... | |
const std::string & | exportBinString () const |
Exports a data stream to a string representing binary digits. More... | |
void | resample (const UInt_t &offset, const UInt_t &factor, const bool &reverse=false, const UInt_t &cutoff=0) |
Extracts binary data from returned oversampled data. More... | |
const UInt_t & | getLastError () const |
Returns an integer with errorflags of all errors occured after last successful command. More... | |
bool | lastActionSuccessful () const |
Returns True if the last action completed successfullly, False otherwise. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
TMrfData_8b () | |
TMrfData_8b (UInt_t _reglengthbits, UInt_t _reglengthwords, UInt_t _lastreglengthbits, std::vector< UChar_t > _regdata) | |
void | setNumBits (const UInt_t &length) |
Sets the length of the binary data stream. More... | |
const UInt_t & | getNumBits () const |
Retrieves the length of the register in bits. More... | |
void | setNumWords (const UInt_t &length) |
Sets the length of the register to lengths words. More... | |
const UInt_t & | getNumWords () const |
Retrieves the length of the register in words. More... | |
void | setBit (const UInt_t &position, const bool &state) |
Sets or resets the bit at position. More... | |
bool | getBit (const UInt_t &position) const |
Determines if bit at position is set. More... | |
const UInt_t & | appendBit (const bool &state) |
Appends a bit to the data stream. More... | |
void | setWord (const UInt_t &position, const UChar_t &dataword, const bool &truncate_ok=false) |
Sets a complete data word at position to value. More... | |
void | setWordMasked (const UInt_t &position, const UChar_t &dataword, const UChar_t &mask=~0, const bool &truncate_ok=false) |
Sets a subset of bits in a word based on a mask. More... | |
const UChar_t & | getWord (const UInt_t &position) const |
Retrieves the word found at position. More... | |
const UChar_t & | appendWord (const UChar_t &dataword) |
void | setBitBlock (const UInt_t &position, const UInt_t &length, const UChar_t &value, const UInt_t &offset=0, const bool &reverse=false) |
Sets a bit block of given length to the least significant bits of value. More... | |
const UInt_t & | getBitBlock (const UInt_t &position, const UInt_t &length, const UInt_t &offset=0, const bool &reverse=false) const |
UInt_t | bitInBlock (const UInt_t &position) const |
Returns the word index which holds bit position. More... | |
void | clearDataStream () |
Sets a bitfield within the data storage based on the configuration stored in the map parameter bitmap. More... | |
bool | sameDataStream (const TMrfData_8b &other) const |
Checks data streams for equality. More... | |
void | importBinString (const std::string &data, const UInt_t &offset=0) |
Imports a data stream from a string representing binary digits. More... | |
const std::string & | exportBinString () const |
Exports a data stream to a string representing binary digits. More... | |
void | resample (const UInt_t &offset, const UInt_t &factor, const bool &reverse=false, const UInt_t &cutoff=0) |
Extracts binary data from returned oversampled data. More... | |
const UInt_t & | getLastError () const |
Returns an integer with errorflags of all errors occured after last successful command. More... | |
bool | lastActionSuccessful () const |
Returns True if the last action completed successfullly, False otherwise. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Public Attributes | |
UInt_t | reglengthbits |
UInt_t | reglengthwords |
UInt_t | lastreglengthbits |
UInt_t | _bitblock |
std::string | _data |
UInt_t | errcode |
Internal error code. More... | |
std::vector< UChar_t > | regdata |
Internal storage for data structure. More... | |
Static Public Attributes | |
static const UInt_t | zeroval = 0 |
static const UInt_t | bitsinablock = sizeof(UChar_t) * CHAR_BIT |
Number of bits stored in each data word. More... | |
Friends | |
class | boost::serialization::access |
Base interface class for data storage and manipulation. Compatible with IO classes from MRF Suite.
Definition at line 35 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
TMrfData_8b::TMrfData_8b | ( | ) |
TMrfData_8b::TMrfData_8b | ( | UInt_t | _reglengthbits, |
UInt_t | _reglengthwords, | ||
UInt_t | _lastreglengthbits, | ||
std::vector< UChar_t > | _regdata | ||
) |
TMrfData_8b::TMrfData_8b | ( | ) |
TMrfData_8b::TMrfData_8b | ( | UInt_t | _reglengthbits, |
UInt_t | _reglengthwords, | ||
UInt_t | _lastreglengthbits, | ||
std::vector< UChar_t > | _regdata | ||
) |
const UInt_t& TMrfData_8b::appendBit | ( | const bool & | state | ) |
Appends a bit to the data stream.
state | Boolean state of the bit to be set to. True sets to 1, False sets to 0. |
const UInt_t& TMrfData_8b::appendBit | ( | const bool & | state | ) |
Appends a bit to the data stream.
state | Boolean state of the bit to be set to. True sets to 1, False sets to 0. |
const UChar_t& TMrfData_8b::appendWord | ( | const UChar_t & | dataword | ) |
const UChar_t& TMrfData_8b::appendWord | ( | const UChar_t & | dataword | ) |
UInt_t TMrfData_8b::bitInBlock | ( | const UInt_t & | position | ) | const |
Returns the word index which holds bit position.
position | Position (unit is bits) of bit in binary data stream to be investigated. |
UInt_t TMrfData_8b::bitInBlock | ( | const UInt_t & | position | ) | const |
Returns the word index which holds bit position.
position | Position (unit is bits) of bit in binary data stream to be investigated. |
void TMrfData_8b::clearDataStream | ( | ) |
Sets a bitfield within the data storage based on the configuration stored in the map parameter bitmap.
Retrieves a bitfield from the data storage based on the configuration stored in the map parameter bitmap. Clears the data stream.
void TMrfData_8b::clearDataStream | ( | ) |
Sets a bitfield within the data storage based on the configuration stored in the map parameter bitmap.
Retrieves a bitfield from the data storage based on the configuration stored in the map parameter bitmap. Clears the data stream.
const std::string& TMrfData_8b::exportBinString | ( | ) | const |
Exports a data stream to a string representing binary digits.
const std::string& TMrfData_8b::exportBinString | ( | ) | const |
Exports a data stream to a string representing binary digits.
bool TMrfData_8b::getBit | ( | const UInt_t & | position | ) | const |
Determines if bit at position is set.
position | Position (unit is bits) of bit in binary data stream to be investigated. |
bool TMrfData_8b::getBit | ( | const UInt_t & | position | ) | const |
Determines if bit at position is set.
position | Position (unit is bits) of bit in binary data stream to be investigated. |
const UInt_t& TMrfData_8b::getBitBlock | ( | const UInt_t & | position, |
const UInt_t & | length, | ||
const UInt_t & | offset = 0 , |
||
const bool & | reverse = false |
||
) | const |
const UInt_t& TMrfData_8b::getBitBlock | ( | const UInt_t & | position, |
const UInt_t & | length, | ||
const UInt_t & | offset = 0 , |
||
const bool & | reverse = false |
||
) | const |
const UInt_t& TMrfData_8b::getLastError | ( | ) | const |
Returns an integer with errorflags of all errors occured after last successful command.
const UInt_t& TMrfData_8b::getLastError | ( | ) | const |
Returns an integer with errorflags of all errors occured after last successful command.
const UInt_t& TMrfData_8b::getNumBits | ( | ) | const |
Retrieves the length of the register in bits.
const UInt_t& TMrfData_8b::getNumBits | ( | ) | const |
Retrieves the length of the register in bits.
const UInt_t& TMrfData_8b::getNumWords | ( | ) | const |
Retrieves the length of the register in words.
const UInt_t& TMrfData_8b::getNumWords | ( | ) | const |
Retrieves the length of the register in words.
const UChar_t& TMrfData_8b::getWord | ( | const UInt_t & | position | ) | const |
Retrieves the word found at position.
position | Position (unit is words) of data word to be investigated. |
const UChar_t& TMrfData_8b::getWord | ( | const UInt_t & | position | ) | const |
Retrieves the word found at position.
position | Position (unit is words) of data word to be investigated. |
void TMrfData_8b::importBinString | ( | const std::string & | data, |
const UInt_t & | offset = 0 |
||
) |
Imports a data stream from a string representing binary digits.
data | String consiting only of characters "0" and "1" to be imported as binary data stream. |
offset | Optional offset (unit is bits) to change the import start position in the binary data stream. |
void TMrfData_8b::importBinString | ( | const std::string & | data, |
const UInt_t & | offset = 0 |
||
) |
Imports a data stream from a string representing binary digits.
data | String consiting only of characters "0" and "1" to be imported as binary data stream. |
offset | Optional offset (unit is bits) to change the import start position in the binary data stream. |
bool TMrfData_8b::lastActionSuccessful | ( | ) | const |
Returns True if the last action completed successfullly, False otherwise.
bool TMrfData_8b::lastActionSuccessful | ( | ) | const |
Returns True if the last action completed successfullly, False otherwise.
void TMrfData_8b::resample | ( | const UInt_t & | offset, |
const UInt_t & | factor, | ||
const bool & | reverse = false , |
||
const UInt_t & | cutoff = 0 |
||
) |
Extracts binary data from returned oversampled data.
offset | Initial offset of oversampled data, after which sampling starts. |
factor | Oversampling factor. |
reverse | When set to true the order in which the bits of each data word are processed, is revesed. Default is false. |
cutoff | Optional maximum length of the resulting data stream. The default is to not cut the data stream. |
void TMrfData_8b::resample | ( | const UInt_t & | offset, |
const UInt_t & | factor, | ||
const bool & | reverse = false , |
||
const UInt_t & | cutoff = 0 |
||
) |
Extracts binary data from returned oversampled data.
offset | Initial offset of oversampled data, after which sampling starts. |
factor | Oversampling factor. |
reverse | When set to true the order in which the bits of each data word are processed, is revesed. Default is false. |
cutoff | Optional maximum length of the resulting data stream. The default is to not cut the data stream. |
bool TMrfData_8b::sameDataStream | ( | const TMrfData_8b & | other | ) | const |
Checks data streams for equality.
bool TMrfData_8b::sameDataStream | ( | const TMrfData_8b & | other | ) | const |
Checks data streams for equality.
|
inline |
Definition at line 217 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
|
inline |
Definition at line 217 of file MvdTestBeam/Tools/mrfdata_8b.h.
void TMrfData_8b::setBit | ( | const UInt_t & | position, |
const bool & | state | ||
) |
Sets or resets the bit at position.
position | Position (unit is bits) of bit in binary data stream to be manipulated. |
state | Boolean state of the bit to be set to. True sets to 1, False sets to 0. |
void TMrfData_8b::setBit | ( | const UInt_t & | position, |
const bool & | state | ||
) |
Sets or resets the bit at position.
position | Position (unit is bits) of bit in binary data stream to be manipulated. |
state | Boolean state of the bit to be set to. True sets to 1, False sets to 0. |
void TMrfData_8b::setBitBlock | ( | const UInt_t & | position, |
const UInt_t & | length, | ||
const UChar_t & | value, | ||
const UInt_t & | offset = 0 , |
||
const bool & | reverse = false |
||
) |
Sets a bit block of given length to the least significant bits of value.
position | Position (unit is bits) of bit block to be set. |
length | Length (unit is bits) of the bit block to be set. |
value | Value the bit block is to be set to, least significant bits are considered first. |
offset | Optional offset of bits in value to be skipped, starting from LSB |
reverse | If True, the bit order of the value is reversed. |
void TMrfData_8b::setBitBlock | ( | const UInt_t & | position, |
const UInt_t & | length, | ||
const UChar_t & | value, | ||
const UInt_t & | offset = 0 , |
||
const bool & | reverse = false |
||
) |
Sets a bit block of given length to the least significant bits of value.
position | Position (unit is bits) of bit block to be set. |
length | Length (unit is bits) of the bit block to be set. |
value | Value the bit block is to be set to, least significant bits are considered first. |
offset | Optional offset of bits in value to be skipped, starting from LSB |
reverse | If True, the bit order of the value is reversed. |
void TMrfData_8b::setNumBits | ( | const UInt_t & | length | ) |
Sets the length of the binary data stream.
length | Length (in bits) of the binary data stream to be set. |
void TMrfData_8b::setNumBits | ( | const UInt_t & | length | ) |
Sets the length of the binary data stream.
length | Length (in bits) of the binary data stream to be set. |
void TMrfData_8b::setNumWords | ( | const UInt_t & | length | ) |
Sets the length of the register to lengths words.
length | Length (in data words) of the binary data stream to be set. |
void TMrfData_8b::setNumWords | ( | const UInt_t & | length | ) |
Sets the length of the register to lengths words.
length | Length (in data words) of the binary data stream to be set. |
void TMrfData_8b::setWord | ( | const UInt_t & | position, |
const UChar_t & | dataword, | ||
const bool & | truncate_ok = false |
||
) |
Sets a complete data word at position to value.
position | Position (unit is words) of data word to be set. |
dataword | New value of the data word to be set. |
truncate_ok | If True, the data word is silently truncated in case it exceeds the length of the binary data stream. Otherwise, a flag in the internal error code is set. |
Error codes:
void TMrfData_8b::setWord | ( | const UInt_t & | position, |
const UChar_t & | dataword, | ||
const bool & | truncate_ok = false |
||
) |
Sets a complete data word at position to value.
position | Position (unit is words) of data word to be set. |
dataword | New value of the data word to be set. |
truncate_ok | If True, the data word is silently truncated in case it exceeds the length of the binary data stream. Otherwise, a flag in the internal error code is set. |
Error codes:
void TMrfData_8b::setWordMasked | ( | const UInt_t & | position, |
const UChar_t & | dataword, | ||
const UChar_t & | mask = ~0 , |
||
const bool & | truncate_ok = false |
||
) |
Sets a subset of bits in a word based on a mask.
position | Position (unit is words) of data word to be set. |
dataword | New value of the data word to be set. |
mask | Manipulation mask. All bits at positions set in the mask will be set/reset, all other bits will remain unchanged. |
truncate_ok | If True, the data word is silently truncated in case it exceeds the length of the binary data stream. Otherwise, a flag in the internal error code is set. |
Error codes:
void TMrfData_8b::setWordMasked | ( | const UInt_t & | position, |
const UChar_t & | dataword, | ||
const UChar_t & | mask = ~0 , |
||
const bool & | truncate_ok = false |
||
) |
Sets a subset of bits in a word based on a mask.
position | Position (unit is words) of data word to be set. |
dataword | New value of the data word to be set. |
mask | Manipulation mask. All bits at positions set in the mask will be set/reset, all other bits will remain unchanged. |
truncate_ok | If True, the data word is silently truncated in case it exceeds the length of the binary data stream. Otherwise, a flag in the internal error code is set. |
Error codes:
|
friend |
Definition at line 214 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
|
mutable |
Definition at line 209 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
|
mutable |
Definition at line 210 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
|
static |
Number of bits stored in each data word.
Definition at line 233 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
|
mutable |
Internal error code.
The internal error code is a binary OR of all error flags which were set after the last successful command, which resets the error code to 0.
Definition at line 230 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
UInt_t TMrfData_8b::lastreglengthbits |
Definition at line 207 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
std::vector< UChar_t > TMrfData_8b::regdata |
Internal storage for data structure.
Do not access directly unless you are absolutely sure you need to do this. If you are absolutely sure, think about it once again.
Definition at line 239 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
UInt_t TMrfData_8b::reglengthbits |
Definition at line 205 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
UInt_t TMrfData_8b::reglengthwords |
Definition at line 206 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.
|
static |
Definition at line 208 of file MvdOfflineTBAnalysis_Topix4/mrfdata_8b.h.