MOS Source Code
Loading...
Searching...
No Matches
macro_magic.h File Reference
#include <mos/mos_global.h>
+ Include dependency graph for macro_magic.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RPC_DEFINE_ENUMS(name, NAME, X_MACRO)
 
#define X_GENERATE_ENUM(prefix, id, name, NAME, ...)
 
#define X_GENERATE_FUNCTION_STUB_IMPL_ARGS(prefix, id, name, NAME, spec, ...)
 
#define X_GENERATE_FUNCTION_STUB_IMPL_PB(prefix, id, name, NAME, reqtype, resptype)
 
#define RPC_DECLARE_CLIENT(prefix, X_MACRO)
 
#define X_GENERATE_FUNCTION_STUB_IMPL_CLASS_ARGS(prefix, id, name, NAME, spec, ...)
 
#define X_GENERATE_FUNCTION_STUB_IMPL_CLASS_PB(prefix, id, name, NAME, reqtype, resptype)
 
#define RPC_CLIENT_DEFINE_STUB_CLASS(_class_name, X_MACRO)
 
#define FOR_EACH_ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, N, ...)
 
#define EXPAND(x)
 
#define FOR_EACH_0(what, ...)
 
#define FOR_EACH_1(what, x, ...)
 
#define FOR_EACH_2(what, x, ...)
 
#define FOR_EACH_3(what, x, ...)
 
#define FOR_EACH_4(what, x, ...)
 
#define FOR_EACH_5(what, x, ...)
 
#define FOR_EACH_6(what, x, ...)
 
#define FOR_EACH_7(what, x, ...)
 
#define FOR_EACH_8(what, x, ...)
 
#define FOR_EACH_9(what, x, ...)
 
#define FOR_EACH_RSEQ_N()
 
#define FOR_EACH_NARG_(...)
 
#define FOR_EACH_NARG(...)
 
#define FOR_EACH_(N, what, ...)
 
#define FOR_EACH(what, ...)
 
#define X_EXTRACT_NAME_ARG(type, name)
 
#define RPC_EXTRACT_NAME(y)
 
#define _RPC_ARGTYPE_UINT8   u8
 
#define _RPC_ARGTYPE_UINT16   u16
 
#define _RPC_ARGTYPE_UINT32   u32
 
#define _RPC_ARGTYPE_UINT64   u64
 
#define _RPC_ARGTYPE_INT8   s8
 
#define _RPC_ARGTYPE_INT16   s16
 
#define _RPC_ARGTYPE_INT32   s32
 
#define _RPC_ARGTYPE_INT64   s64
 
#define _RPC_ARGTYPE_STRING   const char *
 
#define _RPC_ARGTYPE_BUFFER   const void *
 
#define _RPC_GETARG_UINT8   u8
 
#define _RPC_GETARG_UINT16   u16
 
#define _RPC_GETARG_UINT32   u32
 
#define _RPC_GETARG_UINT64   u64
 
#define _RPC_GETARG_INT8   s8
 
#define _RPC_GETARG_INT16   s16
 
#define _RPC_GETARG_INT32   s32
 
#define _RPC_GETARG_INT64   s64
 
#define _RPC_GETARG_STRING   string
 
#define _RPC_GETARG_BUFFER   buffer
 
#define X_GENERATE_PROTOTYPE_ARG(type, name)
 
#define RPC_GENERATE_PROTOTYPE(y)
 
#define X_RPC_DO_GET_ARG(type, name)
 
#define X_RPC_GET_ARG(arg)
 
#define X_GENERATE_FUNCTION_FORWARDS_ARGS(prefix, _id, _func, _FUNC, _spec, ...)
 
#define X_GENERATE_FUNCTION_FORWARDS_PB(prefix, _id, _func, _FUNC, reqtype, resptype)
 
#define X_NARGS_IMPL(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, N, ...)
 
#define X_NARGS(...)
 
#define X_GENERATE_FUNCTION_INFO_ARGS_X(X)
 
