Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2019-08-31 15:39:56 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-08-31 15:39:56 +0300
commit7ec30239266a04ae5feb066d8d9b9c9f77b751c9 (patch)
treec2daa7b3c1f222cf29c9c332da4e6b46de1428a9 /intern/vamr/intern/Exception.h
parent37fc5bcd8c4f80304e395e6e88ec8429e82b8152 (diff)
Rename internal VAMR files (mainly removes VAMR_ prefix)vamr-openxr-module
Also rename VAMR_internal.h to utils.h and move OpenXR include out of it.
Diffstat (limited to 'intern/vamr/intern/Exception.h')
-rw-r--r--intern/vamr/intern/Exception.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/intern/vamr/intern/Exception.h b/intern/vamr/intern/Exception.h
new file mode 100644
index 00000000000..060e8f3a458
--- /dev/null
+++ b/intern/vamr/intern/Exception.h
@@ -0,0 +1,55 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup VAMR
+ */
+
+#ifndef __EXCEPTION_H__
+#define __EXCEPTION_H__
+
+#include <exception>
+
+namespace VAMR {
+
+/**
+ * For now just a general Exception type (note that it's in namespace VAMR, so name shouldn't cause
+ * conflicts).
+ */
+class Exception : public std::exception {
+ friend class Context;
+
+ public:
+ Exception(const char *msg, const char *file, int line, int res = 0)
+ : std::exception(), m_msg(msg), m_file(file), m_line(line), m_res(res)
+ {
+ }
+
+ const char *what() const noexcept override
+ {
+ return m_msg;
+ }
+
+ private:
+ const char *m_msg;
+ const char *m_file;
+ const int m_line;
+ int m_res;
+};
+
+} // namespace VAMR
+
+#endif // __EXCEPTION_H__