CMS 3D CMS Logo

Classes | Public Member Functions | Static Public Member Functions | Private Attributes | Friends

DTTFBitArray< N > Class Template Reference

#include <DTTFBitArray.h>

List of all members.

Classes

class  refToBit

Public Member Functions

int any ()
void assign (const int p, const int n, const int val)
void assign (const int p, const int n, const DTTFBitArray< N > &val)
void assign (const int p, const int n, const char *str)
DTTFBitArray< 8 > byte (const int i) const
void cleanUnused ()
int count () const
unsigned & dataWord (const int i)
unsigned dataWord (const int i) const
 DTTFBitArray (const DTTFBitArray< N > &br)
 DTTFBitArray (const char *str, const int p, const int n)
 DTTFBitArray ()
 DTTFBitArray (const unsigned i)
 DTTFBitArray (const char *str)
int element (const int pos) const
DTTFBitArray< N > & flip ()
unsigned & getWord (const int pos)
unsigned getWord (const int pos) const
unsigned lastWordMask () const
int nBits () const
int none ()
int nWords () const
void one ()
bool operator!= (const DTTFBitArray< N > &a) const
DTTFBitArray< N > operator& (const DTTFBitArray< N > &a)
DTTFBitArray< N > & operator&= (const DTTFBitArray< N > &a)
DTTFBitArray< N > operator+ (const DTTFBitArray< N > &a)
DTTFBitArray< N > & operator++ (int)
DTTFBitArray< N > & operator+= (const DTTFBitArray< N > &a)
DTTFBitArray< N > operator- (const DTTFBitArray< N > &a)
DTTFBitArray< N > & operator-= (const DTTFBitArray< N > &a)
bool operator< (const DTTFBitArray< N > &a) const
DTTFBitArray< N > operator<< (const int n)
DTTFBitArray< N > & operator<<= (const int n)
bool operator<= (const DTTFBitArray< N > &a) const
DTTFBitArray< N > & operator= (const DTTFBitArray< N > &a)
DTTFBitArray< N > & operator= (const unsigned i)
DTTFBitArray< N > & operator= (const char *str)
bool operator== (const DTTFBitArray< N > &a) const
bool operator> (const DTTFBitArray< N > &a) const
bool operator>= (const DTTFBitArray< N > &a) const
DTTFBitArray< N > operator>> (const int n)
DTTFBitArray< N > & operator>>= (const int n)
refToBit operator[] (const int pos)
int operator[] (const int pos) const
DTTFBitArray< N > operator^ (const DTTFBitArray< N > &a)
DTTFBitArray< N > & operator^= (const DTTFBitArray< N > &a)
DTTFBitArray< N > operator| (const DTTFBitArray< N > &a)
DTTFBitArray< N > & operator|= (const DTTFBitArray< N > &a)
DTTFBitArray< N > operator~ () const
std::ostream & print (std::ostream &o=std::cout) const
unsigned read (const int p, const int n) const
void reset ()
void reset (const int i)
void set (const int i)
void set (const int i, const char *str)
void set (const int i, const int val)
int size () const
int test (const int i) const
DTTFBitArray< N > twoComplement () const
DTTFBitArray< N > & twoComplement ()
void unset (const int i)
int unusedBits () const
void zero ()

Static Public Member Functions

static int getPosInWord (const int pos)
static unsigned getPosMask (const int pos)

Private Attributes

unsigned _data [N/32+1]

Friends

class refToBit

Detailed Description

template<int N>
class DTTFBitArray< N >

Definition at line 30 of file DTTFBitArray.h.


Constructor & Destructor Documentation

template<int N>
DTTFBitArray< N >::DTTFBitArray ( ) [inline]

Definition at line 83 of file DTTFBitArray.h.

References DTTFBitArray< N >::zero().

{this->zero();}
template<int N>
DTTFBitArray< N >::DTTFBitArray ( const DTTFBitArray< N > &  br) [inline]

Definition at line 85 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, DTTFBitArray< N >::cleanUnused(), i, and DTTFBitArray< N >::nWords().

                                          {
    for (int i=0;i<this->nWords();i++) {
      _data[i] = br._data[i];         
    }
    this->cleanUnused();
  }
template<int N>
DTTFBitArray< N >::DTTFBitArray ( const char *  str) [inline]