#define X_GENERATE_FUNCTION_INFO_ARGS_X_ARG(TYPE, _)
 
#define X_GENERATE_FUNCTION_INFO_ARGS_X_PB(TYPE, _)
 
#define X_DO_MAKE_FUNCINFO(_fid, _func, _nargs, _argtypes)
 
#define X_DO_GENERATE_FUNCTION_INFO_ARGS(_fid, _func, _nargs, ...)
 
#define X_DO_GENERATE_FUNCTION_INFO_PB(_fid, _func)
 
#define X_GENERATE_FUNCTION_INFO_ARGS(prefix, fid, func, _1, _2, ...)
 
#define X_GENERATE_FUNCTION_INFO_PB(prefix, fid, func, _1, _2, ...)
 
#define RPC_DECLARE_SERVER(prefix, X_MACRO)
 
#define X_GENERATE_NULL_FUNC_INFO_ARGS(unused, fid, func, _1, _2, ...)
 
#define X_GENERATE_NULL_FUNC_INFO_PB(unused, fid, func, _1, _2, ...)
 
#define X_GENERATE_SWITCH_CASE_CLASS_ARGS(unused, id, name, NAME, spec, ...)
 
#define X_GENERATE_SWITCH_CASE_CLASS_PB(unused, id, name, NAME, reqtype, resptype)
 
#define __X_GENERATE_FUNCTION_FORWARDS_ARGS_CPP_CLASS(_prefix, _id, func, _FUNC, _spec, ...)
 
#define __X_GENERATE_FUNCTION_FORWARDS_PB_CPP_CLASS(_prefix, _id, func, _FUNC, reqtype, resptype)
 
#define __RPC_DEFINE_SERVER_CPP_CLASS_WRAPPER(X_MACRO)
 
#define RPC_DECL_SERVER_INTERFACE_CLASS(classname, X_MACRO)
 
#define __RPC_DO_DECL_CPP_TYPE_NAMESPACE_ALIAS_IMPL(subns, _id, action, ...)
 
#define RPC_DECL_CPP_TYPE_NAMESPACE(subns, X_MACRO)
 

Macro Definition Documentation

◆ RPC_DEFINE_ENUMS

#define RPC_DEFINE_ENUMS ( name,
NAME,
X_MACRO )
Value:
MOS_WARNING_PUSH \
MOS_WARNING_DISABLE("-Wgnu-zero-variadic-macro-arguments") \
typedef enum \
{ \
X_MACRO(X_GENERATE_ENUM, X_GENERATE_ENUM, NAME##_) \
} name##_rpc_functions; \
#define X_GENERATE_ENUM(prefix, id, name, NAME,...)
Definition macro_magic.h:69
#define MOS_WARNING_POP
Definition mos_global.h:70
const char * name
Definition slab.c:31

Definition at line 60 of file macro_magic.h.

◆ X_GENERATE_ENUM

#define X_GENERATE_ENUM ( prefix,
id,
name,
NAME,
... )
Value:
prefix##NAME = id,

Definition at line 69 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_STUB_IMPL_ARGS

#define X_GENERATE_FUNCTION_STUB_IMPL_ARGS ( prefix,
id,
name,
NAME,
spec,
... )
Value:
{ \
if (unlikely(spec == NULL)) \
return rpc_simple_call(server_stub, id, NULL, spec FOR_EACH(RPC_EXTRACT_NAME, __VA_ARGS__)); \
}
#define FOR_EACH(what,...)
#define RPC_EXTRACT_NAME(y)
#define RPC_GENERATE_PROTOTYPE(y)
#define should_inline
Definition mos_global.h:37
#define unlikely(x)
Definition mos_global.h:40
#define NULL
Definition pb_syshdr.h:46
rpc_result_code_t
Definition rpc.h:25
@ RPC_RESULT_INVALID_ARGUMENT
Definition rpc.h:30
MOSAPI rpc_result_code_t rpc_simple_call(rpc_server_stub_t *stub, u32 funcid, rpc_result_t *result, const char *argspec,...)
Call a function on the server.
Definition rpc_client.c:222

