13#ifndef __xwos_cxx_Bmp_hxx__
14#define __xwos_cxx_Bmp_hxx__
98 explicit operator bool()
130 if (sz <
sizeof(
mData)) {
131 memcpy(
mData, x, sz);
139 if (
sizeof(x) <
sizeof(
mData)) {
140 memcpy(
mData, &x,
sizeof(x));
148 if (
sizeof(x) <
sizeof(
mData)) {
149 memcpy(
mData, &x,
sizeof(x));
157 if (
sizeof(x) <
sizeof(
mData)) {
158 memcpy(
mData, &x,
sizeof(x));
166 if (
sizeof(x) <
sizeof(
mData)) {
167 memcpy(
mData, &x,
sizeof(x));
175 if (
sizeof(x) <
sizeof(
mData)) {
176 memcpy(
mData, &x,
sizeof(x));
184 if (
sizeof(x) <
sizeof(
mData)) {
185 memcpy(
mData, &x,
sizeof(x));
203 void set(
unsigned int pos)
215 void set(
unsigned long pos)
337 if (
this != &other) {
344 if (
this != &other) {
468 explicit operator bool()
474 return Bit(
this, pos);
Bit(Bmp *bmp, xwsq_t index)
Bit(Bmp &bmp, xwsq_t index)
Bit & operator=(const Bit &&other)
Bit & operator=(const Bit &other)
Bmp< TNum > & operator^=(const Bmp< TNum > &&other)
void set(unsigned int pos)
bool operator>(const Bmp< TNum > &other)
Bmp(unsigned long long x)
bool operator<=(const Bmp< TNum > &&other)
Bmp< TNum > operator|(const Bmp< TNum > &other)
Bmp< TNum > operator^(const Bmp< TNum > &&other)
void flip(Bmp< TNum > *msk)
bool operator<(const Bmp< TNum > &other)
bool operator<(const Bmp< TNum > &&other)
Bmp< TNum > & operator^=(const Bmp< TNum > &other)
void flip(unsigned int pos)
bool operator==(const Bmp< TNum > &other)
Bmp< TNum > & operator=(const Bmp< TNum > &other)
Bmp< TNum > & operator&=(const Bmp< TNum > &&other)
void set(unsigned long pos)
void clear(unsigned long pos)
void set(Bmp< TNum > *msk)
xwbmp_t mData[(((TNum)+(8U *sizeof(xwbmp_t)) - 1U)/(8U *sizeof(xwbmp_t)))]
Bmp< TNum > operator&(const Bmp< TNum > &other)
Bmp< TNum > & operator&=(const Bmp< TNum > &other)
bool operator>(const Bmp< TNum > &&other)
void flip(unsigned long pos)
Bmp< TNum > & operator~()
void flip(Bmp< TNum > &msk)
Bmp< TNum > & operator=(const Bmp< TNum > &&other)
bool operator>=(const Bmp< TNum > &other)
bool operator<=(const Bmp< TNum > &other)
Bmp< TNum > & operator|=(const Bmp< TNum > &&other)
Bmp< TNum > operator|(const Bmp< TNum > &&other)
void clear(Bmp< TNum > &msk)
bool operator!=(const Bmp< TNum > &&other)
void clear(unsigned int pos)
bool operator>=(const Bmp< TNum > &&other)
bool operator!=(const Bmp< TNum > &other)
Bmp(xwu8_t x[], xwsz_t sz)
Bmp< TNum > & operator|=(const Bmp< TNum > &other)
void set(Bmp< TNum > &msk)
Bmp< TNum > operator^(const Bmp< TNum > &other)
Bit operator[](xwsq_t pos)
Bmp< TNum > operator&(const Bmp< TNum > &&other)
bool operator==(const Bmp< TNum > &&other)
void clear(Bmp< TNum > *msk)
xwssq_t xwbmpop_ffs(xwbmp_t *bmp, xwsz_t num)
在位图中从最低位起查找第一个被置1的位
xwssq_t xwbmpop_fls(xwbmp_t *bmp, xwsz_t num)
在位图中从最高位起查找第一个被置1的位
bool xwbmpop_t0ma(xwbmp_t *bmp, const xwbmp_t msk[], xwsz_t num)
测试位图中掩码部分是否全部为0
bool xwbmpop_t1mo(xwbmp_t *bmp, const xwbmp_t msk[], xwsz_t num)
测试位图中掩码部分是否至少有一位为1
void xwbmpop_xor(xwbmp_t *bmp, const xwbmp_t opd[], xwsz_t num)
将位图与操作数进行逐位“异或”运算
bool xwbmpop_t1i(xwbmp_t *bmp, xwsq_t n)
测试位图中的单个位是否为1
#define BITS_TO_XWBMP_T(n)
void xwbmpop_or(xwbmp_t *bmp, const xwbmp_t opd[], xwsz_t num)
将位图与操作数进行逐位“或”运算
xwssq_t xwbmpop_flz(xwbmp_t *bmp, xwsz_t num)
在位图中从最高位起查找第一个被清0的位
void xwbmpop_c0all(xwbmp_t *bmp, xwsq_t num)
将位图中所有位清0
bool xwbmpop_t1ma(xwbmp_t *bmp, const xwbmp_t msk[], xwsz_t num)
测试位图中掩码部分是否全部为1
void xwbmpop_c0m(xwbmp_t *bmp, const xwbmp_t msk[], xwsz_t num)
将位图中掩码部分清0
void xwbmpop_s1i(xwbmp_t *bmp, xwsq_t n)
将位图中单个位置1
void xwbmpop_x1m(xwbmp_t *bmp, const xwbmp_t msk[], xwsz_t num)
将位图中掩码部分翻转
void xwbmpop_s1all(xwbmp_t *bmp, xwsq_t num)
将位图中所有位置1
xwssq_t xwbmpop_cmp(xwbmp_t *bmp, const xwbmp_t opd[], xwsz_t num)
从数组最高元素开始比较两个位图的数值大小
void xwbmpop_assign(xwbmp_t *bmp, const xwbmp_t opd[], xwsz_t num)
赋值操作数到位图
void xwbmpop_x1i(xwbmp_t *bmp, xwsq_t n)
将位图中单个位翻转
void xwbmpop_not(xwbmp_t *bmp, xwsz_t num)
将位图按位取反
void xwbmpop_c0i(xwbmp_t *bmp, xwsq_t n)
将位图中单个位清0
xwssq_t xwbmpop_ffz(xwbmp_t *bmp, xwsz_t num)
在位图中从最低位起查找第一个被清0的位
xwsz_t xwbmpop_weight(xwbmp_t *bmp, xwsz_t num)
在位图中统计被置1的位的个数
void xwbmpop_s1m(xwbmp_t *bmp, const xwbmp_t msk[], xwsz_t num)
将位图中掩码部分置1
void xwbmpop_and(xwbmp_t *bmp, const xwbmp_t opd[], xwsz_t num)
将位图与操作数进行逐位“与”运算