Definition at line 91 of file DTTFBitArray.h.

References DTTFBitArray< N >::assign(), DTTFBitArray< N >::cleanUnused(), DTTFBitArray< N >::nBits(), and DTTFBitArray< N >::zero().

                                { 
    this->zero(); 
    this->assign(0,this->nBits(),str); 
    this->cleanUnused();
  }
template<int N>
DTTFBitArray< N >::DTTFBitArray ( const char *  str,
const int  p,
const int  n 
) [inline]

Definition at line 96 of file DTTFBitArray.h.

References DTTFBitArray< N >::assign(), and DTTFBitArray< N >::zero().

                                                          {
    this->zero(); 
    this->assign(p, n, str);
  }
template<int N>
DTTFBitArray< N >::DTTFBitArray ( const unsigned  i) [inline]

Definition at line 100 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, DTTFBitArray< N >::cleanUnused(), i, and DTTFBitArray< N >::zero().

                                 { 
    this->zero();
    _data[0] = i;                 // the nBit least sign. bits are considered
    this->cleanUnused();
  }

Member Function Documentation

template<int N>
int DTTFBitArray< N >::any ( ) [inline]

Definition at line 184 of file DTTFBitArray.h.

References DTTFBitArray< N >::dataWord(), DTTFBitArray< N >::nWords(), and DTTFBitArray< N >::unusedBits().

            {
    int nw = this->nWords();
    int ub = unusedBits();
    if(this->dataWord(nw-1)<<ub!=0)return 1;
    if(nw>1){
      for (int iw=0;iw<nw-1;iw++){
        if(this->dataWord(iw)!=0) return 1;
      }
    }
    return 0;
  }    
template<int N>
void DTTFBitArray< N >::assign ( const int  p,
const int  n,
const int  val 
) [inline]

Definition at line 239 of file DTTFBitArray.h.

References i, n, DTTFBitArray< N >::nBits(), and DTTFBitArray< N >::unset().

Referenced by DTTFBitArray< N >::DTTFBitArray(), and DTTFBitArray< N >::set().

                                                       {
    assert(p>=0 && p+n<=this->nBits());  
    // only the n least significant bits of val are considered
    for(int i=0; i<n;i++){
      if(val>>i&1) {
        this->set(p+i);
      } else {
        this->unset(p+i);
      }
    }
  }
template<int N>
void DTTFBitArray< N >::assign ( const int  p,
const int  n,
const DTTFBitArray< N > &  val 
) [inline]

Definition at line 250 of file DTTFBitArray.h.

References DTTFBitArray< N >::element(), i, n, DTTFBitArray< N >::nBits(), and DTTFBitArray< N >::unset().

                                                                    {
    assert(p>=0 && p+n<=this->nBits());  
    // only the n least significant bits of val are considered
    for(int i=0; i<n;i++){
      if(val.element(i)) {
        this->set(p+i);
      } else {
        this->unset(p+i);
      }
    }
  }
template<int N>
void DTTFBitArray< N >::assign ( const int  p,
const int  n,
const char *  str 
) [inline]

Definition at line 261 of file DTTFBitArray.h.

References i, n, DTTFBitArray< N >::nBits(), and DTTFBitArray< N >::unset().

                                                         {
    assert(p>=0 && p+n<=this->nBits());  
    // only the n least significant bits of val are considered
    for(int i=0; i<n;i++){
      assert(str[i]=='1'||str[i]=='0');  
      if(str[i]=='1') {
        this->set(p+n-i-1);   // reading a string from left to right 
      } else {                // --> most significative bit is the one 
        this->unset(p+n-i-1); // with lower string index
      }
    }
  }
template<int N>
DTTFBitArray<8> DTTFBitArray< N >::byte ( const int  i) const [inline]

Definition at line 287 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, gen::k, DTTFBitArray< N >::nWords(), and dbtoconf::out.

                                          {
    DTTFBitArray<8> out;
    if(i>=0&&i<4*this->nWords()){
      unsigned k=(_data[i/4]>>8*(i%4))&0xff;
      out=k;
    }
    return out;
  }
template<int N>
void DTTFBitArray< N >::cleanUnused ( ) [inline]
template<int N>
int DTTFBitArray< N >::count ( void  ) const [inline]

Definition at line 175 of file DTTFBitArray.h.