Definition at line 72 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_STUB_IMPL_PB

#define X_GENERATE_FUNCTION_STUB_IMPL_PB ( prefix,
id,
name,
NAME,
reqtype,
resptype )
Value:
should_inline rpc_result_code_t prefix##name(rpc_server_stub_t *server_stub, const reqtype *request, resptype *response) \
{ \
return rpc_do_pb_call(server_stub, id, reqtype##_fields, request, resptype##_fields, response); \
}
MOSAPI rpc_result_code_t rpc_do_pb_call(rpc_server_stub_t *stub, u32 funcid, const pb_msgdesc_t *reqm, const void *req, const pb_msgdesc_t *respm, void *resp)
Call a function on the server using protobuf (nanopb)
Definition rpc_client.c:298

Definition at line 80 of file macro_magic.h.

◆ RPC_DECLARE_CLIENT

#define RPC_DECLARE_CLIENT ( prefix,
X_MACRO )
Value:
MOS_WARNING_PUSH \
MOS_WARNING_DISABLE("-Wgnu-zero-variadic-macro-arguments") \
#define X_GENERATE_FUNCTION_STUB_IMPL_ARGS(prefix, id, name, NAME, spec,...)
Definition macro_magic.h:72
#define X_GENERATE_FUNCTION_STUB_IMPL_PB(prefix, id, name, NAME, reqtype, resptype)
Definition macro_magic.h:80

Definition at line 87 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_STUB_IMPL_CLASS_ARGS

#define X_GENERATE_FUNCTION_STUB_IMPL_CLASS_ARGS ( prefix,
id,
name,
NAME,
spec,
... )
Value:
{ \
if (unlikely(spec == NULL)) \
return rpc_simple_call(this->server_stub, id, NULL, spec FOR_EACH(RPC_EXTRACT_NAME, __VA_ARGS__)); \
}

Definition at line 94 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_STUB_IMPL_CLASS_PB

#define X_GENERATE_FUNCTION_STUB_IMPL_CLASS_PB ( prefix,
id,
name,
NAME,
reqtype,
resptype )
Value:
rpc_result_code_t prefix##name(const reqtype *request, resptype *response) \
{ \
return rpc_do_pb_call(this->server_stub, id, reqtype##_fields, request, resptype##_fields, response); \
}

Definition at line 102 of file macro_magic.h.

◆ RPC_CLIENT_DEFINE_STUB_CLASS

#define RPC_CLIENT_DEFINE_STUB_CLASS ( _class_name,
X_MACRO )
Value:
class _class_name \
{ \
public: \
explicit _class_name(const std::string &servername) : server_stub(rpc_client_create(servername.c_str())) {}; \
~_class_name() \
{ \
rpc_client_destroy(server_stub); \
} \
rpc_server_stub_t *get() const \
{ \
return server_stub; \
} \
\
private: \
rpc_server_stub_t *server_stub; \
};
#define X_GENERATE_FUNCTION_STUB_IMPL_CLASS_PB(prefix, id, name, NAME, reqtype, resptype)
#define X_GENERATE_FUNCTION_STUB_IMPL_CLASS_ARGS(prefix, id, name, NAME, spec,...)
Definition macro_magic.h:94
MOSAPI rpc_server_stub_t * rpc_client_create(const char *server_name)
Create a new RPC client stub for the given server.
Definition rpc_client.c:65

Definition at line 108 of file macro_magic.h.

◆ FOR_EACH_ARG_N

#define FOR_EACH_ARG_N ( _1,
_2,
_3,
_4,
_5,
_6,
_7,
_8,
N,
... )
Value:
N

Definition at line 127 of file macro_magic.h.

◆ EXPAND

#define EXPAND ( x)
Value:
x

Definition at line 129 of file macro_magic.h.

◆ FOR_EACH_0

#define FOR_EACH_0 ( what,
... )

