PandaRoot
mrftools Namespace Reference

Helper functions for single bit manipulations. More...

Functions

bool getIntBit (const UInt_t &position, const UInt_t &value)
 Retrieves a single bit from an integer value. More...
 
void setIntBit (const UInt_t &position, UInt_t &value, const bool &state)
 Sets a single bit in an integer value. More...
 
UInt_t shiftBy (const int &positions, const UInt_t &value)
 Shifts the bits in an integer value. More...
 
unsigned int getIteratorItemCount (const std::map< std::string, TConfItem >::const_iterator &start, const std::map< std::string, TConfItem >::const_iterator &stop)
 
unsigned int getIteratorItemCount (const std::map< std::string, std::map< std::string, TConfItem >>::const_iterator &start, const std::map< std::string, std::map< std::string, TConfItem >>::const_iterator &stop)
 
UInt_t grayToBin (UInt_t gray)
 Converts gray encoded values to bianry values. More...
 

Detailed Description

Helper functions for single bit manipulations.

Function Documentation

◆ getIntBit()

bool mrftools::getIntBit ( const UInt_t &  position,
const UInt_t &  value 
)

Retrieves a single bit from an integer value.

Parameters
positionPosition of bit to investigate.
valueValue whose bits are to be investigated.
Returns
True if the bit is set, False if the bit is not set.

◆ getIteratorItemCount() [1/2]

unsigned int mrftools::getIteratorItemCount ( const std::map< std::string, TConfItem >::const_iterator &  start,
const std::map< std::string, TConfItem >::const_iterator &  stop 
)

◆ getIteratorItemCount() [2/2]

unsigned int mrftools::getIteratorItemCount ( const std::map< std::string, std::map< std::string, TConfItem >>::const_iterator &  start,
const std::map< std::string, std::map< std::string, TConfItem >>::const_iterator &  stop 
)

◆ grayToBin()

UInt_t mrftools::grayToBin ( UInt_t  gray)

Converts gray encoded values to bianry values.

Parameters
grayGray encoded value.
Returns
The correponding binary value.

◆ setIntBit()

void mrftools::setIntBit ( const UInt_t &  position,
UInt_t &  value,
const bool &  state 
)

Sets a single bit in an integer value.

Parameters
positionThe positional index of the bit to be manipulated, 0 referring to the least significant bit.
valueThe integer value whose bits are to be manipulated.
stateTrue sets the bit, False resets the bit.

◆ shiftBy()

UInt_t mrftools::shiftBy ( const int &  positions,
const UInt_t &  value 
)

Shifts the bits in an integer value.

Parameters
positionsNumber of positions to be shifted. A positive value means shift to the MSB (left), negative means shift to the LSB (right).
valueThe integer value whose bits are to be shifted.
Returns
The original value shifted by the given number of positions.