yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1#ifndef SLANG_CORE_EXCEPTION_H 2#define SLANG_CORE_EXCEPTION_H 3 4#include "slang-common.h" 5#include "slang-string.h" 6 7namespace Slang 8{ 9// NOTE! 10// Exceptions should not generally be used in core/compiler-core, use the 'signal' mechanism 11// ideally using the macros in the slang-signal.h such as `SLANG_UNEXPECTED` 12// 13// If core/compiler-core libraries are compiled with SLANG_DISABLE_EXCEPTIONS, 14// these classes will *never* be thrown. 15 16class Exception 17{ 18public : 19String Message ; 20Exception () {} 21Exception (const String & message ) 22 :Message (message ) 23 { 24 } 25 26virtual ~Exception () {} 27}; 28 29class InvalidOperationException :public Exception 30{ 31public : 32InvalidOperationException () {} 33InvalidOperationException (const String & message ) 34 :Exception (message ) 35 { 36 } 37}; 38 39class InternalError :public Exception 40{ 41public : 42InternalError () {} 43InternalError (const String & message ) 44 :Exception (message ) 45 { 46 } 47}; 48 49class AbortCompilationException :public Exception 50{ 51public : 52AbortCompilationException () {} 53AbortCompilationException (const String & message ) 54 :Exception (message ) 55 { 56 } 57}; 58}// namespace Slang 59 60#endif