feat(policy): began addition of robust policy system
The policy system provides a way for users to ensure that they get a network with certain traits. For example being sure that the network they get has all of the proton proton reactions in its base reaction set. This is an extensible system which is intended to be used by researchers to build various determanistic network policies to make network results more reproducable
This commit is contained in:
32
src/include/gridfire/exceptions/error_policy.h
Normal file
32
src/include/gridfire/exceptions/error_policy.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
namespace gridfire::exceptions {
|
||||
class PolicyError : std::exception {
|
||||
public:
|
||||
explicit PolicyError(const std::string& msg) : m_message(msg) {};
|
||||
|
||||
[[nodiscard]] const char* what() const noexcept override {
|
||||
return m_message.c_str();
|
||||
}
|
||||
private:
|
||||
std::string m_message;
|
||||
};
|
||||
|
||||
class MissingBaseReactionError final : public PolicyError {
|
||||
public:
|
||||
explicit MissingBaseReactionError(const std::string& msg) : PolicyError(msg) {};
|
||||
};
|
||||
|
||||
class MissingSeedSpeciesError final : public PolicyError {
|
||||
public:
|
||||
explicit MissingSeedSpeciesError(const std::string& msg) : PolicyError(msg) {};
|
||||
};
|
||||
|
||||
class MissingKeyReactionError final : public PolicyError {
|
||||
public:
|
||||
explicit MissingKeyReactionError(const std::string& msg) : PolicyError(msg) {}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user