A proxy class that acts as a mutable reference to a single bitset in a BitSetVector. More...
#include <dune/common/bitsetvector.hh>
Public Types | |
typedef std::bitset< block_size > | bitset |
typedef size_t | size_type |
size_type typedef (an unsigned integral type) | |
typedef std::vector< bool, Alloc >::reference | reference |
typedef std::vector< bool, Alloc >::const_reference | const_reference |
A proxy class that acts as a const reference to a single bit. | |
Public Member Functions | |
BitSetVectorReference & | operator= (bool b) |
Assignment from bool, sets each bit in the bitset to b. | |
BitSetVectorReference & | operator= (const bitset &b) |
Assignment from bitset. | |
BitSetVectorReference & | operator= (const BitSetVectorConstReference &b) |
Assignment from BitSetVectorConstReference. | |
BitSetVectorReference & | operator= (const BitSetVectorReference &b) |
Assignment from BitSetVectorReference. | |
BitSetVectorReference & | operator&= (const bitset &x) |
Bitwise and (for bitset). | |
BitSetVectorReference & | operator&= (const BitSetVectorConstReference &x) |
Bitwise and (for BitSetVectorConstReference and BitSetVectorReference). | |
BitSetVectorReference & | operator|= (const bitset &x) |
Bitwise inclusive or (for bitset). | |
BitSetVectorReference & | operator|= (const BitSetVectorConstReference &x) |
Bitwise inclusive or (for BitSetVectorConstReference and BitSetVectorReference). | |
BitSetVectorReference & | operator^= (const bitset &x) |
Bitwise exclusive or (for bitset). | |
BitSetVectorReference & | operator^= (const BitSetVectorConstReference &x) |
Bitwise exclusive or (for BitSetVectorConstReference and BitSetVectorReference). | |
BitSetVectorReference & | operator<<= (size_type n) |
Left shift. | |
BitSetVectorReference & | operator>>= (size_type n) |
Right shift. | |
BitSetVectorReference & | set () |
BitSetVectorReference & | flip () |
Flips the value of every bit. | |
BitSetVectorReference & | reset () |
Clears every bit. | |
BitSetVectorReference & | set (size_type n, int val=1) |
Sets bit n if val is nonzero, and clears bit n if val is zero. | |
BitSetVectorReference & | reset (size_type n) |
Clears bit n. | |
BitSetVectorReference & | flip (size_type n) |
Flips bit n. | |
reference | operator[] (size_type i) |
bitset | operator<< (size_type n) const |
Returns a copy of *this shifted left by n bits. | |
bitset | operator>> (size_type n) const |
Returns a copy of *this shifted right by n bits. | |
bitset | operator~ () const |
Returns a copy of *this with all of its bits flipped. | |
size_type | size () const |
Returns block_size. | |
size_type | count () const |
Returns the number of bits that are set. | |
bool | any () const |
Returns true if any bits are set. | |
bool | none () const |
Returns true if no bits are set. | |
bool | all () const |
Returns true if all bits are set. | |
bool | test (size_type n) const |
Returns true if bit n is set. | |
const_reference | operator[] (size_type i) const |
operator bitset () const | |
cast to bitset | |
bool | operator== (const bitset &bs) const |
Equality of reference and std::bitset. | |
bool | operator== (const BitSetVectorConstReference &bs) const |
Equality of reference and other reference. | |
bool | operator!= (const bitset &bs) const |
Inequality of reference and std::bitset. | |
bool | operator!= (const BitSetVectorConstReference &bs) const |
Inequality of reference and other reference. | |
Protected Types | |
typedef Dune::BitSetVector < block_size, Alloc > | BitSetVector |
typedef Dune::BitSetVectorConstReference < block_size, Alloc > | BitSetVectorConstReference |
Protected Member Functions | |
BitSetVectorReference (BitSetVector &blockBitField_, int block_number_) | |
reference | getBit (size_type i) |
const_reference | getBit (size_type i) const |
template<class BS > | |
bool | equals (const BS &bs) const |
Protected Attributes | |
BitSetVector & | blockBitField |
int | block_number |
Friends | |
std::ostream & | operator<< (std::ostream &s, const BitSetVectorConstReference &v) |
Write a DenseVector to an output stream. |
A proxy class that acts as a mutable reference to a single bitset in a BitSetVector.
It contains an assignment operator from std::bitset. It inherits the const std::bitset interface provided by BitSetVectorConstReference and adds most of the non-const methods of std::bitset.
typedef std::bitset<block_size> Dune::BitSetVectorReference< block_size, Alloc >::bitset |
Reimplemented from Dune::BitSetVectorConstReference< block_size, Alloc >.
typedef Dune::BitSetVector<block_size, Alloc> Dune::BitSetVectorReference< block_size, Alloc >::BitSetVector [protected] |
Reimplemented from Dune::BitSetVectorConstReference< block_size, Alloc >.
typedef Dune::BitSetVectorConstReference<block_size,Alloc> Dune::BitSetVectorReference< block_size, Alloc >::BitSetVectorConstReference [protected] |
typedef std::vector<bool, Alloc>::const_reference Dune::BitSetVectorReference< block_size, Alloc >::const_reference |
A proxy class that acts as a const reference to a single bit.
Reimplemented from Dune::BitSetVectorConstReference< block_size, Alloc >.
typedef std::vector<bool, Alloc>::reference Dune::BitSetVectorReference< block_size, Alloc >::reference |
bitset interface typedefs
A proxy class that acts as a reference to a single bit.
Reimplemented from Dune::BitSetVectorConstReference< block_size, Alloc >.
typedef size_t Dune::BitSetVectorReference< block_size, Alloc >::size_type |
size_type typedef (an unsigned integral type)
Reimplemented from Dune::BitSetVectorConstReference< block_size, Alloc >.
Dune::BitSetVectorReference< block_size, Alloc >::BitSetVectorReference | ( | BitSetVector & | blockBitField_, | |
int | block_number_ | |||
) | [inline, protected] |
bool Dune::BitSetVectorConstReference< block_size, Alloc >::all | ( | ) | const [inline, inherited] |
Returns true if all bits are set.
bool Dune::BitSetVectorConstReference< block_size, Alloc >::any | ( | ) | const [inline, inherited] |
Returns true if any bits are set.
size_type Dune::BitSetVectorConstReference< block_size, Alloc >::count | ( | ) | const [inline, inherited] |
Returns the number of bits that are set.
bool Dune::BitSetVectorConstReference< block_size, Alloc >::equals | ( | const BS & | bs | ) | const [inline, protected, inherited] |
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::flip | ( | size_type | n | ) | [inline] |
Flips bit n.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::flip | ( | ) | [inline] |
Flips the value of every bit.
const_reference Dune::BitSetVectorConstReference< block_size, Alloc >::getBit | ( | size_type | i | ) | const [inline, protected, inherited] |
reference Dune::BitSetVectorReference< block_size, Alloc >::getBit | ( | size_type | i | ) | [inline, protected] |
bool Dune::BitSetVectorConstReference< block_size, Alloc >::none | ( | ) | const [inline, inherited] |
Returns true if no bits are set.
Dune::BitSetVectorConstReference< block_size, Alloc >::operator bitset | ( | ) | const [inline, inherited] |
cast to bitset
bool Dune::BitSetVectorConstReference< block_size, Alloc >::operator!= | ( | const BitSetVectorConstReference< block_size, Alloc > & | bs | ) | const [inline, inherited] |
Inequality of reference and other reference.
bool Dune::BitSetVectorConstReference< block_size, Alloc >::operator!= | ( | const bitset & | bs | ) | const [inline, inherited] |
Inequality of reference and std::bitset.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator&= | ( | const BitSetVectorConstReference & | x | ) | [inline] |
Bitwise and (for BitSetVectorConstReference and BitSetVectorReference).
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator&= | ( | const bitset & | x | ) | [inline] |
Bitwise and (for bitset).
bitset Dune::BitSetVectorConstReference< block_size, Alloc >::operator<< | ( | size_type | n | ) | const [inline, inherited] |
Returns a copy of *this shifted left by n bits.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator<<= | ( | size_type | n | ) | [inline] |
Left shift.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator= | ( | const BitSetVectorReference< block_size, Alloc > & | b | ) | [inline] |
Assignment from BitSetVectorReference.
Reimplemented from Dune::BitSetVectorConstReference< block_size, Alloc >.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator= | ( | const BitSetVectorConstReference & | b | ) | [inline] |
Assignment from BitSetVectorConstReference.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator= | ( | const bitset & | b | ) | [inline] |
Assignment from bitset.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator= | ( | bool | b | ) | [inline] |
Assignment from bool, sets each bit in the bitset to b.
bool Dune::BitSetVectorConstReference< block_size, Alloc >::operator== | ( | const BitSetVectorConstReference< block_size, Alloc > & | bs | ) | const [inline, inherited] |
Equality of reference and other reference.
bool Dune::BitSetVectorConstReference< block_size, Alloc >::operator== | ( | const bitset & | bs | ) | const [inline, inherited] |
Equality of reference and std::bitset.
bitset Dune::BitSetVectorConstReference< block_size, Alloc >::operator>> | ( | size_type | n | ) | const [inline, inherited] |
Returns a copy of *this shifted right by n bits.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator>>= | ( | size_type | n | ) | [inline] |
Right shift.
const_reference Dune::BitSetVectorConstReference< block_size, Alloc >::operator[] | ( | size_type | i | ) | const [inline, inherited] |
reference Dune::BitSetVectorReference< block_size, Alloc >::operator[] | ( | size_type | i | ) | [inline] |
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator^= | ( | const BitSetVectorConstReference & | x | ) | [inline] |
Bitwise exclusive or (for BitSetVectorConstReference and BitSetVectorReference).
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator^= | ( | const bitset & | x | ) | [inline] |
Bitwise exclusive or (for bitset).
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator|= | ( | const BitSetVectorConstReference & | x | ) | [inline] |
Bitwise inclusive or (for BitSetVectorConstReference and BitSetVectorReference).
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::operator|= | ( | const bitset & | x | ) | [inline] |
Bitwise inclusive or (for bitset).
bitset Dune::BitSetVectorConstReference< block_size, Alloc >::operator~ | ( | ) | const [inline, inherited] |
Returns a copy of *this with all of its bits flipped.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::reset | ( | size_type | n | ) | [inline] |
Clears bit n.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::reset | ( | ) | [inline] |
Clears every bit.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::set | ( | size_type | n, | |
int | val = 1 | |||
) | [inline] |
Sets bit n if val is nonzero, and clears bit n if val is zero.
BitSetVectorReference& Dune::BitSetVectorReference< block_size, Alloc >::set | ( | ) | [inline] |
size_type Dune::BitSetVectorConstReference< block_size, Alloc >::size | ( | ) | const [inline, inherited] |
Returns block_size.
bool Dune::BitSetVectorConstReference< block_size, Alloc >::test | ( | size_type | n | ) | const [inline, inherited] |
Returns true if bit n is set.
int Dune::BitSetVectorConstReference< block_size, Alloc >::block_number [protected, inherited] |
BitSetVector& Dune::BitSetVectorReference< block_size, Alloc >::blockBitField [protected] |
Reimplemented from Dune::BitSetVectorConstReference< block_size, Alloc >.