Definition at line 130 of file macro_magic.h.

◆ FOR_EACH_1

#define FOR_EACH_1 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_0(what, __VA_ARGS__))
#define FOR_EACH_0(what,...)
#define EXPAND(x)

Definition at line 131 of file macro_magic.h.

◆ FOR_EACH_2

#define FOR_EACH_2 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_1(what, __VA_ARGS__))
#define FOR_EACH_1(what, x,...)

Definition at line 132 of file macro_magic.h.

◆ FOR_EACH_3

#define FOR_EACH_3 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_2(what, __VA_ARGS__))
#define FOR_EACH_2(what, x,...)

Definition at line 133 of file macro_magic.h.

◆ FOR_EACH_4

#define FOR_EACH_4 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_3(what, __VA_ARGS__))
#define FOR_EACH_3(what, x,...)

Definition at line 134 of file macro_magic.h.

◆ FOR_EACH_5

#define FOR_EACH_5 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_4(what, __VA_ARGS__))
#define FOR_EACH_4(what, x,...)

Definition at line 135 of file macro_magic.h.

◆ FOR_EACH_6

#define FOR_EACH_6 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_5(what, __VA_ARGS__))
#define FOR_EACH_5(what, x,...)

Definition at line 136 of file macro_magic.h.

◆ FOR_EACH_7

#define FOR_EACH_7 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_6(what, __VA_ARGS__))
#define FOR_EACH_6(what, x,...)

Definition at line 137 of file macro_magic.h.

◆ FOR_EACH_8

#define FOR_EACH_8 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_7(what, __VA_ARGS__))
#define FOR_EACH_7(what, x,...)

Definition at line 138 of file macro_magic.h.

◆ FOR_EACH_9

#define FOR_EACH_9 ( what,
x,
... )
Value:
what(x) EXPAND(FOR_EACH_8(what, __VA_ARGS__))
#define FOR_EACH_8(what, x,...)

Definition at line 139 of file macro_magic.h.

◆ FOR_EACH_RSEQ_N

#define FOR_EACH_RSEQ_N ( )
Value:
8, 7, 6, 5, 4, 3, 2, 1, 0

Definition at line 140 of file macro_magic.h.

◆ FOR_EACH_NARG_

#define FOR_EACH_NARG_ ( ...)
Value:
EXPAND(FOR_EACH_ARG_N(__VA_ARGS__))
#define FOR_EACH_ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, N,...)

Definition at line 141 of file macro_magic.h.

◆ FOR_EACH_NARG

#define FOR_EACH_NARG ( ...)
Value:
#define FOR_EACH_RSEQ_N()
#define FOR_EACH_NARG_(...)

Definition at line 142 of file macro_magic.h.

◆ FOR_EACH_

#define FOR_EACH_ ( N,
what,
... )
Value:
EXPAND(MOS_CONCAT(FOR_EACH_, N)(what, __VA_ARGS__))
#define FOR_EACH_(N, what,...)
#define MOS_CONCAT(a, b)
Definition mos_global.h:67

Definition at line 143 of file macro_magic.h.

◆ FOR_EACH

#define FOR_EACH ( what,
... )
Value:
__VA_OPT__(FOR_EACH_(FOR_EACH_NARG(__VA_ARGS__), what, __VA_ARGS__))
#define FOR_EACH_NARG(...)

Definition at line 144 of file macro_magic.h.

◆ X_EXTRACT_NAME_ARG

#define X_EXTRACT_NAME_ARG ( type,
name )
Value:

Definition at line 146 of file macro_magic.h.

◆ RPC_EXTRACT_NAME

#define RPC_EXTRACT_NAME ( y)
Value:
X_EXTRACT_NAME_##y

Definition at line 147 of file macro_magic.h.

◆ _RPC_ARGTYPE_UINT8

#define _RPC_ARGTYPE_UINT8   u8

Definition at line 149 of file macro_magic.h.

◆ _RPC_ARGTYPE_UINT16

#define _RPC_ARGTYPE_UINT16   u16

