BioCMAMC-ST
simulation_exception.hpp
1#ifndef __SIMULATION_EXCEPTION_HPP__
2#define __SIMULATION_EXCEPTION_HPP__
3
4#include <exception>
5#include <source_location>
6
7namespace Simulation
8{
9
19
26
27 class SimulationException : public std::exception
28 {
29 public:
30 [[nodiscard]] virtual const std::source_location& where() const noexcept
31 = 0;
32 };
33
35 {
36 public:
38 std::source_location loc
39 = std::source_location::current());
40 [[nodiscard]] const char* what() const noexcept override;
41 [[nodiscard]] const std::source_location& where() const noexcept override;
42
43 private:
45 std::source_location loc_;
46 };
47
49 {
50 public:
52 std::source_location loc
53 = std::source_location::current());
54 [[nodiscard]] const char* what() const noexcept override;
55 [[nodiscard]] const std::source_location& where() const noexcept override;
56
57 private:
59 std::source_location loc_;
60 };
61} // namespace Simulation
62
63#endif
const char * what() const noexcept override
Definition simulation_exception.cpp:16
ErrorCodes code_
Definition simulation_exception.hpp:44
BaseSimulationException(ErrorCodes code, std::source_location loc=std::source_location::current())
Definition simulation_exception.cpp:9
std::source_location loc_
Definition simulation_exception.hpp:45
FeedExceptionError code_
Definition simulation_exception.hpp:58
const char * what() const noexcept override
Definition simulation_exception.cpp:49
std::source_location loc_
Definition simulation_exception.hpp:59
const std::source_location & where() const noexcept override
Definition simulation_exception.cpp:64
FeedException(FeedExceptionError code, std::source_location loc=std::source_location::current())
Definition simulation_exception.cpp:42
Definition simulation_exception.hpp:28
virtual const std::source_location & where() const noexcept=0
Namespace that contains classes and structures related to simulation handling.
Definition host_specific.hpp:12
ErrorCodes
Definition simulation_exception.hpp:11
@ MismatchSize
Definition simulation_exception.hpp:16
@ MismatchSizeVolume
Definition simulation_exception.hpp:17
@ Unknown
Definition simulation_exception.hpp:12
@ BadConcentrationInitLiq
Definition simulation_exception.hpp:13
@ BadConcentrationInitGas
Definition simulation_exception.hpp:14
@ BadInitialiser
Definition simulation_exception.hpp:15
FeedExceptionError
Definition simulation_exception.hpp:21
@ OutofRange
Definition simulation_exception.hpp:24
@ NegativeConcentration
Definition simulation_exception.hpp:23
@ NegativeFlow
Definition simulation_exception.hpp:22