Dune Core Modules (2.8.0)

Dune::BitSetVectorReference< block_size, Alloc > Class Template Reference

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 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

BitSetVectorReferenceoperator= (bool b)
 Assignment from bool, sets each bit in the bitset to b.
 
BitSetVectorReferenceoperator= (const bitset &b)
 Assignment from bitset.
 
BitSetVectorReferenceoperator= (const BitSetVectorConstReference &b)
 Assignment from BitSetVectorConstReference.
 
BitSetVectorReferenceoperator= (const BitSetVectorReference &b)
 Assignment from BitSetVectorReference.
 
BitSetVectorReferenceoperator&= (const bitset &x)
 Bitwise and (for bitset).
 
BitSetVectorReferenceoperator&= (const BitSetVectorConstReference &x)
 Bitwise and (for BitSetVectorConstReference and BitSetVectorReference)
 
BitSetVectorReferenceoperator|= (const bitset &x)
 Bitwise inclusive or (for bitset)
 
BitSetVectorReferenceoperator|= (const BitSetVectorConstReference &x)
 Bitwise inclusive or (for BitSetVectorConstReference and BitSetVectorReference)
 
BitSetVectorReferenceoperator^= (const bitset &x)
 Bitwise exclusive or (for bitset).
 
BitSetVectorReferenceoperator^= (const BitSetVectorConstReference &x)
 Bitwise exclusive or (for BitSetVectorConstReference and BitSetVectorReference)
 
BitSetVectorReferenceoperator<<= (size_type n)
 Left shift.
 
BitSetVectorReferenceoperator>>= (size_type n)
 Right shift.
 
BitSetVectorReferenceset ()
 Sets every bit.
 
BitSetVectorReferenceflip ()
 Flips the value of every bit.
 
BitSetVectorReferencereset ()
 Clears every bit.
 
BitSetVectorReferenceset (size_type n, int val=1)
 Sets bit n if val is nonzero, and clears bit n if val is zero.
 
BitSetVectorReferencereset (size_type n)
 Clears bit n.
 
BitSetVectorReferenceflip (size_type n)
 Flips bit n.
 
reference operator[] (size_type i)
 Return reference to the i-th bit.
 
bool test (size_type n) const
 Returns true if bit n is set.
 
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.
 
const_reference operator[] (size_type i) const
 Return reference to the i-th bit.
 
 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.
 

Detailed Description

template<int block_size, class Alloc>
class Dune::BitSetVectorReference< block_size, Alloc >

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.

Warning
As this is only a proxy class, you can not get the address of the bitset.

Member Typedef Documentation

◆ reference

template<int block_size, class 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.


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)