SOLA
Loading...
Searching...
No Matches
interface_entity_search_algorithm.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_ALGORITHMS_ESEARCH_ENTITY_SEARCH_ALGORITHM_INTERFACE_H_
8#define MINHTON_ALGORITHMS_ESEARCH_ENTITY_SEARCH_ALGORITHM_INTERFACE_H_
9
10#include <future>
11#include <memory>
12
13#include "minhton/algorithms/algorithm_interface.h"
14#include "minhton/algorithms/esearch/find_query.h"
15#include "minhton/algorithms/esearch/node_data.h"
16#include "minhton/core/definitions.h"
17#include "minhton/message/message.h"
18
19namespace minhton {
20
22public:
23 explicit EntitySearchAlgorithmInterface(std::shared_ptr<AccessContainer> access)
24 : AlgorithmInterface(access){};
25 void process(const MessageVariant &msg) override = 0;
26
27 ~EntitySearchAlgorithmInterface() override = default;
28
29 virtual std::future<FindResult> find(FindQuery query) = 0;
30
31 virtual void localInsert(std::vector<Entry> entries) = 0;
32 virtual void localUpdate(std::vector<Entry> entries) = 0;
33 virtual void localRemove(std::vector<std::string> keys) = 0;
34
35 virtual void processTimeout(const TimeoutType &type) = 0;
36
37 static std::vector<minhton::MessageType> getSupportedMessageTypes() {
38 return {
39 MessageType::kAttributeInquiryAnswer, MessageType::kAttributeInquiryRequest,
40 MessageType::kFindQueryAnswer, MessageType::kFindQueryRequest,
41 MessageType::kSubscriptionOrder, MessageType::kSubscriptionUpdate,
42 MessageType::kSearchExactFailure // only for now
43 };
44 }
45};
46
47} // namespace minhton
48
49#endif
Definition algorithm_interface.h:18
Definition interface_entity_search_algorithm.h:21
Definition find_query.h:21
Definition minhton_watchdog_ns3.cpp:24