eRPC
rpc_types.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include <stdint.h>
8 #include <stdlib.h>
9 #include <type_traits>
10 #include "common.h"
11 
12 namespace erpc {
13 
14 // Forward declarations
15 class SSlot;
16 class MsgBuffer;
17 class ReqHandle;
18 
37 typedef void (*erpc_req_func_t)(ReqHandle *req_handle, void *context);
38 
49 typedef void (*erpc_cont_func_t)(void *context, void *tag);
50 
57 enum class ReqFuncType : uint8_t { kForeground, kBackground };
58 
63 class ReqFunc {
64  public:
65  erpc_req_func_t req_func_;
66  ReqFuncType req_func_type_;
67 
68  inline bool is_background() const {
69  return req_func_type_ == ReqFuncType::kBackground;
70  }
71 
72  ReqFunc() { req_func_ = nullptr; }
73 
74  ReqFunc(erpc_req_func_t req_func, ReqFuncType req_func_type)
75  : req_func_(req_func), req_func_type_(req_func_type) {
76  rt_assert(req_func != nullptr, "Invalid Ops with null handler function");
77  }
78 
80  inline bool is_registered() const { return req_func_ != nullptr; }
81 };
82 } // namespace erpc
ReqFuncType req_func_type_
The handlers&#39;s mode (foreground/background)
Definition: rpc_types.h:66
ReqFuncType
The possible kinds of request handlers. Foreground-mode handlers run in the thread that calls the eve...
Definition: rpc_types.h:57
The request handler registered by applications.
Definition: rpc_types.h:63
bool is_registered() const
Check if this request handler is registered.
Definition: rpc_types.h:80
Definition: nexus.h:12
Handle object passed by eRPC to the application&#39;s request handler callbacks.
Definition: req_handle.h:7
erpc_req_func_t req_func_
The handler function.
Definition: rpc_types.h:65