eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_pre_post_action.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 NXP
3  * Copyright 2020 ACRIOS Systems s.r.o.
4  * All rights reserved.
5  *
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  */
9 
10 #ifndef _EMBEDDED_RPC__PREPOSTACTION_H_
11 #define _EMBEDDED_RPC__PREPOSTACTION_H_
12 
13 #ifdef __cplusplus
14 #include <cstddef>
20 extern "C" {
21 #endif
22 
23 typedef void (*pre_post_action_cb)(void);
24 
25 #ifdef __cplusplus
26 }
27 
29 // Classes
31 
32 namespace erpc {
33 
40 {
41 public:
45  PrePostAction(void) : m_preCB(NULL), m_postCB(NULL){};
46 
53  void addPreCB(pre_post_action_cb preCB);
54 
61  void addPostCB(pre_post_action_cb postCB);
62 
68  pre_post_action_cb getPreCB(void) { return m_preCB; }
69 
75  pre_post_action_cb getPostCB(void) { return m_postCB; }
76 
80  ~PrePostAction(void){};
81 
82 protected:
83  pre_post_action_cb m_preCB;
84  pre_post_action_cb m_postCB;
85 };
86 
87 } // namespace erpc
88 
91 #endif
92 
93 #endif // _EMBEDDED_RPC__PREPOSTACTION_H_
PrePostAction(void)
PrePostAction constructor.
Definition: erpc_pre_post_action.h:45
pre_post_action_cb m_preCB
Definition: erpc_pre_post_action.h:80
pre_post_action_cb getPreCB(void)
This function returns "before eRPC call start" callback function.
Definition: erpc_pre_post_action.h:68
pre_post_action_cb m_postCB
Definition: erpc_pre_post_action.h:84
~PrePostAction(void)
PrePostAction destructor.
Definition: erpc_pre_post_action.h:80
Client and server may used cb functions before and after rpc call.
Definition: erpc_pre_post_action.h:39
void addPostCB(pre_post_action_cb postCB)
This function sets "after eRPC call finish" callback function.
void addPreCB(pre_post_action_cb preCB)
This function sets "before eRPC call start" callback function.
Definition: erpc_arbitrated_client_manager.hpp:25
pre_post_action_cb getPostCB(void)
This function returns "after eRPC call finish" callback function.
Definition: erpc_pre_post_action.h:75