CluE  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CluE::DynamicBitset< T > Class Template Reference

Dynamic bitset similiar to boost::dynamic_bitset. More...

#include <dynamicbitset.h>

Collaboration diagram for CluE::DynamicBitset< T >:
Collaboration graph

Public Member Functions

 DynamicBitset (unsigned long long numberOfBits)
 Constructs a bitset which maintains numberOfBits bits. More...
 
bool operator[] (size_t position) const
 Read access to the (position+1)-th bit. More...
 
void set (size_t position, bool value)
 Write access to the (position+1)-th bit. More...
 
unsigned long long count ()
 Number of set bits. More...
 

Private Attributes

const unsigned long long numberOfBits
 
const int sizeOfT
 
std::vector< T > bitvector
 

Detailed Description

template<typename T = long long>
class CluE::DynamicBitset< T >

Dynamic bitset similiar to boost::dynamic_bitset.

T is the integral type maintaining a bunch of bits, i.e. sizeof(T)*8 bits.

Definition at line 15 of file dynamicbitset.h.

Constructor & Destructor Documentation

template<typename T >
CluE::DynamicBitset< T >::DynamicBitset ( unsigned long long  numberOfBits)

Constructs a bitset which maintains numberOfBits bits.

Parameters
numberOfBitsThe number of bits.

Definition at line 53 of file dynamicbitset.h.

Member Function Documentation

template<typename T >
bool CluE::DynamicBitset< T >::operator[] ( size_t  position) const

Read access to the (position+1)-th bit.

Parameters
Indexof bit (starting with 0)

Definition at line 60 of file dynamicbitset.h.

template<typename T >
void CluE::DynamicBitset< T >::set ( size_t  position,
bool  value 
)

Write access to the (position+1)-th bit.

Parameters
positionIndex of bit (starting with 0)
valueValue to write

Definition at line 67 of file dynamicbitset.h.

template<typename T >
unsigned long long CluE::DynamicBitset< T >::count ( )

Number of set bits.

Definition at line 78 of file dynamicbitset.h.

Member Data Documentation

template<typename T = long long>
const unsigned long long CluE::DynamicBitset< T >::numberOfBits
private

Definition at line 47 of file dynamicbitset.h.

template<typename T = long long>
const int CluE::DynamicBitset< T >::sizeOfT
private

Definition at line 48 of file dynamicbitset.h.

template<typename T = long long>
std::vector<T> CluE::DynamicBitset< T >::bitvector
private

Definition at line 49 of file dynamicbitset.h.


The documentation for this class was generated from the following file: