|
| 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_config_internal.h" |
| 14 | +#if ERPC_MESSAGE_LOGGING |
| 15 | +#include "erpc_message_loggers.h" |
| 16 | +#endif |
| 17 | +#if ERPC_PRE_POST_ACTION |
| 18 | +#include "erpc_pre_post_action.h" |
| 19 | +#endif |
| 20 | + |
| 21 | +/*! |
| 22 | + * @addtogroup infra_transport |
| 23 | + * @{ |
| 24 | + * @file |
| 25 | + */ |
| 26 | + |
| 27 | +//////////////////////////////////////////////////////////////////////////////// |
| 28 | +// Classes |
| 29 | +//////////////////////////////////////////////////////////////////////////////// |
| 30 | + |
| 31 | +namespace erpc { |
| 32 | + |
| 33 | +/*! |
| 34 | + * @brief Common class inheritand by client and server class. |
| 35 | + * |
| 36 | + * @ingroup infra_utility |
| 37 | + */ |
| 38 | +class ClientServerCommon |
| 39 | +#if ERPC_MESSAGE_LOGGING |
| 40 | +# ifdef ERPC_OTHER_INHERITANCE |
| 41 | +, |
| 42 | +# else |
| 43 | +# define ERPC_OTHER_INHERITANCE 1 |
| 44 | +: |
| 45 | +# endif |
| 46 | +public MessageLoggers |
| 47 | +#endif |
| 48 | +#if ERPC_PRE_POST_ACTION |
| 49 | +# ifdef ERPC_OTHER_INHERITANCE |
| 50 | +, |
| 51 | +# else |
| 52 | +# define ERPC_OTHER_INHERITANCE 1 |
| 53 | +: |
| 54 | +# endif |
| 55 | +public PrePostAction |
| 56 | +#endif |
| 57 | +{ |
| 58 | +public: |
| 59 | + /*! |
| 60 | + * @brief ClientServerCommon constructor. |
| 61 | + */ |
| 62 | + ClientServerCommon(void) |
| 63 | +#ifdef ERPC_OTHER_INHERITANCE |
| 64 | +# undef ERPC_OTHER_INHERITANCE |
| 65 | +#endif |
| 66 | +#if ERPC_MESSAGE_LOGGING |
| 67 | +# ifdef ERPC_OTHER_INHERITANCE |
| 68 | + , |
| 69 | +# else |
| 70 | +# define ERPC_OTHER_INHERITANCE 1 |
| 71 | + : |
| 72 | +# endif |
| 73 | + MessageLoggers() |
| 74 | +#endif |
| 75 | +#if ERPC_PRE_POST_ACTION |
| 76 | +# ifdef ERPC_OTHER_INHERITANCE |
| 77 | + , |
| 78 | +# else |
| 79 | +# define ERPC_OTHER_INHERITANCE 1 |
| 80 | + : |
| 81 | +# endif |
| 82 | + PrePostAction() |
| 83 | +#endif |
| 84 | +{}; |
| 85 | + |
| 86 | + /*! |
| 87 | + * @brief ClientServerCommon destructor |
| 88 | + */ |
| 89 | + ~ClientServerCommon(void){}; |
| 90 | +}; |
| 91 | + |
| 92 | +} // namespace erpc |
| 93 | + |
| 94 | +/*! @} */ |
| 95 | + |
| 96 | +#endif // _EMBEDDED_RPC__CLIENTSERVERCOMMON_H_ |
0 commit comments