mirror of
https://github.com/YuhangQ/InvoDB.git
synced 2025-01-28 23:50:59 +00:00
40 lines
881 B
C++
40 lines
881 B
C++
//
|
|
// Created by YuhangQ on 2021/10/9.
|
|
//
|
|
|
|
#ifndef INVODB_COLLECTION_H
|
|
#define INVODB_COLLECTION_H
|
|
|
|
#include "file/page_manager.h"
|
|
#include "utils/logger.h"
|
|
#include "btree/btree.h"
|
|
#include "json/json.hpp"
|
|
#include <map>
|
|
#include <set>
|
|
#include <algorithm>
|
|
#include <cstring>
|
|
#include "utils/uuid.h"
|
|
|
|
class Collection {
|
|
public:
|
|
void insert(nlohmann::json &json);
|
|
|
|
static void loadCollections();
|
|
static Collection& getCollection(const std::string& name);
|
|
static Collection& createCollection(const std::string& name);
|
|
private:
|
|
static std::map<std::string, Collection*> map;
|
|
static std::set<int> free;
|
|
|
|
BTree<3, std::string, 32> *tree;
|
|
|
|
Collection(const std::string& name,const int& firstPage);
|
|
Collection() {}
|
|
~Collection() {}
|
|
Collection(const Collection&);
|
|
Collection& operator=(const Collection&);
|
|
};
|
|
|
|
|
|
#endif //INVODB_COLLECTION_H
|