The Sparta Modeling Framework
|
Class for fast bit manipulation. More...
#include <BitArray.hpp>
Public Member Functions | |
BitArray (const void *data, size_t data_size, size_t array_size=0) | |
template<typename T , typename = typename std::enable_if<std::is_integral<T>::value>::type> | |
BitArray (const T &value, size_t array_size=sizeof(T)) | |
BitArray (const BitArray &other) | |
BitArray & | operator= (const BitArray &other)=default |
BitArray (BitArray &&)=default | |
BitArray & | operator= (BitArray &&)=default |
const void * | getValue () const |
template<typename T , typename = typename std::enable_if<std::is_integral<T>::value>::type> | |
T | getValue () const |
size_t | getSize () const |
template<typename T , typename = typename std::enable_if<std::is_integral<T>::value>::type> | |
void | fill (const T &value) |
bool | operator== (const BitArray &other) const |
bool | operator!= (const BitArray &other) const |
BitArray | operator<< (size_t amount) const |
BitArray & | operator<<= (size_t amount) |
BitArray | operator>> (size_t amount) const |
BitArray & | operator>>= (size_t amount) |
BitArray | operator& (const BitArray &other) const |
BitArray & | operator&= (const BitArray &other) |
BitArray | operator| (const BitArray &other) const |
BitArray & | operator|= (const BitArray &other) |
BitArray | operator~ () const |
Class for fast bit manipulation.
Type to represent a bit array whose size is not known at compile time. If the size is known at compile time use std::bitset.
Definition at line 44 of file BitArray.hpp.
|
inline |
Construct a BitArray from a data buffer
data | Pointer to the data buffer |
data_size | Size of the data buffer in bytes |
array_size | The size of the BitArray in bytes |
If the array_size parameter is not specified or zero, the size of the array will be the same as the size of the data buffer.
Definition at line 60 of file BitArray.hpp.
|
inlineexplicit |
Construct a BitArray from an integer type
value | The integer |
array_size | The size of the BitArray in bytes |
If the array_size parameter is not specified, the size of the array will be the same as the size of the integer type.
Definition at line 81 of file BitArray.hpp.
|
inline |
Definition at line 86 of file BitArray.hpp.
|
inline |
Fill the array by repeating value
Definition at line 122 of file BitArray.hpp.
|
inline |
Definition at line 112 of file BitArray.hpp.
|
inline |
Definition at line 98 of file BitArray.hpp.
|
inline |
Definition at line 105 of file BitArray.hpp.
|
inline |
Definition at line 136 of file BitArray.hpp.
The size of the resulting BitArray will equal that of the left hand size array. If the right hand side array is the larger of the two, its upper bits will be truncated and will not be included in the result. If the left hand side is the larger, the result will contain its upper bits unchanged.
Definition at line 174 of file BitArray.hpp.
Definition at line 181 of file BitArray.hpp.
|
inline |
Definition at line 141 of file BitArray.hpp.
|
inline |
Definition at line 148 of file BitArray.hpp.
|
inline |
Definition at line 130 of file BitArray.hpp.
|
inline |
Definition at line 154 of file BitArray.hpp.
|
inline |
Definition at line 161 of file BitArray.hpp.
The size of the resulting BitArray will equal that of the left hand size array. If the right hand side array is the larger of the two, its upper bits will be truncated and will not be included in the result. If the left hand side is the larger, the result will contain its upper bits unchanged.
Definition at line 194 of file BitArray.hpp.
Definition at line 201 of file BitArray.hpp.
|
inline |
Definition at line 207 of file BitArray.hpp.