AGX Dynamics  2.37.2.0
agx::BitArray< NUM_BITS > Class Template Reference

Class for stack-storage of a (at compile time) specified number of bits with a minimal size of storage. More...

#include <BitArray.h>

Classes

class  const_reference
 Class which is a reference into an existing bitarray. More...
 
class  reference
 Class which is a reference into an existing bitarray. More...
 

Public Member Functions

 BitArray ()
 Constructor, initializes all bits to zero. More...
 
 ~BitArray ()
 Destructor. More...
 
bool get (size_t n) const
 
reference operator[] (size_t bit)
 
const_reference operator[] (size_t bit) const
 
void set (size_t n, bool flag)
 Set the n:th bit in the bitarray to flag. More...
 
size_t size () const
 
size_t sizeOf () const
 

Protected Member Functions

 BitArray (const BitArray &)
 
BitArray & operator= (const BitArray &)
 

Detailed Description

template<size_t NUM_BITS>
class agx::BitArray< NUM_BITS >

Class for stack-storage of a (at compile time) specified number of bits with a minimal size of storage.

Definition at line 85 of file BitArray.h.

Constructor & Destructor Documentation

◆ BitArray() [1/2]

template<size_t NUM_BITS>
agx::BitArray< NUM_BITS >::BitArray ( )
inline

Constructor, initializes all bits to zero.

Definition at line 89 of file BitArray.h.

◆ ~BitArray()

template<size_t NUM_BITS>
agx::BitArray< NUM_BITS >::~BitArray ( )
inline

Destructor.

Definition at line 94 of file BitArray.h.

◆ BitArray() [2/2]

template<size_t NUM_BITS>
agx::BitArray< NUM_BITS >::BitArray ( const BitArray< NUM_BITS > &  )
inlineprotected

Definition at line 234 of file BitArray.h.

Member Function Documentation

◆ get()

template<size_t NUM_BITS>
bool agx::BitArray< NUM_BITS >::get ( size_t  n) const
inline
Returns
the value of the n:th bit

Definition at line 111 of file BitArray.h.

◆ operator=()

template<size_t NUM_BITS>
BitArray& agx::BitArray< NUM_BITS >::operator= ( const BitArray< NUM_BITS > &  )
inlineprotected

Definition at line 235 of file BitArray.h.

◆ operator[]() [1/2]

template<size_t NUM_BITS>
reference agx::BitArray< NUM_BITS >::operator[] ( size_t  bit)
inline

Definition at line 223 of file BitArray.h.

◆ operator[]() [2/2]

template<size_t NUM_BITS>
const_reference agx::BitArray< NUM_BITS >::operator[] ( size_t  bit) const
inline

Definition at line 228 of file BitArray.h.

◆ set()

template<size_t NUM_BITS>
void agx::BitArray< NUM_BITS >::set ( size_t  n,
bool  flag 
)
inline

Set the n:th bit in the bitarray to flag.

Parameters
n- select the n:th bit to be set
flag- set the n:th bit to flag

Definition at line 101 of file BitArray.h.

◆ size()

template<size_t NUM_BITS>
size_t agx::BitArray< NUM_BITS >::size ( ) const
inline

Definition at line 216 of file BitArray.h.

◆ sizeOf()

template<size_t NUM_BITS>
size_t agx::BitArray< NUM_BITS >::sizeOf ( ) const
inline

Definition at line 219 of file BitArray.h.


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