Definition at line 150 of file macro_magic.h.

◆ _RPC_ARGTYPE_UINT32

#define _RPC_ARGTYPE_UINT32   u32

Definition at line 151 of file macro_magic.h.

◆ _RPC_ARGTYPE_UINT64

#define _RPC_ARGTYPE_UINT64   u64

Definition at line 152 of file macro_magic.h.

◆ _RPC_ARGTYPE_INT8

#define _RPC_ARGTYPE_INT8   s8

Definition at line 153 of file macro_magic.h.

◆ _RPC_ARGTYPE_INT16

#define _RPC_ARGTYPE_INT16   s16

Definition at line 154 of file macro_magic.h.

◆ _RPC_ARGTYPE_INT32

#define _RPC_ARGTYPE_INT32   s32

Definition at line 155 of file macro_magic.h.

◆ _RPC_ARGTYPE_INT64

#define _RPC_ARGTYPE_INT64   s64

Definition at line 156 of file macro_magic.h.

◆ _RPC_ARGTYPE_STRING

#define _RPC_ARGTYPE_STRING   const char *

Definition at line 157 of file macro_magic.h.

◆ _RPC_ARGTYPE_BUFFER

#define _RPC_ARGTYPE_BUFFER   const void *

Definition at line 158 of file macro_magic.h.

◆ _RPC_GETARG_UINT8

#define _RPC_GETARG_UINT8   u8

Definition at line 160 of file macro_magic.h.

◆ _RPC_GETARG_UINT16

#define _RPC_GETARG_UINT16   u16

Definition at line 161 of file macro_magic.h.

◆ _RPC_GETARG_UINT32

#define _RPC_GETARG_UINT32   u32

Definition at line 162 of file macro_magic.h.

◆ _RPC_GETARG_UINT64

#define _RPC_GETARG_UINT64   u64

Definition at line 163 of file macro_magic.h.

◆ _RPC_GETARG_INT8

#define _RPC_GETARG_INT8   s8

Definition at line 164 of file macro_magic.h.

◆ _RPC_GETARG_INT16

#define _RPC_GETARG_INT16   s16

Definition at line 165 of file macro_magic.h.

◆ _RPC_GETARG_INT32

#define _RPC_GETARG_INT32   s32

Definition at line 166 of file macro_magic.h.

◆ _RPC_GETARG_INT64

#define _RPC_GETARG_INT64   s64

Definition at line 167 of file macro_magic.h.

◆ _RPC_GETARG_STRING

#define _RPC_GETARG_STRING   string

Definition at line 168 of file macro_magic.h.

◆ _RPC_GETARG_BUFFER

#define _RPC_GETARG_BUFFER   buffer

Definition at line 169 of file macro_magic.h.

◆ X_GENERATE_PROTOTYPE_ARG

#define X_GENERATE_PROTOTYPE_ARG ( type,
name )
Value:
, __maybe_unused _RPC_ARGTYPE_##type name
#define __maybe_unused
Definition mos_global.h:33

Definition at line 171 of file macro_magic.h.

◆ RPC_GENERATE_PROTOTYPE

#define RPC_GENERATE_PROTOTYPE ( y)
Value:
X_GENERATE_PROTOTYPE_##y

Definition at line 172 of file macro_magic.h.

◆ X_RPC_DO_GET_ARG

#define X_RPC_DO_GET_ARG ( type,
name )
Value:
_RPC_ARGTYPE_##type name = MOS_CONCAT(rpc_arg_next_, EXPAND(_RPC_GETARG_##type))(context);

Definition at line 175 of file macro_magic.h.

◆ X_RPC_GET_ARG

#define X_RPC_GET_ARG ( arg)
Value:
X_RPC_DO_GET_##arg

Definition at line 176 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_FORWARDS_ARGS

