OpenMPCD
|
Represents a constant-size collection of boolean values. More...
#include <Bitset.hpp>
Public Member Functions | |
OPENMPCD_CUDA_DEVICE | Bitset (const std::size_t bitCount_) |
The constructor. More... | |
OPENMPCD_CUDA_DEVICE | ~Bitset () |
The destructor. More... | |
OPENMPCD_CUDA_DEVICE std::size_t | getBitCount () const |
Returns the number of accessible bits. More... | |
OPENMPCD_CUDA_DEVICE void | set (const std::size_t bit, const bool value) |
Sets the given bit to the given value. More... | |
OPENMPCD_CUDA_DEVICE bool | get (const std::size_t bit) const |
Returns the given bit. More... | |
OPENMPCD_CUDA_DEVICE void | setAll (const bool value) |
Sets all bits to the given value. More... | |
Represents a constant-size collection of boolean values.
Definition at line 21 of file Bitset.hpp.
OPENMPCD_CUDA_DEVICE OpenMPCD::CUDA::Bitset::Bitset | ( | const std::size_t | bitCount_ | ) |
The constructor.
The initial value of the bits is unspecified.
[in] | bitCount_ | The number of bits to store. |
Definition at line 20 of file ImplementationDetails/Bitset.hpp.
OPENMPCD_CUDA_DEVICE OpenMPCD::CUDA::Bitset::~Bitset | ( | ) |
The destructor.
Definition at line 28 of file ImplementationDetails/Bitset.hpp.
OPENMPCD_CUDA_DEVICE bool OpenMPCD::CUDA::Bitset::get | ( | const std::size_t | bit | ) | const |
Returns the given bit.
This function is thread-safe.
If OPENMPCD_DEBUG
is defined, asserts that bit
has a valid value.
[in] | bit | The bit to set, indexed in the range [0, getBitCount()) . |
Definition at line 58 of file ImplementationDetails/Bitset.hpp.
OPENMPCD_CUDA_DEVICE std::size_t OpenMPCD::CUDA::Bitset::getBitCount | ( | ) | const |
Returns the number of accessible bits.
Definition at line 34 of file ImplementationDetails/Bitset.hpp.
OPENMPCD_CUDA_DEVICE void OpenMPCD::CUDA::Bitset::set | ( | const std::size_t | bit, |
const bool | value | ||
) |
Sets the given bit to the given value.
This function is thread-safe.
If OPENMPCD_DEBUG
is defined, asserts that bit
has a valid value.
[in] | bit | The bit to set, indexed in the range [0, getBitCount()) . |
[in] | value | The value to set the bit to. |
Definition at line 40 of file ImplementationDetails/Bitset.hpp.
OPENMPCD_CUDA_DEVICE void OpenMPCD::CUDA::Bitset::setAll | ( | const bool | value | ) |
Sets all bits to the given value.
[in] | value | The value to set the bits to. |
Definition at line 69 of file ImplementationDetails/Bitset.hpp.