LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
UTIL::BitSet32 Class Reference

Convenient helper class for setting single bits in a 32bit-field, such as collection flags or hit types - extends std::bitset<32>. More...

#include <BitSet32.h>

+ Inheritance diagram for UTIL::BitSet32:

Public Member Functions

 BitSet32 (int val)
 Allow to construct this from an int. More...
 
BitSet32operator= (int val)
 Allow assignment from an int. More...
 
 operator int ()
 Direct conversion to int. More...
 
- Public Member Functions inherited from std::bitset< 32 >
all (T...args)
 
any (T...args)
 
bitset (T...args)
 
count (T...args)
 
flip (T...args)
 
none (T...args)
 
operator!= (T...args)
 
operator&= (T...args)
 
operator<< (T...args)
 
operator<<= (T...args)
 
operator== (T...args)
 
operator>> (T...args)
 
operator>>= (T...args)
 
operator[] (T...args)
 
operator^= (T...args)
 
operator|= (T...args)
 
operator~ (T...args)
 
reset (T...args)
 
set (T...args)
 
size (T...args)
 
test (T...args)
 
to_string (T...args)
 
to_ullong (T...args)
 
to_ulong (T...args)
 

Detailed Description

Convenient helper class for setting single bits in a 32bit-field, such as collection flags or hit types - extends std::bitset<32>.

Use convenient methods make_bitset32(...) to create a bit set with some bits set.
Examples:

  // set collection flags :
  LCCollectionVec* calVec = new LCCollectionVec( LCIO::SIMCALORIMETERHIT )  ;
  calVec->setFlag( UTIL::make_bitset32(  LCIO::CHBIT_LONG, LCIO::CHBIT_STEP ) );
  // check TrackerHit type:
  BitSet32 type( hit->getType() ) ;
  bool isComposite = type.test( ILDTrkHitTypeBit::COMPOSITE_SPACEPOINT ) ; // test w/ range check
  // or shorter:
  if( BitSet32( hit->getType() )[ ILDTrkHitTypeBit::COMPOSITE_SPACEPOINT ] ) {...}
 

Definition at line 31 of file BitSet32.h.

Constructor & Destructor Documentation

UTIL::BitSet32::BitSet32 ( int  val)
inline

Allow to construct this from an int.

Definition at line 35 of file BitSet32.h.

Member Function Documentation

UTIL::BitSet32::operator int ( )
inline

Direct conversion to int.

Definition at line 44 of file BitSet32.h.

References std::bitset< 32 >::to_ulong().

BitSet32& UTIL::BitSet32::operator= ( int  val)
inline

Allow assignment from an int.

Definition at line 38 of file BitSet32.h.


The documentation for this class was generated from the following file: