SOLA
Loading...
Searching...
No Matches
natter_minhcast.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 NATTER_NATTER_MINHCAST_H_
8#define NATTER_NATTER_MINHCAST_H_
9
10#include <set>
11
12#include "natter/logger_interface.h"
13#include "natter/minhcast_level_number.h"
14#include "natter/natter.h"
15#include "natter/network_info_ipv4.h"
16#include "solanet/uuid.h"
17
18namespace natter::minhcast {
19
21 LevelNumber position;
22 NetworkInfoIPv4 network_info = {};
23 solanet::UUID uuid = {};
24
25 bool operator<(const MinhcastNodeInfo &other) const {
26 // Only comparing position. All information for Minhcast is based on node position
27 return position < other.position;
28 }
29};
30
31// CRTP pattern
32class NatterMinhcast : public Natter<NatterMinhcast, MinhcastNodeInfo> {
33public:
39 NatterMinhcast(MsgReceiveFct recv_callback, MsgMissingFct missing_callback);
40
48 NatterMinhcast(MsgReceiveFct recv_callback, MsgMissingFct missing_callback,
49 const std::vector<logging::LoggerPtr> &logger, solanet::UUID node_uuid);
50
57 NatterMinhcast(MsgReceiveFct recv_callback, MsgMissingFct missing_callback,
58 const std::vector<logging::LoggerPtr> &logger);
59
60 // Disallow copy/move
61 NatterMinhcast(const NatterMinhcast &) = delete;
62 NatterMinhcast &operator=(const NatterMinhcast &) = delete;
63 NatterMinhcast(NatterMinhcast &&) = delete;
64 NatterMinhcast &operator=(NatterMinhcast &&) = delete;
65
67
68private:
69 DECLARE_CRTP_METHODS
70};
71
72} // namespace natter::minhcast
73
74#endif // NATTER_NATTER_MINHCAST_H_
Definition natter.h:26
Definition natter_minhcast.h:32
NatterMinhcast(MsgReceiveFct recv_callback, MsgMissingFct missing_callback, const std::vector< logging::LoggerPtr > &logger, solanet::UUID node_uuid)
NatterMinhcast(MsgReceiveFct recv_callback, MsgMissingFct missing_callback)
NatterMinhcast(MsgReceiveFct recv_callback, MsgMissingFct missing_callback, const std::vector< logging::LoggerPtr > &logger)
Definition network_info_ipv4.h:14
Definition natter_minhcast.h:20