References DTTFBitArray< N >::element(), i, n, and DTTFBitArray< N >::nBits().

                    {
    int n=0;
    for(int i=0;i<this->nBits();i++) {
      if(this->element(i))n++;
    }
    return n;
  }
template<int N>
unsigned& DTTFBitArray< N >::dataWord ( const int  i) [inline]

Definition at line 132 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, i, and DTTFBitArray< N >::nWords().

                                   {
    assert(i>=0 && i<this->nWords());
    return _data[i];
  }
template<int N>
unsigned DTTFBitArray< N >::dataWord ( const int  i) const [inline]
template<int N>
int DTTFBitArray< N >::element ( const int  pos) const [inline]
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::flip ( ) [inline]

Definition at line 406 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, i, and DTTFBitArray< N >::nWords().

Referenced by DTTFBitArray< N >::operator~().

                           {
    for(int i=0;i<this->nWords();i++) {
      _data[i] = ~_data[i];
    }
    return *this;
  }
template<int N>
static int DTTFBitArray< N >::getPosInWord ( const int  pos) [inline, static]

Definition at line 148 of file DTTFBitArray.h.

Referenced by DTTFBitArray< N >::getPosMask(), and DTTFBitArray< N >::refToBit::refToBit().

                                         {
    // assert(pos>=0&& pos<this->nBits());
    return pos%32;
  }
template<int N>
static unsigned DTTFBitArray< N >::getPosMask ( const int  pos) [inline, static]
template<int N>
unsigned& DTTFBitArray< N >::getWord ( const int  pos) [inline]
template<int N>
unsigned DTTFBitArray< N >::getWord ( const int  pos) const [inline]

Definition at line 142 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, and DTTFBitArray< N >::nBits().

                                        {
    assert(pos>=0&& pos<this->nBits());
    return _data[pos/32];
  }
template<int N>
unsigned DTTFBitArray< N >::lastWordMask ( ) const [inline]

Definition at line 165 of file DTTFBitArray.h.

References DTTFBitArray< N >::unusedBits().

Referenced by DTTFBitArray< N >::cleanUnused().

                                {
    return static_cast<unsigned>(0xffffffff)>>(this->unusedBits());
  }
template<int N>
int DTTFBitArray< N >::nBits ( ) const [inline]
template<int N>
int DTTFBitArray< N >::none ( ) [inline]

Definition at line 197 of file DTTFBitArray.h.

References DTTFBitArray< N >::dataWord(), DTTFBitArray< N >::nWords(), and DTTFBitArray< N >::unusedBits().

             {
    int nw = this->nWords();
    int ub = unusedBits();
    if(this->dataWord(nw-1)<<ub!=0xffffffff)return 1;
    if(nw>1){
      for (int iw=0;iw<nw-1;iw++){
        if(this->dataWord(iw)!=0xffffffff) return 1;
      }
    }
    return 0;
  }    
template<int N>
int DTTFBitArray< N >::nWords ( ) const [inline]
template<int N>
void DTTFBitArray< N >::one ( ) [inline]

Definition at line 223 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, i, and DTTFBitArray< N >::nWords().

             {
    for (int i=0;i<this->nWords();i++) {
      _data[i] = 0xffffffff;       // set to 1
    }
  }
template<int N>
bool DTTFBitArray< N >::operator!= ( const DTTFBitArray< N > &  a) const [inline]

Definition at line 394 of file DTTFBitArray.h.

{ return !(a==*this); }
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::operator& ( const DTTFBitArray< N > &  a) [inline]

Definition at line 425 of file DTTFBitArray.h.

References a.

{return DTTFBitArray<N> (*this)&=a; }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator&= ( const DTTFBitArray< N > &  a) [inline]

Definition at line 417 of file DTTFBitArray.h.

References DTTFBitArray< N >::dataWord(), i, and DTTFBitArray< N >::nWords().

                                                         {
    for(int i = 0;i<this->nWords();i++) {
      this->dataWord(i) &= a.dataWord(i);
    }
    return *this;
  }    
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::operator+ ( const DTTFBitArray< N > &  a) [inline]

Definition at line 489 of file DTTFBitArray.h.

References a.

{return DTTFBitArray<N> (*this)+=a; }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator++ ( int  ) [inline]

Definition at line 492 of file DTTFBitArray.h.

