aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/Exception.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-08-12 21:44:32 +0800
committercrupest <crupest@outlook.com>2021-08-12 21:44:32 +0800
commit2e379441f69c4fd3049d186f76b25457e6250282 (patch)
tree893771e5103ca9f3a34bb622251aaacb024cf1c2 /include/cru/platform/Exception.hpp
parentd718b0f576aeae1fa853124caefc8b0078f1deed (diff)
downloadcru-2e379441f69c4fd3049d186f76b25457e6250282.tar.gz
cru-2e379441f69c4fd3049d186f76b25457e6250282.tar.bz2
cru-2e379441f69c4fd3049d186f76b25457e6250282.zip
...
Diffstat (limited to 'include/cru/platform/Exception.hpp')
-rw-r--r--include/cru/platform/Exception.hpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/include/cru/platform/Exception.hpp b/include/cru/platform/Exception.hpp
index 8b958a1d..379753d4 100644
--- a/include/cru/platform/Exception.hpp
+++ b/include/cru/platform/Exception.hpp
@@ -1,28 +1,43 @@
#pragma once
+#include "Base.hpp"
#include "cru/common/Base.hpp"
-
-#include <stdexcept>
+#include "cru/common/Exception.hpp"
namespace cru::platform {
-class PlatformException : public std::runtime_error {
+class CRU_PLATFORM_API PlatformException : public Exception {
public:
- using runtime_error::runtime_error; // inherit constructors
+ using Exception::Exception; // inherit constructors
+
+ CRU_DEFAULT_COPY(PlatformException)
+ CRU_DEFAULT_MOVE(PlatformException)
+
+ CRU_DEFAULT_DESTRUCTOR(PlatformException)
};
// This exception is thrown when a resource is used on another platform.
// Of course, you can't mix resources of two different platform.
// For example, Win32 Brush (may add in the future) with Direct Painter.
-class UnsupportPlatformException : public std::runtime_error {
+class CRU_PLATFORM_API UnsupportPlatformException : public Exception {
public:
- using runtime_error::runtime_error; // inherit constructors
+ using Exception::Exception; // inherit constructors
+
+ CRU_DEFAULT_COPY(UnsupportPlatformException)
+ CRU_DEFAULT_MOVE(UnsupportPlatformException)
+
+ CRU_DEFAULT_DESTRUCTOR(UnsupportPlatformException)
};
// This exception is thrown when a resource has been disposed and not usable
// again.
// For example, calling Build twice on a GeometryBuilder::Build will lead to
// this exception.
-class ReuseException : public std::runtime_error {
+class CRU_PLATFORM_API ReuseException : public Exception {
public:
- using runtime_error::runtime_error; // inherit constructors
+ using Exception::Exception; // inherit constructors
+
+ CRU_DEFAULT_COPY(ReuseException)
+ CRU_DEFAULT_MOVE(ReuseException)
+
+ CRU_DEFAULT_DESTRUCTOR(ReuseException)
};
} // namespace cru::platform