#define X_GENERATE_FUNCTION_FORWARDS_ARGS ( prefix,
_id,
_func,
_FUNC,
_spec,
... )
Value:
static rpc_result_code_t prefix##_func(rpc_context_t *context __VA_OPT__(FOR_EACH(RPC_GENERATE_PROTOTYPE, __VA_ARGS__))); \
static rpc_result_code_t prefix##_func##_wrapper(rpc_context_t *context) \
{ \
__VA_OPT__(FOR_EACH(X_RPC_GET_ARG, __VA_ARGS__)) \
return prefix##_func(context FOR_EACH(RPC_EXTRACT_NAME, __VA_ARGS__)); \
}
#define X_RPC_GET_ARG(arg)

Definition at line 178 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_FORWARDS_PB

#define X_GENERATE_FUNCTION_FORWARDS_PB ( prefix,
_id,
_func,
_FUNC,
reqtype,
resptype )
Value:
static rpc_result_code_t prefix##_func(rpc_context_t *context, reqtype *req, resptype *resp); \
static rpc_result_code_t prefix##_func##_pb_wrapper(rpc_context_t *context) \
{ \
reqtype req = { 0 }; \
if (!rpc_arg_pb(context, reqtype##_fields, &req, 0)) \
resptype resp = resptype##_init_zero; \
const rpc_result_code_t result = prefix##_func(context, &req, &resp); \
pb_release(reqtype##_fields, &req); \
rpc_write_result_pb(context, resptype##_fields, &resp); \
pb_release(resptype##_fields, &resp); \
return result; \
}
@ RPC_RESULT_SERVER_INTERNAL_ERROR
Definition rpc.h:29
MOSAPI bool rpc_arg_pb(rpc_context_t *context, const pb_msgdesc_t *type_fields, void *val, size_t argid)
Definition rpc_server.c:435

Definition at line 186 of file macro_magic.h.

◆ X_NARGS_IMPL

#define X_NARGS_IMPL ( _1,
_2,
_3,
_4,
_5,
_6,
_7,
_8,
_9,
_10,
_11,
_12,
_13,
_14,
_15,
_16,
_17,
N,
... )
Value:
N

Definition at line 202 of file macro_magic.h.

◆ X_NARGS

#define X_NARGS ( ...)
Value:
X_NARGS_IMPL(_ __VA_OPT__(, ) __VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, _err)
#define X_NARGS_IMPL(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, N,...)

Definition at line 203 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_INFO_ARGS_X

#define X_GENERATE_FUNCTION_INFO_ARGS_X ( X)
Value:
X_GENERATE_FUNCTION_INFO_ARGS_X_##X

Definition at line 206 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_INFO_ARGS_X_ARG

#define X_GENERATE_FUNCTION_INFO_ARGS_X_ARG ( TYPE,
_ )
Value:
RPC_ARGTYPE_##TYPE,

Definition at line 207 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_INFO_ARGS_X_PB

#define X_GENERATE_FUNCTION_INFO_ARGS_X_PB ( TYPE,
_ )
Value:
/* unreachable */

Definition at line 208 of file macro_magic.h.

◆ X_DO_MAKE_FUNCINFO

#define X_DO_MAKE_FUNCINFO ( _fid,
_func,
_nargs,
_argtypes )
Value:
{ .function_id = _fid, .func = _func, .args_count = _nargs, .args_type = _argtypes },

Definition at line 210 of file macro_magic.h.

◆ X_DO_GENERATE_FUNCTION_INFO_ARGS

#define X_DO_GENERATE_FUNCTION_INFO_ARGS ( _fid,
_func,
_nargs,
... )
Value:
X_DO_MAKE_FUNCINFO(_fid, _func, _nargs, { FOR_EACH(X_GENERATE_FUNCTION_INFO_ARGS_X, __VA_ARGS__) })
#define X_GENERATE_FUNCTION_INFO_ARGS_X(X)
#define X_DO_MAKE_FUNCINFO(_fid, _func, _nargs, _argtypes)

Definition at line 212 of file macro_magic.h.

◆ X_DO_GENERATE_FUNCTION_INFO_PB

