library: libCore
#include "TBits.h"

TBits


class description - header file - source file - inheritance tree (.pdf)

class TBits : public TObject

Inheritance Chart:
TObject
<-
TBits

    protected:
void DoAndEqual(const TBits& rhs) void DoFlip() void DoLeftShift(UInt_t shift) void DoOrEqual(const TBits& rhs) void DoRightShift(UInt_t shift) void DoXorEqual(const TBits& rhs) void ReserveBytes(UInt_t nbytes) public:
TBits(UInt_t nbits = 8) TBits(const TBits&) TBits operator<<(UInt_t rhs) TBits operator>>(UInt_t rhs) TBits operator~() virtual ~TBits() static TClass* Class() virtual void Clear(Option_t* option = "") void Compact() UInt_t CountBits(UInt_t startBit = 0) const UInt_t FirstNullBit(UInt_t startBit = 0) const UInt_t FirstSetBit(UInt_t startBit = 0) const void Get(Char_t* array) const void Get(UChar_t* array) const void Get(Short_t* array) const void Get(UShort_t* array) const void Get(Int_t* array) const void Get(UInt_t* array) const void Get(Long64_t* array) const void Get(ULong64_t* array) const UInt_t GetNbits() const UInt_t GetNbytes() const virtual TClass* IsA() const Bool_t operator!=(const TBits& other) const TBits& operator&=(const TBits& rhs) TBits& operator<<=(UInt_t rhs) TBits& operator=(const TBits&) Bool_t operator==(const TBits& other) const TBits& operator>>=(UInt_t rhs) TBits::TReference operator[](UInt_t bitnumber) Bool_t operator[](UInt_t bitnumber) const TBits& operator^=(const TBits& rhs) TBits& operator|=(const TBits& rhs) void Output(ostream&) const virtual void Paint(Option_t* option = "") virtual void Print(Option_t* option = "") const void ResetAllBits(Bool_t value = kFALSE) void ResetBitNumber(UInt_t bitnumber) void Set(UInt_t nbits, const Char_t* array) void Set(UInt_t nbits, const UChar_t* array) void Set(UInt_t nbits, const Short_t* array) void Set(UInt_t nbits, const UShort_t* array) void Set(UInt_t nbits, const Int_t* array) void Set(UInt_t nbits, const UInt_t* array) void Set(UInt_t nbits, const Long64_t* array) void Set(UInt_t nbits, const ULong64_t* array) void SetBitNumber(UInt_t bitnumber, Bool_t value = kTRUE) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) Bool_t TestBitNumber(UInt_t bitnumber) const

Data Members


    protected:
UInt_t fNbits Number of bits (around fNbytes*8) UInt_t fNbytes Number of UChars in fAllBits UChar_t* fAllBits [fNbytes] array of UChars

Class Description

                                                                      
 TBits                                                                
                                                                      
 Container of bits                                                    
                                                                      
 This class provides a simple container of bits.                      
 Each bit can be set and tested via the functions SetBitNumber and    
 TestBitNumber.                                             .         
 The default value of all bits is kFALSE.                             
 The size of the container is automatically extended when a bit       
 number is either set or tested.  To reduce the memory size of the    
 container use the Compact function, this will discard the memory     
 occupied by the upper bits that are 0.                               
                                                                      

TBits(UInt_t nbits)
 TBits constructor.  All bits set to 0
TBits(const TBits &original)
 TBits copy constructor
TBits& operator=(const TBits& rhs)
 TBits assignment operator
~TBits()
 TBits destructor
void Compact()
 Reduce the storage used by the object to a minimun
UInt_t CountBits(UInt_t startBit)
 Return number of bits set to 1 starting at bit startBit
void DoAndEqual(const TBits& rhs)
 Execute (*this) &= rhs;
 Extra bits in rhs are ignored
 Missing bits in rhs are assumed to be zero.
void DoOrEqual(const TBits& rhs)
 Execute (*this) &= rhs;
 Extra bits in rhs are ignored
 Missing bits in rhs are assumed to be zero.
