SOLA
Loading...
Searching...
No Matches
minhton.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 MINHTON_CORE_MINHTON_H_
8#define MINHTON_CORE_MINHTON_H_
9
10#include <functional>
11#include <future>
12
13#include "minhton/core/connection_info.h"
14#include "minhton/core/node.h"
15
16// High level
17namespace minhton {
18
19enum class State { kStarted, kConnected, kIdle, kError };
20
21class Minhton {
22public:
23 Minhton(NeighborCallbackFct fct, const ConfigNode &config);
24 ~Minhton() = default;
25
26 using Entry = std::tuple<std::string, std::variant<int, float, bool, std::string>,
27 minhton::NodeData::ValueType>;
28
29 void insert(const std::vector<Entry> &data);
30 void update(const std::vector<Entry> &data);
31 void remove(const std::vector<std::string> &keys);
32 std::future<FindResult> find(const FindQuery &query);
33
34 State getState();
35
36 // DEBUG ONLY
37 MinhtonNode &getNode() { return node_; }
38
39 void stop();
40
41private:
42 MinhtonNode node_;
43};
44} // namespace minhton
45
46#endif
Definition config_node.h:30
Definition find_query.h:21
Definition node.h:34
Definition minhton.h:21
Definition minhton_watchdog_ns3.cpp:24