MeshLib C Docs
Loading...
Searching...
No Matches
__mrbind_c_details.h File Reference
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stdexcept>
#include <utility>
#include <type_traits>

Go to the source code of this file.

Classes

struct  mrbindc_details::ClassArgGuard< T >

Namespaces

namespace  mrbindc_details

Macros

#define MRC_ENABLE_EXCEPTIONS   0
#define MRBINDC_THROW(message_, ...)
#define MRBINDC_CLASSARG_DEF_CTOR(param_, ...)
#define MRBINDC_CLASSARG_COPY(param_, cpp_type_without_wrapper_, ...)
#define MRBINDC_CLASSARG_MOVE(param_, cpp_type_without_wrapper_, ...)
#define MRBINDC_CLASSARG_DEF_ARG(param_, enum_constant_, default_arg_, ...)
#define MRBINDC_CLASSARG_NO_DEF_ARG(param_, enum_constant_, ...)
#define MRBINDC_CLASSARG_END(param_, ...)
#define MRBINDC_CLASSARG_GUARD(param_, ...)
#define MRBINDC_IDENTITY(...)
#define MRBINDC_IGNORE_DEPRECATION(...)
#define MRBINDC_BIT_CAST(p_type_, ...)

Functions

MRC_API void mrbindc_details::ThrowWithExceptionsDisabled (const char *message)
template<typename T>
constexpr T & mrbindc_details::unmove (T &&value)

Macro Definition Documentation

◆ MRBINDC_BIT_CAST

#define MRBINDC_BIT_CAST ( p_type_,
... )
Value:
(MRBINDC_IDENTITY p_type_ (reinterpret_cast<std::add_lvalue_reference_t<std::add_const_t<MRBINDC_IDENTITY p_type_>>>(mrbindc_details::unmove(__VA_ARGS__))))
#define MRBINDC_IDENTITY(...)
Definition __mrbind_c_details.h:65
constexpr T & unmove(T &&value)
Definition __mrbind_c_details.h:61

◆ MRBINDC_CLASSARG_COPY

#define MRBINDC_CLASSARG_COPY ( param_,
cpp_type_without_wrapper_,
... )
Value:
param_##_pass_by == MR_PassBy_Copy ? __VA_ARGS__(*(MRBINDC_IDENTITY cpp_type_without_wrapper_ *)param_) :
@ MR_PassBy_Copy
Definition common.h:15

◆ MRBINDC_CLASSARG_DEF_ARG

#define MRBINDC_CLASSARG_DEF_ARG ( param_,
enum_constant_,
default_arg_,
... )
Value:
param_##_pass_by == enum_constant_ ? (param_ ? MRBINDC_THROW("Expected a null pointer to be passed to `" #param_ " because `" #enum_constant_ "` was used.", __VA_ARGS__) : __VA_ARGS__(default_arg_)) :
#define MRBINDC_THROW(message_,...)
Definition __mrbind_c_details.h:24

◆ MRBINDC_CLASSARG_DEF_CTOR

#define MRBINDC_CLASSARG_DEF_CTOR ( param_,
... )
Value:
param_##_pass_by == MR_PassBy_DefaultConstruct ? (param_ ? MRBINDC_THROW("Expected a null pointer to be passed to `" #param_ " because `MR_PassBy_DefaultConstruct` was used.", __VA_ARGS__) : __VA_ARGS__{}) :
@ MR_PassBy_DefaultConstruct
Definition common.h:14

◆ MRBINDC_CLASSARG_END

#define MRBINDC_CLASSARG_END ( param_,
... )
Value:
true ? MRBINDC_THROW("Invalid `MR_PassBy` enum value specified for function parameter `" #param_ ".", __VA_ARGS__) : ((__VA_ARGS__ (*)())0)()

◆ MRBINDC_CLASSARG_GUARD

#define MRBINDC_CLASSARG_GUARD ( param_,
... )
Value:
mrbindc_details::ClassArgGuard<__VA_ARGS__> _classarg_guard_##param_((__VA_ARGS__ *)param_, param_##_pass_by)
Definition __mrbind_c_details.h:39

◆ MRBINDC_CLASSARG_MOVE

#define MRBINDC_CLASSARG_MOVE ( param_,
cpp_type_without_wrapper_,
... )
Value:
param_##_pass_by == MR_PassBy_Move ? __VA_ARGS__(std::move(*(MRBINDC_IDENTITY cpp_type_without_wrapper_ *)param_)) :
@ MR_PassBy_Move
Definition common.h:16

◆ MRBINDC_CLASSARG_NO_DEF_ARG

#define MRBINDC_CLASSARG_NO_DEF_ARG ( param_,
enum_constant_,
... )
Value:
param_##_pass_by == enum_constant_ ? MRBINDC_THROW("Function parameter `" #param_ " doesn't support `" #enum_constant_ "`.", __VA_ARGS__) :

◆ MRBINDC_IDENTITY

#define MRBINDC_IDENTITY ( ...)
Value:
__VA_ARGS__

◆ MRBINDC_IGNORE_DEPRECATION

#define MRBINDC_IGNORE_DEPRECATION ( ...)
Value:
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") __VA_ARGS__ _Pragma("GCC diagnostic pop")

◆ MRBINDC_THROW

#define MRBINDC_THROW ( message_,
... )
Value:
(mrbindc_details::ThrowWithExceptionsDisabled(message_), ((__VA_ARGS__ (*)())0)())
MRC_API void ThrowWithExceptionsDisabled(const char *message)

◆ MRC_ENABLE_EXCEPTIONS

#define MRC_ENABLE_EXCEPTIONS   0