#define X_DO_GENERATE_FUNCTION_INFO_PB ( _fid,
_func )
Value:
@ RPC_ARGTYPE_BUFFER
Definition rpc.h:21

Definition at line 213 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_INFO_ARGS

#define X_GENERATE_FUNCTION_INFO_ARGS ( prefix,
fid,
func,
_1,
_2,
... )
Value:
X_DO_GENERATE_FUNCTION_INFO_ARGS(fid, prefix##func##_wrapper, X_NARGS(__VA_ARGS__), __VA_ARGS__)
#define X_DO_GENERATE_FUNCTION_INFO_ARGS(_fid, _func, _nargs,...)
#define X_NARGS(...)

Definition at line 215 of file macro_magic.h.

◆ X_GENERATE_FUNCTION_INFO_PB

#define X_GENERATE_FUNCTION_INFO_PB ( prefix,
fid,
func,
_1,
_2,
... )
Value:
X_DO_GENERATE_FUNCTION_INFO_PB(fid, prefix##func##_pb_wrapper)
#define X_DO_GENERATE_FUNCTION_INFO_PB(_fid, _func)

Definition at line 216 of file macro_magic.h.

◆ RPC_DECLARE_SERVER

#define RPC_DECLARE_SERVER ( prefix,
X_MACRO )
Value:
MOS_WARNING_PUSH \
MOS_WARNING_DISABLE("-Wgnu-zero-variadic-macro-arguments") \
static const rpc_function_info_t prefix##_functions[] = { X_MACRO(X_GENERATE_FUNCTION_INFO_ARGS, X_GENERATE_FUNCTION_INFO_PB, prefix##_) }; \
#define X_GENERATE_FUNCTION_INFO_ARGS(prefix, fid, func, _1, _2,...)
#define X_GENERATE_FUNCTION_FORWARDS_PB(prefix, _id, _func, _FUNC, reqtype, resptype)
#define X_GENERATE_FUNCTION_FORWARDS_ARGS(prefix, _id, _func, _FUNC, _spec,...)
#define X_GENERATE_FUNCTION_INFO_PB(prefix, fid, func, _1, _2,...)

Definition at line 219 of file macro_magic.h.

◆ X_GENERATE_NULL_FUNC_INFO_ARGS

#define X_GENERATE_NULL_FUNC_INFO_ARGS ( unused,
fid,
func,
_1,
_2,
... )
Value:
X_DO_GENERATE_FUNCTION_INFO_ARGS(fid, nullptr, X_NARGS(__VA_ARGS__), __VA_ARGS__)

Definition at line 227 of file macro_magic.h.

◆ X_GENERATE_NULL_FUNC_INFO_PB

#define X_GENERATE_NULL_FUNC_INFO_PB ( unused,
fid,
func,
_1,
_2,
... )
Value:

Definition at line 228 of file macro_magic.h.

◆ X_GENERATE_SWITCH_CASE_CLASS_ARGS

#define X_GENERATE_SWITCH_CASE_CLASS_ARGS ( unused,
id,
name,
NAME,
spec,
... )
Value:
case id: \
{ \
__VA_OPT__(FOR_EACH(X_RPC_GET_ARG, __VA_ARGS__)) \
return this->name(context FOR_EACH(RPC_EXTRACT_NAME, __VA_ARGS__)); \
}

Definition at line 230 of file macro_magic.h.

◆ X_GENERATE_SWITCH_CASE_CLASS_PB

