SOLA
Loading...
Searching...
No Matches
local_data.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 ALGORITHMS_ESEARCH_LOCAL_DATA_H_
8#define ALGORITHMS_ESEARCH_LOCAL_DATA_H_
9
10#include "minhton/algorithms/esearch/node_data.h"
11
12namespace minhton {
13
14class LocalData : public NodeData {
15public:
16 std::vector<NodeInfo> getSubscribers(const NodeData::Key &key);
17
18 void addKeySubscriber(NodeData::Key key, NodeInfo &subscriber);
19 void removeKeySubscriber(const NodeData::Key &key, NodeInfo &unsubscriber);
20
21 bool isValueUpToDate(const NodeData::Key &key, uint64_t validity_threshold_timestamp) override;
22
23 bool isLocal() const override;
24
25private:
26 std::unordered_map<NodeData::Key, std::vector<NodeInfo>> key_subscribers_;
27};
28
29} // namespace minhton
30
31#endif
Definition local_data.h:14
Definition node_data.h:20
Definition node_info.h:24
Definition minhton_watchdog_ns3.cpp:24