1#ifndef CONTAINER_BIT_PATTERN_H_INCLUDED
2#define CONTAINER_BIT_PATTERN_H_INCLUDED
27 return sizeof m_data * 8U;
32 m_data =
static_cast<T
>(~static_cast<T>(0U));
39 m_data |=
static_cast<T
>(
static_cast<T
>(1U) << pos);
52 m_data &=
static_cast<T
>(~(
static_cast<T
>(1U) << pos));
58 m_data =
static_cast<T
>(~m_data);
65 m_data ^=
static_cast<T
>(
static_cast<T
>(1U) << pos);
69 operator const T&()
const
79 bool test(std::size_t pos)
const
82 return (m_data &
static_cast<T
>(
static_cast<T
>(1U) << pos)) != 0U;
87 return m_data ==
static_cast<T
>(~static_cast<T>(0U));
#define DEBUG_ASSERT(x)
The same as CHECK_ASSERT() macro.
Definition Assertion.h:39
The container with bitwise operation like std::bitset.
Definition BitPattern.h:17
bool any() const
Definition BitPattern.h:90
bool none() const
Definition BitPattern.h:95
BitPattern & set()
Definition BitPattern.h:30
BitPattern & flip(std::size_t pos)
Definition BitPattern.h:62
BitPattern & flip()
Definition BitPattern.h:56
BitPattern(T pattern)
Definition BitPattern.h:23
BitPattern & reset(std::size_t pos)
Definition BitPattern.h:49
BitPattern & set(std::size_t pos)
Definition BitPattern.h:36
BitPattern & reset()
Definition BitPattern.h:43
bool all() const
Definition BitPattern.h:85
std::size_t size() const
Definition BitPattern.h:25
bool test(std::size_t pos) const
Definition BitPattern.h:79
BitPattern()
Definition BitPattern.h:22