MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
bitmap.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by wangyunlai on 2021/5/7.
13//
14
15#pragma once
16
17namespace common {
18
19class Bitmap
20{
21public:
22 Bitmap();
23 Bitmap(char *bitmap, int size);
24
25 void init(char *bitmap, int size);
26 bool get_bit(int index);
27 void set_bit(int index);
28 void clear_bit(int index);
29
33 int next_unsetted_bit(int start);
34 int next_setted_bit(int start);
35
36private:
37 char *bitmap_;
38 int size_;
39};
40
41} // namespace common
Definition: bitmap.h:20
int next_unsetted_bit(int start)
Definition: bitmap.cpp:68