#define X_GENERATE_SWITCH_CASE_CLASS_PB ( unused,
id,
name,
NAME,
reqtype,
resptype )
Value:
case id: \
{ \
reqtype req; \
if (!rpc_arg_pb(context, reqtype##_fields, &req, 0)) \
resptype resp = resptype##_init_zero; \
const rpc_result_code_t result = this->name(context, &req, &resp); \
pb_release(reqtype##_fields, &req); \
rpc_write_result_pb(context, resptype##_fields, &resp); \
pb_release(resptype##_fields, &resp); \
return result; \
}

Definition at line 237 of file macro_magic.h.

◆ __X_GENERATE_FUNCTION_FORWARDS_ARGS_CPP_CLASS

#define __X_GENERATE_FUNCTION_FORWARDS_ARGS_CPP_CLASS ( _prefix,
_id,
func,
_FUNC,
_spec,
... )
Value:
virtual rpc_result_code_t func(__maybe_unused rpc_context_t *ctx __VA_OPT__(FOR_EACH(RPC_GENERATE_PROTOTYPE, __VA_ARGS__))) \
{ \
};
@ RPC_RESULT_NOT_IMPLEMENTED
Definition rpc.h:35

Definition at line 251 of file macro_magic.h.

◆ __X_GENERATE_FUNCTION_FORWARDS_PB_CPP_CLASS

#define __X_GENERATE_FUNCTION_FORWARDS_PB_CPP_CLASS ( _prefix,
_id,
func,
_FUNC,
reqtype,
resptype )
Value:
virtual rpc_result_code_t func(rpc_context_t *, reqtype *, resptype *) \
{ \
}

Definition at line 257 of file macro_magic.h.

◆ __RPC_DEFINE_SERVER_CPP_CLASS_WRAPPER

#define __RPC_DEFINE_SERVER_CPP_CLASS_WRAPPER ( X_MACRO)
Value:
virtual rpc_result_code_t dispatcher(rpc_context_t *context, u32 funcid) override final \
{ \
switch (funcid) \
{ \
default: __builtin_unreachable(); \
} \
}
#define X_GENERATE_SWITCH_CASE_CLASS_PB(unused, id, name, NAME, reqtype, resptype)
#define X_GENERATE_SWITCH_CASE_CLASS_ARGS(unused, id, name, NAME, spec,...)
#define __X_GENERATE_FUNCTION_FORWARDS_PB_CPP_CLASS(_prefix, _id, func, _FUNC, reqtype, resptype)
#define __X_GENERATE_FUNCTION_FORWARDS_ARGS_CPP_CLASS(_prefix, _id, func, _FUNC, _spec,...)
unsigned int u32
Definition types.h:21

Definition at line 263 of file macro_magic.h.

◆ RPC_DECL_SERVER_INTERFACE_CLASS

#define RPC_DECL_SERVER_INTERFACE_CLASS ( classname,
X_MACRO )
Value:
class classname : public RPCServer \
{ \
constexpr const static rpc_function_info_t rpc_functions[] = { X_MACRO(X_GENERATE_NULL_FUNC_INFO_ARGS, X_GENERATE_NULL_FUNC_INFO_PB, _) }; \
\
public: \
explicit classname(const std::string &rpcname) : RPCServer(rpcname, rpc_functions, MOS_ARRAY_SIZE(rpc_functions)) {}; \
virtual ~classname() {}; \
__RPC_DEFINE_SERVER_CPP_CLASS_WRAPPER(X_MACRO) \
}
#define X_GENERATE_NULL_FUNC_INFO_PB(unused, fid, func, _1, _2,...)
#define X_GENERATE_NULL_FUNC_INFO_ARGS(unused, fid, func, _1, _2,...)
#define MOS_ARRAY_SIZE(x)
Definition mos_global.h:81

Definition at line 274 of file macro_magic.h.

◆ __RPC_DO_DECL_CPP_TYPE_NAMESPACE_ALIAS_IMPL

#define __RPC_DO_DECL_CPP_TYPE_NAMESPACE_ALIAS_IMPL ( subns,
_id,
action,
... )
Value:
namespace action \
{ \
using request = mosrpc##_##subns##_##action##_request; \
using response = mosrpc##_##subns##_##action##_response; \
}

Definition at line 286 of file macro_magic.h.

◆ RPC_DECL_CPP_TYPE_NAMESPACE

#define RPC_DECL_CPP_TYPE_NAMESPACE ( subns,
X_MACRO )

Definition at line 300 of file macro_magic.h.