引入位图
This commit is contained in:
37
include/Bitmap.h
Normal file
37
include/Bitmap.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// 版权所有 (c) ling 保留所有权利。
|
||||
// 除非另行说明,否则仅允许在DataStruct中使用此文件中的代码。
|
||||
//
|
||||
// 由 ling 创建于 24-9-7.
|
||||
//
|
||||
|
||||
#ifndef DATASTRUCT_BITMAP_H_48
|
||||
#define DATASTRUCT_BITMAP_H_48
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
namespace ling {
|
||||
/**
|
||||
* 位图
|
||||
*/
|
||||
class Bitmap {
|
||||
private:
|
||||
size_t size;
|
||||
int32_t *buf;
|
||||
public:
|
||||
explicit Bitmap(size_t size);
|
||||
|
||||
virtual ~Bitmap();
|
||||
|
||||
bool test(size_t index) const;
|
||||
|
||||
void set(size_t index);
|
||||
|
||||
void clear(size_t index);
|
||||
|
||||
size_t getSize() const;
|
||||
};
|
||||
|
||||
} // ling
|
||||
|
||||
#endif //DATASTRUCT_BITMAP_H_48
|
||||
Reference in New Issue
Block a user