XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
xwos::Bmp< TNum >::Bit类 参考

#include <Bmp.hxx>

xwos::Bmp< TNum >::Bit 的协作图:

Public 成员函数

 Bit (Bmp &bmp, xwsq_t index)
 
 Bit (Bmp *bmp, xwsq_t index)
 
 Bit (const Bit &other)
 
 Bit (const Bit &&other)
 
 ~Bit ()
 
Bitoperator= (bool x)
 
Bitoperator= (const Bit &other)
 
Bitoperator= (const Bit &&other)
 
Bitoperator~ ()
 
 operator bool ()
 
void flip ()
 

Private 属性

BmpmBmp
 
xwsq_t mBit
 

详细描述

template<xwsz_t TNum>
class xwos::Bmp< TNum >::Bit

在文件 Bmp.hxx34 行定义.

构造及析构函数说明

◆ Bit() [1/4]

template<xwsz_t TNum>
xwos::Bmp< TNum >::Bit::Bit ( Bmp bmp,
xwsq_t  index 
)
inlineexplicit

在文件 Bmp.hxx41 行定义.

42 : mBmp(&bmp)
43 , mBit(index)
44 {
45 }
Bmp * mBmp
Definition Bmp.hxx:37
xwsq_t mBit
Definition Bmp.hxx:38

◆ Bit() [2/4]

template<xwsz_t TNum>
xwos::Bmp< TNum >::Bit::Bit ( Bmp bmp,
xwsq_t  index 
)
inlineexplicit

在文件 Bmp.hxx46 行定义.

47 : mBmp(bmp)
48 , mBit(index)
49 {
50 }

◆ Bit() [3/4]

template<xwsz_t TNum>
xwos::Bmp< TNum >::Bit::Bit ( const Bit other)
inlineexplicit

在文件 Bmp.hxx51 行定义.

52 : mBit(other.mBmp, other.mBit)
53 {
54 }

◆ Bit() [4/4]

template<xwsz_t TNum>
xwos::Bmp< TNum >::Bit::Bit ( const Bit &&  other)
inlineexplicit

在文件 Bmp.hxx55 行定义.

56 : mBit(other.mBmp, other.mBit)
57 {
58 }

◆ ~Bit()

template<xwsz_t TNum>
xwos::Bmp< TNum >::Bit::~Bit ( )
inline

在文件 Bmp.hxx59 行定义.

60 {
61 }

成员函数说明

◆ operator=() [1/3]

template<xwsz_t TNum>
Bit & xwos::Bmp< TNum >::Bit::operator= ( bool  x)
inline

在文件 Bmp.hxx62 行定义.

63 {
64 if (x) {
65 mBmp->set(mBit);
66 } else {
67 mBmp->clear(mBit);
68 }
69 return *this;
70 }
void clear()
Definition Bmp.hxx:205
void set()
Definition Bmp.hxx:187
函数调用图:

◆ operator=() [2/3]

template<xwsz_t TNum>
Bit & xwos::Bmp< TNum >::Bit::operator= ( const Bit other)
inline

在文件 Bmp.hxx71 行定义.

72 {
73 if (this != &other) {
74 mBmp = other.mBmp;
75 mBit = other.mBit;
76 }
77 return *this;
78 }

◆ operator=() [3/3]

template<xwsz_t TNum>
Bit & xwos::Bmp< TNum >::Bit::operator= ( const Bit &&  other)
inline

在文件 Bmp.hxx79 行定义.

80 {
81 if (this != &other) {
82 mBmp = other.mBmp;
83 mBit = other.mBit;
84 }
85 return *this;
86 }

◆ operator~()

template<xwsz_t TNum>
Bit & xwos::Bmp< TNum >::Bit::operator~ ( )
inline

在文件 Bmp.hxx87 行定义.

88 {
89 mBmp->flip(mBit);
90 return *this;
91 }
void flip()
Definition Bmp.hxx:223
函数调用图:

◆ operator bool()

template<xwsz_t TNum>
xwos::Bmp< TNum >::Bit::operator bool ( )
inlineexplicit

在文件 Bmp.hxx92 行定义.

93 {
94 bool ret;
95 if ((xwsq_t)mBit < TNum) {
96 ret = xwbmpop_t1i(mBmp->mData, mBit);
97 } else {
98 ret = false;
99 }
100 return ret;
101 }
xwbmp_t mData[(((TNum)+(8U *sizeof(xwbmp_t)) - 1U)/(8U *sizeof(xwbmp_t)))]
Definition Bmp.hxx:106
unsigned long xwsq_t
Definition type.h:445
bool xwbmpop_t1i(xwbmp_t *bmp, xwsq_t n)
测试位图中的单个位是否为1
Definition xwbop.c:732
函数调用图:

◆ flip()

template<xwsz_t TNum>
void xwos::Bmp< TNum >::Bit::flip ( )
inline

在文件 Bmp.hxx102 行定义.

102{ mBmp->flip(mBit); }
函数调用图:

结构体成员变量说明

◆ mBmp

template<xwsz_t TNum>
Bmp* xwos::Bmp< TNum >::Bit::mBmp
private

在文件 Bmp.hxx37 行定义.

◆ mBit

template<xwsz_t TNum>
xwsq_t xwos::Bmp< TNum >::Bit::mBit
private

在文件 Bmp.hxx38 行定义.


该类的文档由以下文件生成: