SOLA
Loading...
Searching...
No Matches
algorithm_exception.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_EXCEPTION_H_
8#define MINHTON_ALGORITHMS_EXCEPTION_H_
9
10#include <cstdint>
11#include <stdexcept>
12#include <string>
13
14namespace minhton {
15
16enum class AlgorithmType : uint8_t {
17 kUndefinedAlgorithm = 0,
18 kJoinAlgorithm = 1,
19 kLeaveAlgorithm = 2,
20 kUpdatingAlgorithm = 4,
21};
22
23class AlgorithmException : public std::exception {
24public:
25 explicit AlgorithmException(const std::string &message) noexcept;
26 AlgorithmException(AlgorithmType type, const std::string &message) noexcept;
27 ~AlgorithmException() override = default;
28 const char *what() const noexcept override;
29 static std::string getAlgorithmTypeString(AlgorithmType type);
30
31private:
32 AlgorithmType type_;
33 std::string error_message_;
34};
35
36} // namespace minhton
37#endif
Definition algorithm_exception.h:23
Definition minhton_watchdog_ns3.cpp:24