Files
DataStruct/include/Bitmap.h
2024-09-07 20:51:43 +08:00

38 lines
665 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 版权所有 (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