16 #ifndef SURGSIM_DEVICES_MULTIAXIS_BITSETBUFFER_H
17 #define SURGSIM_DEVICES_MULTIAXIS_BITSETBUFFER_H
61 m_bytes.fill(~static_cast<value_type>(0));
88 bool test(
size_t pos)
const
122 static_assert(ELEMENT_BITS == 8,
"An unsigned char is not 8 bits?!");
125 static const size_t NUM_BYTES = (NUM_BITS + ELEMENT_BITS - 1) / ELEMENT_BITS;
133 #endif // SURGSIM_DEVICES_MULTIAXIS_BITSETBUFFER_H
Definition: DriveElementFromInputBehavior.cpp:27
void set(size_t pos)
Set the specified bit in the buffer to on.
Definition: BitSetBuffer.h:66
unsigned char value_type
Definition: BitSetBuffer.h:119
#define SURGSIM_ASSERT(condition)
Assert that condition is true.
Definition: Assert.h:77
BitSetBuffer(const BitSetBuffer &other)
Create a bit buffer by copying another buffer.
Definition: BitSetBuffer.h:46
static const size_t ELEMENT_BITS
Definition: BitSetBuffer.h:121
static const size_t NUM_BITS
Definition: BitSetBuffer.h:124
static const size_t ELEMENT_BYTES
Definition: BitSetBuffer.h:120
void reset(size_t pos)
Reset the specified bit in the buffer to off.
Definition: BitSetBuffer.h:80
BitSetBuffer & operator=(const BitSetBuffer &other)
Copy bit buffer contents from another buffer.
Definition: BitSetBuffer.h:52
void reset()
Reset all bits in the buffer to off.
Definition: BitSetBuffer.h:73
const void * getPointer() const
Get a pointer to the buffer's storage.
Definition: BitSetBuffer.h:101
The header that provides the assertion API.
static const size_t NUM_BYTES
Definition: BitSetBuffer.h:125
BitSetBuffer()
Create a bit buffer with all bits set to zero.
Definition: BitSetBuffer.h:40
std::array< value_type, NUM_BYTES > m_bytes
Definition: BitSetBuffer.h:127
void * getPointer()
Get a pointer to the buffer's storage.
Definition: BitSetBuffer.h:95
A bit set corresponding to a contiguous memory buffer.
Definition: BitSetBuffer.h:36
bool test(size_t pos) const
Get the specified bit in the buffer.
Definition: BitSetBuffer.h:88
static size_t size()
Get the number of bits in the bit set.
Definition: BitSetBuffer.h:107
void set()
Set all bits in the buffer to on.
Definition: BitSetBuffer.h:59
static size_t sizeBytes()
Get the number of bytes in the bit set.
Definition: BitSetBuffer.h:113