void DoXorEqual(const TBits& rhs)
 Execute (*this) ^= rhs;
 Extra bits in rhs are ignored
 Missing bits in rhs are assumed to be zero.
void DoFlip()
 Execute ~(*this)
void DoLeftShift(UInt_t shift)
 Execute the left shift operation.
void DoRightShift(UInt_t shift)
 Execute the left shift operation.
UInt_t FirstNullBit(UInt_t startBit)
 Return position of first null bit
UInt_t FirstSetBit(UInt_t startBit)
 Return position of first non null bit
void Output(ostream &os)
 Print the value to the ostream
void Paint(Option_t *)
 Once implemented, it will draw the bit field as an histogram.
 use the TVirtualPainter as the usual trick
void Print(Option_t *)
 Print the list of active bits
void ResetAllBits(Bool_t)
 Reset all bits to 0 (false).
void ReserveBytes(UInt_t nbytes)
 Reverse each bytes.
void Set(UInt_t nbits, const Char_t *array)
 Set all the bytes.
void Get(Char_t *array)
 Copy all the byes.
void Set(UInt_t nbits, const Short_t *array)
 Set all the bytes.
void Set(UInt_t nbits, const Int_t *array)
 Set all the bytes.
void Set(UInt_t nbits, const Long64_t *array)
 Set all the bytes.
void Get(Short_t *array)
 Get all the bytes.
void Get(Int_t *array)
 Get all the bytes.
void Get(Long64_t *array)
 Get all the bytes.
void Set(UInt_t nbits, const Short_t *array)
 make nbytes even so that the loop below is neat.
void Set(UInt_t nbits, const Int_t *array)
 make nbytes a multiple of 4 so that the loop below is neat.
void Set(UInt_t nbits, const Long64_t *array)
 make nbytes a multiple of 8 so that the loop below is neat.
void Get(Short_t *array)
 Get all the bytes.
void Get(Int_t *array)
 Get all the bytes.
void Get(Long64_t *array)
 Get all the bytes.
Bool_t operator==(const TBits &other)
 Copy object.




Bool_t operator~()
 Flips the bit
void ResetBitNumber(UInt_t bitnumber)
void SetBitNumber(UInt_t bitnumber, Bool_t value = kTRUE)
Bool_t TestBitNumber(UInt_t bitnumber)
TBits::TReference operator[](UInt_t bitnumber)
----- Accessors and operator
Bool_t operator[](UInt_t bitnumber)
TBits& operator&=(const TBits& rhs)
TBits& operator|=(const TBits& rhs)
TBits& operator^=(const TBits& rhs)
TBits& operator<<=(UInt_t rhs)
TBits& operator>>=(UInt_t rhs)
TBits operator<<(UInt_t rhs)
TBits operator>>(UInt_t rhs)
void Set(UInt_t nbits, const Char_t *array)
----- Optimized setters
 Each of these will replace the contents of the receiver with the bitvector
 in the parameter array.  The number of bits is changed to nbits.  If nbits
 is smaller than fNbits, the receiver will NOT be compacted.
void Get(Char_t *array)
----- Optimized getters
 Each of these will replace the contents of the parameter array with the
 bits in the receiver.  The parameter array must be large enough to hold
 all of the bits in the receiver.
 Note on semantics: any bits in the parameter array that go beyond the
 number of the bits in the receiver will have an unspecified value.  For
 example, if you call Get(Int*) with an array of one integer and the TBits
 object has less than 32 bits, then the remaining bits in the integer will
 have an unspecified value.
void Clear(Option_t *option="")
----- Utilities
UInt_t GetNbits()
UInt_t GetNbytes()
Bool_t operator!=(const TBits &other)

Author: Philippe Canal 05/02/2001
Last update: root/cont:$Name: $:$Id: TBits.cxx,v 1.20 2006/06/14 11:47:11 rdm Exp $


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.