slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
宏定义
slang-com-helper.h 文件参考
#include "slang.h"
#include <algorithm>
#include <atomic>
#include <iterator>
slang-com-helper.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define SLANG_HANDLE_RESULT_FAIL(x)
 
#define SLANG_RETURN_ON_FAIL(x)
 
#define SLANG_RETURN_VOID_ON_FAIL(x)
 
#define SLANG_RETURN_FALSE_ON_FAIL(x)
 Helper macro that will return false on failure.
 
#define SLANG_RETURN_NULL_ON_FAIL(x)
 Helper macro that will return nullptr on failure.
 
#define SLANG_ASSERT_ON_FAIL(x)
 
#define SLANG_ASSERT_VOID_ON_FAIL(x)
 Helper macro that will assert if the result from a call is a failure, also returns.
 

宏定义说明

◆ SLANG_ASSERT_ON_FAIL

#define SLANG_ASSERT_ON_FAIL ( x)
值:
{ \
SlangResult _res = (x); \
if (SLANG_FAILED(_res)) \
{ \
assert(false); \
return _res; \
} \
}
int32_t SlangResult
Definition slang-cpp-prelude.h:300
#define SLANG_FAILED(status)
Definition slang.h:1247

Helper macro that will assert if the return code from a call is failure, also returns the failure.

◆ SLANG_ASSERT_VOID_ON_FAIL

#define SLANG_ASSERT_VOID_ON_FAIL ( x)
值:
{ \
SlangResult _res = (x); \
if (SLANG_FAILED(_res)) \
{ \
assert(false); \
return; \
} \
}

Helper macro that will assert if the result from a call is a failure, also returns.

◆ SLANG_HANDLE_RESULT_FAIL

#define SLANG_HANDLE_RESULT_FAIL ( x)

Set SLANG_HANDLE_RESULT_FAIL(x) to code to be executed whenever an error occurs, and is detected by one of the macros

◆ SLANG_RETURN_FALSE_ON_FAIL

#define SLANG_RETURN_FALSE_ON_FAIL ( x)
值:
{ \
SlangResult _res = (x); \
if (SLANG_FAILED(_res)) \
{ \
SLANG_HANDLE_RESULT_FAIL(_res); \
return false; \
} \
}

Helper macro that will return false on failure.

◆ SLANG_RETURN_NULL_ON_FAIL

#define SLANG_RETURN_NULL_ON_FAIL ( x)
值:
{ \
SlangResult _res = (x); \
if (SLANG_FAILED(_res)) \
{ \
SLANG_HANDLE_RESULT_FAIL(_res); \
return nullptr; \
} \
}

Helper macro that will return nullptr on failure.

◆ SLANG_RETURN_ON_FAIL

#define SLANG_RETURN_ON_FAIL ( x)
值:
{ \
SlangResult _res = (x); \
if (SLANG_FAILED(_res)) \
{ \
SLANG_HANDLE_RESULT_FAIL(_res); \
return _res; \
} \
}

Helper macro, that makes it easy to add result checking to calls in functions/methods that themselves return Result.

◆ SLANG_RETURN_VOID_ON_FAIL

#define SLANG_RETURN_VOID_ON_FAIL ( x)
值:
{ \
SlangResult _res = (x); \
if (SLANG_FAILED(_res)) \
{ \
SLANG_HANDLE_RESULT_FAIL(_res); \
return; \
} \
}

Helper macro that can be used to test the return value from a call, and will return in a void method/function