First commit.

This commit is contained in:
Robin Davies
2021-08-15 12:42:46 -04:00
commit d8a6022947
264 changed files with 95068 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
#pragma once
#include <exception>
namespace pipedal
{
class PiPedalException : public std::exception
{
std::string what_;
public:
PiPedalException(const std::string &what)
: std::exception(), what_(what)
{
}
virtual ~PiPedalException() {
}
virtual const char *what() const noexcept { return what_.c_str(); }
};
class PiPedalArgumentException : public PiPedalException
{
public:
PiPedalArgumentException()
: PiPedalException("Invalid argument")
{
}
PiPedalArgumentException(std::string &&what)
: PiPedalException(std::forward<std::string>(what))
{
}
};
class PiPedalStateException : public PiPedalException
{
public:
PiPedalStateException(std::string &&what)
: PiPedalException(std::forward<std::string>(what))
{
}
};
class PiPedalLogicException : public PiPedalException
{
public:
PiPedalLogicException(const char *what)
: PiPedalException(what)
{
}
};
} // namespace