eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_client_server_common.hpp
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__CLIENTSERVERCOMMON_H_
11 #define _EMBEDDED_RPC__CLIENTSERVERCOMMON_H_
12 
13 #include "erpc_codec.hpp"
14 #include "erpc_config_internal.h"
15 #if ERPC_MESSAGE_LOGGING
16 #include "erpc_message_loggers.hpp"
17 #endif
18 #if ERPC_PRE_POST_ACTION
19 #include "erpc_pre_post_action.h"
20 #endif
21 
28 // Classes
31 
32 namespace erpc {
33 
41 #ifdef ERPC_OTHER_INHERITANCE
42  ,
43 #else
44 #define ERPC_OTHER_INHERITANCE 1
45 :
46 #endif
47  public MessageLoggers
48 #endif
49 #if ERPC_PRE_POST_ACTION
50 #ifdef ERPC_OTHER_INHERITANCE
51  ,
52 #else
53 #define ERPC_OTHER_INHERITANCE 1
54 :
55 #endif
56  public PrePostAction
57 #endif
58 {
59 public:
64 #ifdef ERPC_OTHER_INHERITANCE
65 #undef ERPC_OTHER_INHERITANCE
66 #endif
67 #if ERPC_MESSAGE_LOGGING
68 #ifdef ERPC_OTHER_INHERITANCE
69  ,
70 #else
71 #define ERPC_OTHER_INHERITANCE 1
72  :
73 #endif
75 #endif
76 #if ERPC_PRE_POST_ACTION
77 #ifdef ERPC_OTHER_INHERITANCE
78  ,
79 #else
80 #define ERPC_OTHER_INHERITANCE 1
81  :
82 #endif
84 #endif
85 #ifdef ERPC_OTHER_INHERITANCE
86  ,
87 #else
88 #define ERPC_OTHER_INHERITANCE 1
89  :
90 #endif
91  m_messageFactory(NULL), m_codecFactory(NULL), m_transport(NULL){};
92 
97 
104 
110  void setCodecFactory(CodecFactory * factory) { m_codecFactory = factory; }
111 
118 
126  void setTransport(Transport * transport) { m_transport = transport; }
127 
133  Transport *getTransport(void) { return m_transport; }
134 
135 protected:
139 };
140 
141 } // namespace erpc
142 
145 #endif // _EMBEDDED_RPC__CLIENTSERVERCOMMON_H_
Abstract interface for transport layer.
Definition: erpc_transport.hpp:36
Transport * m_transport
Transport layer to use.
Definition: erpc_client_server_common.hpp:138
Transport * getTransport(void)
This function gets transport instance.
Definition: erpc_client_server_common.hpp:133
#define ERPC_MESSAGE_LOGGING
CodecFactory * getCodecFactory(void)
This function sets codec factory to use.
Definition: erpc_client_server_common.hpp:117
Common class inherited by client and server class.
Definition: erpc_client_server_common.hpp:39
Abstract interface for codec factory.
Definition: erpc_codec.hpp:408
void setMessageBufferFactory(MessageBufferFactory *factory)
This function sets message buffer factory to use.
Definition: erpc_client_server_common.hpp:103
Client and server may used cb functions before and after rpc call.
Definition: erpc_pre_post_action.h:39
void setCodecFactory(CodecFactory *factory)
This function sets codec factory to use.
Definition: erpc_client_server_common.hpp:110
~ClientServerCommon(void)
ClientServerCommon destructor.
Definition: erpc_client_server_common.hpp:96
CodecFactory * m_codecFactory
Codec to use.
Definition: erpc_client_server_common.hpp:137
Definition: erpc_arbitrated_client_manager.hpp:25
MessageBufferFactory * m_messageFactory
Message buffer factory to use.
Definition: erpc_client_server_common.hpp:136
void setTransport(Transport *transport)
This function sets transport layer to use.
Definition: erpc_client_server_common.hpp:126
Abstract interface for message buffer factory.
Definition: erpc_message_buffer.hpp:344
ClientServerCommon(void)
ClientServerCommon constructor.
Definition: erpc_client_server_common.hpp:63
Logging messages functionality.
Definition: erpc_message_loggers.hpp:75