Auxiliary data structure for range of bits.  
 More...
#include <JDAQ.hh>
Auxiliary data structure for range of bits. 
Definition at line 152 of file JDAQ.hh.
 
  
  
      
        
          | KM3NETDAQ::JBits::JBits  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Default constructor. 
Definition at line 156 of file JDAQ.hh.
int msb
most significant bit 
 
int lsb
least significant bit 
 
 
 
 
  
  
      
        
          | KM3NETDAQ::JBits::JBits  | 
          ( | 
          int  | 
          __lsb,  | 
         
        
           | 
           | 
          int  | 
          __msb  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
    | __lsb | least significant bit [0, 31]  | 
    | __msb | most significant bit [lsb, 31]  | 
  
   
Definition at line 168 of file JDAQ.hh.
  172       if (lsb < 0   || lsb > 31 ||
 
  173           msb < lsb || msb > 31) {
 
  174         throw JDAQException(
"JBits: illegal bit range.");
 
int msb
most significant bit 
 
int lsb
least significant bit 
 
 
 
 
  
  
      
        
          | int KM3NETDAQ::JBits::get  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get bit mask. 
In the returned mask, the bits from lsb (included) to msb (included) are set to 1.
- Returns
 - bit mask 
 
Definition at line 186 of file JDAQ.hh.
  188       static const unsigned int mask[] = { 0x00000001,
 
int msb
most significant bit 
 
int lsb
least significant bit 
 
 
 
 
  
  
      
        
          | int KM3NETDAQ::JBits::write  | 
          ( | 
          const int  | 
          value | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Write given value as bit mask. 
- Parameters
 - 
  
  
 
- Returns
 - bit mask 
 
Definition at line 238 of file JDAQ.hh.
  240       return (value << 
lsb) & 
get();
 
int lsb
least significant bit 
 
 
 
 
  
  
      
        
          | int KM3NETDAQ::JBits::read  | 
          ( | 
          const int  | 
          mask | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Read given bit mask as value. 
- Parameters
 - 
  
  
 
- Returns
 - value 
 
Definition at line 250 of file JDAQ.hh.
  252       return (mask & 
get()) >> 
lsb;
 
int lsb
least significant bit 
 
 
 
 
  
  
      
        
          | bool KM3NETDAQ::JBits::has  | 
          ( | 
          const int  | 
          mask | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Test bit mask. 
- Parameters
 - 
  
  
 
- Returns
 - true if at least one of the bits is set; else false 
 
Definition at line 262 of file JDAQ.hh.
  264       return (
get() & mask) != 0;
 
 
 
 
      
        
          | int KM3NETDAQ::JBits::lsb | 
        
      
 
least significant bit 
Definition at line 268 of file JDAQ.hh.
 
 
      
        
          | int KM3NETDAQ::JBits::msb | 
        
      
 
most significant bit 
Definition at line 269 of file JDAQ.hh.
 
 
The documentation for this struct was generated from the following file: