37 lines
623 B
C++
37 lines
623 B
C++
//
|
|
// Created by Kirill Zhukov on 20.04.2025.
|
|
//
|
|
|
|
#ifndef DATABASEMANAGER_H
|
|
#define DATABASEMANAGER_H
|
|
|
|
#include "UDB.h"
|
|
#include "utils/toml/toml.hpp"
|
|
#include <vector>
|
|
#include <thread>
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace usub::core
|
|
{
|
|
class DatabaseManager
|
|
{
|
|
public:
|
|
explicit DatabaseManager(const std::string& config_path);
|
|
|
|
void run_all();
|
|
|
|
private:
|
|
struct DatabaseInstance
|
|
{
|
|
std::unique_ptr<UDB> udb;
|
|
std::thread worker;
|
|
};
|
|
|
|
std::vector<DatabaseInstance> databases_;
|
|
};
|
|
} // core
|
|
// usub
|
|
|
|
#endif //DATABASEMANAGER_H
|