📄 bitary.h
字号:
/************************************************************************
*
* 文件名:bitary.h
*
* 文件描述:位数组类
*
* 创建人: jinxiongye@163.com 2006-3-6
*
* 版本号:1.0
*
* 修改记录:
*
************************************************************************/
#ifndef __OS_MODULE_BITARY_HEADER__
#define __OS_MODULE_BITARY_HEADER__
class Cbitary
{
#define ONE_BYTE_OWN_BIT_SUM 8
#define MIN_ALLOC_NUM 16
#define ALLOC_MULTIPLE 8
public:
Cbitary( unsigned long ulArySize = 0 );
~Cbitary(void);
Cbitary(const Cbitary& bits);
Cbitary& operator=(const Cbitary& bits);
bool Alloc( unsigned long ulArySize );
void Push( unsigned char uVal );
void Pop( );
void SetAll();
void ResetAll();
bool Set( unsigned long ulIndex );
bool Reset( unsigned long ulIndex );
bool Test( unsigned long ulIndex ) const;
bool TestAll() const;
void Construct( const unsigned char* pBuf, unsigned long ulBufSize, unsigned long ulBitSum );
const unsigned char* GetBuffer() {return m_pBuf;}
unsigned long GetBufSize() {return m_ulCurrUseBufSize;}
unsigned long GetBitSum() {return m_ulBitSum;}
private:
unsigned char* m_pBuf;
unsigned long m_ulBufTotalSize;
unsigned long m_ulCurrUseBufSize;
unsigned long m_ulBitSum;
static unsigned char s_aryAndMark[ONE_BYTE_OWN_BIT_SUM];
static unsigned char s_aryOrMark[ONE_BYTE_OWN_BIT_SUM];
static unsigned char s_aryOrMarkForRemainder[ONE_BYTE_OWN_BIT_SUM];
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -