SOLA
Loading...
Searching...
No Matches
interface_response_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_MISC_RESPONSE_ALGORITHM_INTERFACE_H_
8#define MINHTON_ALGORITHMS_MISC_RESPONSE_ALGORITHM_INTERFACE_H_
9
10#include <functional>
11#include <memory>
12
13#include "minhton/algorithms/algorithm_interface.h"
14#include "minhton/message/message.h"
15
16namespace minhton {
17
19public:
20 explicit ResponseAlgorithmInterface(std::shared_ptr<AccessContainer> access)
21 : AlgorithmInterface(access){};
22 void process(const MessageVariant &msg) override = 0;
23 virtual void waitForAcks(uint32_t number, std::function<void()> cb) = 0;
24
25 ~ResponseAlgorithmInterface() override = default;
26
27 static std::vector<minhton::MessageType> getSupportedMessageTypes() {
28 return {
29 MessageType::kUpdateNeighbors, MessageType::kGetNeighbors,
30 MessageType::kRemoveNeighbor, MessageType::kInformAboutNeighbors,
31 MessageType::kRemoveAndUpdateNeighbor, MessageType::kRemoveNeighborAck,
32 };
33 }
34
35protected:
36 uint32_t number_ = 0;
37 std::function<void()> cb_;
38};
39
40} // namespace minhton
41
42#endif
Definition algorithm_interface.h:18
Definition interface_response_algorithm.h:18
Definition minhton_watchdog_ns3.cpp:24