References DTTFBitArray< N >::element(), i, DTTFBitArray< N >::nBits(), and DTTFBitArray< N >::unset().

                                   {
    int i = 0;
    while(i<this->nBits()&&this->element(i)==1) { this->unset(i); i++; }
    if(i<this->nBits())this->set(i);
    return *this;
  }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator+= ( const DTTFBitArray< N > &  a) [inline]

Definition at line 476 of file DTTFBitArray.h.

References DTTFBitArray< N >::element(), i, DTTFBitArray< N >::nBits(), and cuy::rep.

                                                        {
    int rep=0;
    int sum=0;
    for(int i=0;i<this->nBits();i++) {
      sum=this->element(i)^rep;
      rep=this->element(i)&rep;
      this->set(i,sum^a.element(i));
      rep|=(sum&a.element(i));
    }
    return *this;
  }
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::operator- ( const DTTFBitArray< N > &  a) [inline]

Definition at line 515 of file DTTFBitArray.h.

References a.

{return DTTFBitArray<N> (*this)-=a; }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator-= ( const DTTFBitArray< N > &  a) [inline]

Definition at line 510 of file DTTFBitArray.h.

References DTTFBitArray< N >::twoComplement().

                                                        {
    return *this+=a.twoComplement();
  }
template<int N>
bool DTTFBitArray< N >::operator< ( const DTTFBitArray< N > &  a) const [inline]

Definition at line 371 of file DTTFBitArray.h.

References a, DTTFBitArray< N >::dataWord(), DTTFBitArray< N >::nWords(), and DTTFBitArray< N >::unusedBits().

                                                 {
    int nw = this->nWords();
    int ub = this->unusedBits();
    unsigned aaa = this->dataWord(nw-1)<<ub; // ignore unused bits
    unsigned bbb =     a.dataWord(nw-1)<<ub; // in both operands
    if        (aaa<bbb) {
      return 1;
    } else if (aaa>bbb) {
      return 0;
    }
    if(nw>1){
      for (int iw=nw-2;iw>=0;iw--){
        if        (this->dataWord(iw)<a.dataWord(iw)) {
          return 1;
        } else if (this->dataWord(iw)>a.dataWord(iw)) {
          return 0;
        }
      }
    }
    return 0;
  }
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::operator<< ( const int  n) [inline]

Definition at line 460 of file DTTFBitArray.h.

References n.

{ return DTTFBitArray<N> (*this)<<=n; }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator<<= ( const int  n) [inline]

Definition at line 450 of file DTTFBitArray.h.

References DTTFBitArray< N >::element(), i, n, DTTFBitArray< N >::nBits(), and DTTFBitArray< N >::unset().

                                            {
    assert(n>=0&&n<this->nBits());
    if(n==0)return *this;
    int i=0;
    for(i=this->nBits()-1;i>=n;i--) this->set(i,this->element(i-n));
    for(i=n-1;i>=0;i--) this->unset(i);
    return *this;
  }
template<int N>
bool DTTFBitArray< N >::operator<= ( const DTTFBitArray< N > &  a) const [inline]

Definition at line 403 of file DTTFBitArray.h.

References a.

{ return !(*this>a); }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator= ( const unsigned  i) [inline]

Definition at line 307 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, DTTFBitArray< N >::cleanUnused(), i, and DTTFBitArray< N >::zero().

                                               {
    this->zero();
    _data[0] = i;                 // the nBit least sign. bits are considered
    this->cleanUnused();
    return *this;
  }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator= ( const char *  str) [inline]

Definition at line 328 of file DTTFBitArray.h.

References DTTFBitArray< N >::cleanUnused(), i, DTTFBitArray< N >::nBits(), DTTFBitArray< N >::unset(), and DTTFBitArray< N >::zero().

                                              {
    this->zero();
    for(int i=0; i<this->nBits();i++){
      assert(str[i]=='1'||str[i]=='0');  
      if(str[i]=='1') {
        this->set(this->nBits()-i-1);   // reading a string from left to right 
      } else if(str[i]=='0') {    // --> most significative bit is the one 
        this->unset(this->nBits()-i-1); // with lower string index
      } else {
        break;                    // exit when find a char which is not 0 or 1
      }
    }
    this->cleanUnused();
    return *this;
  }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator= ( const DTTFBitArray< N > &  a) [inline]

