CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes | Friends
PhysicsTools::BitSet::Manipulator Class Reference

Opaque structure for transparent write access to individual bits. More...

#include <BitSet.h>

Public Member Functions

 Manipulator (const Manipulator &orig)
 
 operator bool () const
 implicit cast to pointed-at boolean bit value More...
 
bool operator= (bool bit)
 bit assignment operator More...
 
 ~Manipulator ()
 

Protected Member Functions

 Manipulator (Word_t *word, unsigned int bit)
 

Private Attributes

Word_t mask
 
Word_tword
 

Friends

class BitSet
 

Detailed Description

Opaque structure for transparent write access to individual bits.

This structure is used transparently on the left side of an assigment operator when writing a boolean value to an individual bit, i.e. represents some sort of bit reference type.

Definition at line 46 of file BitSet.h.

Constructor & Destructor Documentation

PhysicsTools::BitSet::Manipulator::Manipulator ( const Manipulator orig)
inline

Definition at line 48 of file BitSet.h.

Referenced by PhysicsTools::BitSet::operator[]().

48  :
49  word(orig.word), mask(orig.mask) {}
PhysicsTools::BitSet::Manipulator::~Manipulator ( )
inline

Definition at line 50 of file BitSet.h.

50 {}
PhysicsTools::BitSet::Manipulator::Manipulator ( Word_t word,
unsigned int  bit 
)
inlineprotected

Definition at line 62 of file BitSet.h.

62  :
63  word(word), mask((Word_t)1 << bit) {}
unsigned int Word_t
Definition: BitSet.h:34

Member Function Documentation

PhysicsTools::BitSet::Manipulator::operator bool ( ) const
inline

implicit cast to pointed-at boolean bit value

Definition at line 53 of file BitSet.h.

References mask, and word.

bool PhysicsTools::BitSet::Manipulator::operator= ( bool  bit)
inline

bit assignment operator

Definition at line 56 of file BitSet.h.

References mask, and word.

57  { *word = (*word & ~mask) | (bit ? mask : 0); return bit; }

Friends And Related Function Documentation

friend class BitSet
friend

Definition at line 60 of file BitSet.h.

Member Data Documentation

Word_t PhysicsTools::BitSet::Manipulator::mask
private

Definition at line 67 of file BitSet.h.

Referenced by operator bool(), and operator=().

Word_t* PhysicsTools::BitSet::Manipulator::word
private

Definition at line 66 of file BitSet.h.

Referenced by operator bool(), PhysicsTools::BitSet::Iterator::operator++(), and operator=().