SOLA
Loading...
Searching...
No Matches
storage.h
1// Copyright The SOLA Contributors
2//
3// Licensed under the MIT License.
4// For details on the licensing terms, see the LICENSE file.
5// SPDX-License-Identifier: MIT
6
7#ifndef SOLA_STORAGE_STORAGE_H_
8#define SOLA_STORAGE_STORAGE_H_
9
10#include <future>
11#include <string>
12#include <variant>
13#include <vector>
14
15#include "minhton/core/definitions.h"
16namespace sola {
17
18struct Request {
19 bool all; // false -> some results are enough -> more efficient
20 bool permissive; // true -> results that dont fully satisfy query could be returned -> more
21 // efficient
22 std::string request;
23};
24
25using Entry = std::tuple<std::string, std::variant<int, float, bool, std::string>>;
26
27class Storage {
28public:
29 virtual ~Storage() = default;
30 virtual void insert(std::vector<Entry> entry) = 0;
31 // virtual void update() = 0;
32 // virtual void remove() = 0;
33 virtual std::future<minhton::FindResult> find(Request r) = 0;
34
35 virtual void stop() = 0;
36 virtual bool canStop() const = 0;
37};
38} // namespace sola
39
40#endif
Definition storage.h:27
Definition storage.h:18