Definition at line 296 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, DTTFBitArray< N >::cleanUnused(), i, and DTTFBitArray< N >::nWords().

                                                       {
    if(this != &a) {
      for (int i=0;i<this->nWords();i++) {
        _data[i] = a._data[i];
      }
    }
    this->cleanUnused();
    return *this;
  }
template<int N>
bool DTTFBitArray< N >::operator== ( const DTTFBitArray< N > &  a) const [inline]

Definition at line 357 of file DTTFBitArray.h.

References DTTFBitArray< N >::dataWord(), DTTFBitArray< N >::nWords(), and DTTFBitArray< N >::unusedBits().

                                                  {
   int nw = this->nWords();
    int ub = this->unusedBits();
    if(this->dataWord(nw-1)<<ub!=         // check last word
           a.dataWord(nw-1)<<ub)return 0;
    if(nw>1){
      for (int iw=0;iw<nw-1;iw++){
        if(this->dataWord(iw)!=a.dataWord(iw)) return 0;
      }
    }
    return 1;
  }
template<int N>
bool DTTFBitArray< N >::operator> ( const DTTFBitArray< N > &  a) const [inline]

Definition at line 400 of file DTTFBitArray.h.

References a.

{ return !(*this<a||*this==a); }
template<int N>
bool DTTFBitArray< N >::operator>= ( const DTTFBitArray< N > &  a) const [inline]

Definition at line 397 of file DTTFBitArray.h.

References a.

{ return !(*this<a); }
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::operator>> ( const int  n) [inline]

Definition at line 473 of file DTTFBitArray.h.

References n.

{ return DTTFBitArray<N> (*this)>>=n; }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator>>= ( const int  n) [inline]

Definition at line 463 of file DTTFBitArray.h.

References DTTFBitArray< N >::element(), i, n, DTTFBitArray< N >::nBits(), and DTTFBitArray< N >::unset().

                                            {
    assert(n>=0&&n<this->nBits());
    if(n==0)return *this;
    int i=0;
    for(i=0;i<this->nBits()-n;i++) this->set(i,this->element(i+n));
    for(i=this->nBits()-n;i<this->nBits();i++) this->unset(i);
    return *this;
  }
template<int N>
refToBit DTTFBitArray< N >::operator[] ( const int  pos) [inline]

Definition at line 353 of file DTTFBitArray.h.

References DTTFBitArray< N >::refToBit.

{ return refToBit(*this,pos); }
template<int N>
int DTTFBitArray< N >::operator[] ( const int  pos) const [inline]

Definition at line 354 of file DTTFBitArray.h.

References DTTFBitArray< N >::element().

{ return element(pos); }
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::operator^ ( const DTTFBitArray< N > &  a) [inline]

Definition at line 447 of file DTTFBitArray.h.

References a.

{return DTTFBitArray<N> (*this)^=a; }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator^= ( const DTTFBitArray< N > &  a) [inline]

Definition at line 439 of file DTTFBitArray.h.

References DTTFBitArray< N >::dataWord(), i, and DTTFBitArray< N >::nWords().

                                                        {
    for(int i = 0;i<this->nWords();i++) {
      this->dataWord(i) ^= a.dataWord(i);
    }
    return *this;
  }    
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::operator| ( const DTTFBitArray< N > &  a) [inline]

Definition at line 436 of file DTTFBitArray.h.

References a.

{return DTTFBitArray<N> (*this)|=a;}
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::operator|= ( const DTTFBitArray< N > &  a) [inline]

Definition at line 428 of file DTTFBitArray.h.

References DTTFBitArray< N >::dataWord(), i, and DTTFBitArray< N >::nWords().

                                                        {
    for(int i = 0;i<this->nWords();i++) {
      this->dataWord(i) |= a.dataWord(i);
    }
    return *this;
  }    
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::operator~ ( ) const [inline]

Definition at line 414 of file DTTFBitArray.h.

References DTTFBitArray< N >::flip().

{ return DTTFBitArray<N> (*this).flip(); }
template<int N>
std::ostream& DTTFBitArray< N >::print ( std::ostream &  o = std::cout) const [inline]

Definition at line 345 of file DTTFBitArray.h.

