Auxiliary data structure for single bit.  
 More...
#include <JDAQ.hh>
 | 
|   | JBit () | 
|   | Default constructor.  More...
  | 
|   | 
|   | JBit (int __bit) | 
|   | Constructor.  More...
  | 
|   | 
| int  | get () const | 
|   | Get bit mask.  More...
  | 
|   | 
| void  | set (int &mask) const | 
|   | Set bit in given bit mask.  More...
  | 
|   | 
| void  | unset (int &mask) const | 
|   | Unset bit in given bit mask.  More...
  | 
|   | 
| void  | set (int &mask, const bool value) const | 
|   | Set bit in given bit mask.  More...
  | 
|   | 
| int  | write (const int value) const | 
|   | Write given value as bit mask.  More...
  | 
|   | 
| int  | read (const int mask) const | 
|   | Read given bit mask as value.  More...
  | 
|   | 
| bool  | has (const int mask) const | 
|   | Test bit.  More...
  | 
|   | 
Auxiliary data structure for single bit. 
Definition at line 36 of file JDAQ.hh.
 
◆ JBit() [1/2]
  
  
      
        
          | KM3NETDAQ::JBit::JBit  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Default constructor. 
Definition at line 40 of file JDAQ.hh.
 
 
◆ JBit() [2/2]
  
  
      
        
          | KM3NETDAQ::JBit::JBit  | 
          ( | 
          int  | 
          __bit | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
  
 
Definition at line 50 of file JDAQ.hh.
   53       if (bit < 0 || bit > 31) {
 
   54         throw JDAQException(
"JBit: illegal bit range.");
 
 
 
 
◆ get()
  
  
      
        
          | int KM3NETDAQ::JBit::get  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get bit mask. 
In the returned mask, the single bit at bit set to 1.
- Returns
 - bit mask 
 
Definition at line 66 of file JDAQ.hh.
 
 
◆ set() [1/2]
  
  
      
        
          | void KM3NETDAQ::JBit::set  | 
          ( | 
          int &  | 
          mask | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Set bit in given bit mask. 
- Parameters
 - 
  
  
 
Definition at line 77 of file JDAQ.hh.
int get() const
Get bit mask.
 
 
 
 
◆ unset()
  
  
      
        
          | void KM3NETDAQ::JBit::unset  | 
          ( | 
          int &  | 
          mask | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Unset bit in given bit mask. 
- Parameters
 - 
  
  
 
Definition at line 88 of file JDAQ.hh.
 
 
◆ set() [2/2]
  
  
      
        
          | void KM3NETDAQ::JBit::set  | 
          ( | 
          int &  | 
          mask,  | 
         
        
           | 
           | 
          const bool  | 
          value  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inline   | 
  
 
Set bit in given bit mask. 
- Parameters
 - 
  
    | mask | bit mask (I/0)  | 
    | value | bit status  | 
  
   
Definition at line 100 of file JDAQ.hh.
void unset(int &mask) const
Unset bit in given bit mask.
 
void set(int &mask) const
Set bit in given bit mask.
 
 
 
 
◆ write()
  
  
      
        
          | int KM3NETDAQ::JBit::write  | 
          ( | 
          const int  | 
          value | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Write given value as bit mask. 
- Parameters
 - 
  
  
 
- Returns
 - bit mask 
 
Definition at line 115 of file JDAQ.hh.
  117       return (value << 
bit) & 
get();
 
 
 
 
◆ read()
  
  
      
        
          | int KM3NETDAQ::JBit::read  | 
          ( | 
          const int  | 
          mask | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Read given bit mask as value. 
- Parameters
 - 
  
  
 
- Returns
 - value 
 
Definition at line 127 of file JDAQ.hh.
  129       return (mask & 
get()) >> 
bit;
 
 
 
 
◆ has()
  
  
      
        
          | bool KM3NETDAQ::JBit::has  | 
          ( | 
          const int  | 
          mask | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Test bit. 
- Parameters
 - 
  
  
 
- Returns
 - true if bit set; else false 
 
Definition at line 139 of file JDAQ.hh.
  141       return (mask & 
get()) != 0;
 
 
 
 
◆ bit
The documentation for this struct was generated from the following file: