11 #ifndef _EMBEDDED_RPC__CODEC_H_ 12 #define _EMBEDDED_RPC__CODEC_H_ 14 #include "erpc_common.h" 37 kInvocationMessage = 0,
44 typedef funPtr *arrayOfFunPtr;
75 MessageBuffer &getBufferRef(
void) {
return m_cursor.getBufferRef(); }
85 m_cursor.setBuffer(buf, skip);
94 virtual void reset(uint8_t skip = 0)
97 m_cursor.setBuffer(buffer, skip);
140 virtual void startWriteMessage(
message_type_t type, uint32_t service, uint32_t request, uint32_t sequence) = 0;
147 virtual void write(
bool value) = 0;
154 virtual void write(int8_t value) = 0;
161 virtual void write(int16_t value) = 0;
168 virtual void write(int32_t value) = 0;
175 virtual void write(int64_t value) = 0;
182 virtual void write(uint8_t value) = 0;
189 virtual void write(uint16_t value) = 0;
196 virtual void write(uint32_t value) = 0;
203 virtual void write(uint64_t value) = 0;
210 virtual void write(
float value) = 0;
217 virtual void write(
double value) = 0;
224 virtual void writePtr(uintptr_t value) = 0;
232 virtual void writeString(uint32_t length,
const char *value) = 0;
240 virtual void writeBinary(uint32_t length,
const uint8_t *value) = 0;
247 virtual void startWriteList(uint32_t length) = 0;
254 virtual void startWriteUnion(int32_t discriminator) = 0;
261 virtual void writeNullFlag(
bool isNull) = 0;
275 virtual void startReadMessage(
message_type_t &type, uint32_t &service, uint32_t &request, uint32_t &sequence) = 0;
282 virtual void read(
bool &value) = 0;
289 virtual void read(int8_t &value) = 0;
296 virtual void read(int16_t &value) = 0;
303 virtual void read(int32_t &value) = 0;
310 virtual void read(int64_t &value) = 0;
317 virtual void read(uint8_t &value) = 0;
324 virtual void read(uint16_t &value) = 0;
331 virtual void read(uint32_t &value) = 0;
338 virtual void read(uint64_t &value) = 0;
345 virtual void read(
float &value) = 0;
352 virtual void read(
double &value) = 0;
359 virtual void readPtr(uintptr_t &value) = 0;
367 virtual void readString(uint32_t &length,
char **value) = 0;
375 virtual void readBinary(uint32_t &length, uint8_t **value) = 0;
382 virtual void startReadList(uint32_t &length) = 0;
389 virtual void startReadUnion(int32_t &discriminator) = 0;
396 virtual void readNullFlag(
bool &isNull) = 0;
426 virtual Codec *create(
void) = 0;
433 virtual void dispose(
Codec *codec) = 0;
440 #endif // _EMBEDDED_RPC__CODEC_H_ MessageBuffer getBuffer(void)
Return message buffer used for read and write data.
Definition: erpc_codec.hpp:73
erpc_status_t m_status
Definition: erpc_codec.hpp:400
virtual void setBuffer(MessageBuffer &buf, uint8_t skip=0)
Prototype for set message buffer used for read and write data.
Definition: erpc_codec.hpp:83
message_type_t
Types of messages that can be encoded.
Definition: erpc_codec.hpp:35
virtual void reset(uint8_t skip=0)
Reset the codec to initial state.
Definition: erpc_codec.hpp:94
No error occurred.
Definition: erpc_common.h:27
erpc_status_t getStatus(void)
Return current status of eRPC message processing.
Definition: erpc_codec.hpp:106
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
Abstract serialization encoder/decoder interface.
Definition: erpc_codec.hpp:53
virtual ~Codec(void)
Codec destructor.
Definition: erpc_codec.hpp:66
Cursor within a MessageBuffer.
Definition: erpc_message_buffer.hpp:187
Abstract interface for codec factory.
Definition: erpc_codec.hpp:408
virtual ~CodecFactory(void)
CodecFactory destructor.
Definition: erpc_codec.hpp:419
void updateStatus(erpc_status_t status)
Set current status of eRPC message processing to given value.
Definition: erpc_codec.hpp:121
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.hpp:37
Definition: erpc_arbitrated_client_manager.hpp:25
CodecFactory(void)
Constructor.
Definition: erpc_codec.hpp:414
Codec(void)
Constructor.
Definition: erpc_codec.hpp:61
bool isStatusOk(void)
Return bool value representing current status.
Definition: erpc_codec.hpp:114
Cursor m_cursor
Definition: erpc_codec.hpp:399