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.hxx40 行定义.

构造及析构函数说明

◆ Bit() [1/4]

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

在文件 Bmp.hxx47 行定义.

48 : mBmp(&bmp)
49 , mBit(index)
50 {
51 }
Bmp * mBmp
Definition Bmp.hxx:43
xwsq_t mBit
Definition Bmp.hxx:44

◆ Bit() [2/4]

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

在文件 Bmp.hxx52 行定义.

53 : mBmp(bmp)
54 , mBit(index)
55 {
56 }

◆ Bit() [3/4]

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

在文件 Bmp.hxx57 行定义.

58 : mBit(other.mBmp, other.mBit)
59 {
60 }

◆ Bit() [4/4]

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

在文件 Bmp.hxx61 行定义.

62 : mBit(other.mBmp, other.mBit)
63 {
64 }

◆ ~Bit()

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

在文件 Bmp.hxx65 行定义.

66 {
67 }

成员函数说明

◆ operator=() [1/3]

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

在文件 Bmp.hxx68 行定义.

69 {
70 if (x) {
71 mBmp->set(mBit);
72 } else {
73 mBmp->clear(mBit);
74 }
75 return *this;
76 }
void clear()
Definition Bmp.hxx:229
void set()
Definition Bmp.hxx:193
函数调用图:

◆ operator=() [2/3]

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

在文件 Bmp.hxx77 行定义.

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

◆ operator=() [3/3]

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

在文件 Bmp.hxx85 行定义.

86 {
87 if (this != &other) {
88 mBmp = other.mBmp;
89 mBit = other.mBit;
90 }
91 return *this;
92 }

◆ operator~()

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

在文件 Bmp.hxx93 行定义.

94 {
95 mBmp->flip(mBit);
96 return *this;
97 }
void flip()
Definition Bmp.hxx:265
函数调用图:

◆ operator bool()

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

在文件 Bmp.hxx98 行定义.

99 {
100 bool ret;
101 if ((xwsq_t)mBit < TNum) {
102 ret = xwbmpop_t1i(mBmp->mData, mBit);
103 } else {
104 ret = false;
105 }
106 return ret;
107 }
xwbmp_t mData[(((TNum)+(8U *sizeof(xwbmp_t)) - 1U)/(8U *sizeof(xwbmp_t)))]
Definition Bmp.hxx:112
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.hxx108 行定义.

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

结构体成员变量说明

◆ mBmp

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

在文件 Bmp.hxx43 行定义.

◆ mBit

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

在文件 Bmp.hxx44 行定义.


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