mirror of
https://github.com/YuhangQ/InvoDB.git
synced 2025-01-30 16:40:56 +00:00
35 lines
592 B
C
35 lines
592 B
C
|
//
|
||
|
// Created by YuhangQ on 2021/11/1.
|
||
|
//
|
||
|
|
||
|
#ifndef INVODB_LIST_H
|
||
|
#define INVODB_LIST_H
|
||
|
|
||
|
#include "btree.h"
|
||
|
|
||
|
template<typename T, int T_SIZE>
|
||
|
class List {
|
||
|
public:
|
||
|
void insert(T const& value) {
|
||
|
tree->insert(value, 0);
|
||
|
}
|
||
|
void remove(T const& value) {
|
||
|
tree->remove(value);
|
||
|
}
|
||
|
bool exists(T const& value) {
|
||
|
return tree->exists(value);
|
||
|
}
|
||
|
std::vector<T> all() {
|
||
|
return tree->keySet();
|
||
|
}
|
||
|
List(const int& address) {
|
||
|
tree = new BTree<T, T_SIZE>(address);
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
BTree<T, T_SIZE>* tree;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //INVODB_LIST_H
|