SOLA
Loading...
Searching...
No Matches
find_query_request.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_MESSAGE_FIND_QUERY_REQUEST_H_
8#define MINHTON_MESSAGE_FIND_QUERY_REQUEST_H_
9
10#include <utility>
11
12#include "minhton/algorithms/esearch/find_query.h"
13#include "minhton/message/message.h"
14#include "solanet/serializer/serialize.h"
15
16namespace minhton {
20class MessageFindQueryRequest : public MinhtonMessage<MessageFindQueryRequest> {
21public:
22 enum ForwardingDirection : uint8_t {
23 kDirectionNone,
24 kDirectionLeft,
25 kDirectionRight,
26 };
27
32 ForwardingDirection forwarding_direction,
33 std::pair<uint32_t, uint32_t> interval);
34
35 FindQuery getFindQuery() const;
36 ForwardingDirection getForwardingDirection() const;
37 std::pair<uint32_t, uint32_t> getInterval() const;
38
39 SERIALIZE(header_, query_, forwarding_direction_, interval_);
40
41 MessageFindQueryRequest() = default;
42
43private:
44 friend MinhtonMessage;
45
48
50 bool validateImpl() const;
51
52 FindQuery query_;
53
54 ForwardingDirection forwarding_direction_ = kDirectionNone;
55
56 std::pair<uint32_t, uint32_t> interval_;
57};
58} // namespace minhton
59
60#endif
Definition find_query.h:21
Usage: A node that wants to find data in the network can call the Entity Search Algorithm,...
Definition find_query_request.h:20
Definition message_header.h:24
Definition message.h:28
Definition minhton_watchdog_ns3.cpp:24