References DTTFBitArray< N >::element(), i, DTTFBitArray< N >::nBits(), and python::connectstrParser::o.

Referenced by L1MuDTPtaLut::print().

                                                  {
    for(int i = this->nBits()-1; i>=0; i--){
      o << this->element(i);
    }
    return o;
  }
template<int N>
unsigned DTTFBitArray< N >::read ( const int  p,
const int  n 
) const [inline]

Definition at line 275 of file DTTFBitArray.h.

References i, n, DTTFBitArray< N >::nBits(), dbtoconf::out, and DTTFBitArray< N >::test().

                                                {
    assert(p>=0 && p+n<=this->nBits());  
    assert(n<=32); // the output must fit in a 32 bit word
    // only the n least significant bits of val are considered
    unsigned out=0x0;
    for(int i=0; i<n;i++){
      if(this->test(p+i)) out |= 1<<i;
    }
    return out;
  }
template<int N>
void DTTFBitArray< N >::reset ( const int  i) [inline]

Definition at line 232 of file DTTFBitArray.h.

References DTTFBitArray< N >::unset().

{ this->unset(i); }
template<int N>
void DTTFBitArray< N >::reset ( void  ) [inline]

Definition at line 221 of file DTTFBitArray.h.

References DTTFBitArray< N >::zero().

{ zero(); }
template<int N>
void DTTFBitArray< N >::set ( const int  i,
const char *  str 
) [inline]

Definition at line 236 of file DTTFBitArray.h.

References DTTFBitArray< N >::assign(), and i.

{ this->assign(i,1,str); }
template<int N>
void DTTFBitArray< N >::set ( const int  i,
const int  val 
) [inline]

Definition at line 235 of file DTTFBitArray.h.

References DTTFBitArray< N >::assign(), and i.

{ this->assign(i,1,val); }
template<int N>
void DTTFBitArray< N >::set ( const int  i) [inline]

Definition at line 230 of file DTTFBitArray.h.

References DTTFBitArray< N >::getPosMask(), DTTFBitArray< N >::getWord(), and i.

{ getWord(i) |= getPosMask(i); }
template<int N>
int DTTFBitArray< N >::size ( void  ) const [inline]

Definition at line 122 of file DTTFBitArray.h.

References DTTFBitArray< N >::nBits().

{ return this->nBits(); }
template<int N>
int DTTFBitArray< N >::test ( const int  i) const [inline]

Definition at line 213 of file DTTFBitArray.h.

References DTTFBitArray< N >::element().

Referenced by DTTFBitArray< N >::read().

{ return element(i); }
template<int N>
DTTFBitArray<N>& DTTFBitArray< N >::twoComplement ( ) [inline]

Definition at line 503 of file DTTFBitArray.h.

                                   { 
    (*this).flip();
    (*this)++;
    return *this;
  }
template<int N>
DTTFBitArray<N> DTTFBitArray< N >::twoComplement ( ) const [inline]
template<int N>
void DTTFBitArray< N >::unset ( const int  i) [inline]
template<int N>
int DTTFBitArray< N >::unusedBits ( ) const [inline]

Definition at line 159 of file DTTFBitArray.h.

References DTTFBitArray< N >::nBits().

Referenced by DTTFBitArray< N >::any(), DTTFBitArray< N >::lastWordMask(), DTTFBitArray< N >::none(), DTTFBitArray< N >::operator<(), and DTTFBitArray< N >::operator==().

                         {
    if(this->nBits()==0)return 32;
    return 31-((this->nBits()-1)%32);
  }
template<int N>
void DTTFBitArray< N >::zero ( ) [inline]

Definition at line 216 of file DTTFBitArray.h.

References DTTFBitArray< N >::_data, i, and DTTFBitArray< N >::nWords().

Referenced by DTTFBitArray< N >::DTTFBitArray(), DTTFBitArray< N >::operator=(), and DTTFBitArray< N >::reset().

              {
    for (int i=0;i<this->nWords();i++) {
      _data[i] = 0x0;                // set to 0
    }
  }

Friends And Related Function Documentation

template<int N>
friend class refToBit [friend]

Definition at line 33 of file DTTFBitArray.h.

Referenced by DTTFBitArray< N >::operator[]().


Member Data Documentation

template<int N>
unsigned DTTFBitArray< N >::_data[N/32+1] [private]