10 #ifndef _EMBEDDED_RPC__MESSAGE_BUFFER_H_ 11 #define _EMBEDDED_RPC__MESSAGE_BUFFER_H_ 13 #include "erpc_common.h" 75 void set(uint8_t *buffer, uint16_t length)
87 uint8_t *
get(void) {
return m_buf; }
94 const uint8_t *
get(void)
const {
return m_buf; }
108 uint16_t
getUsed(
void)
const {
return m_used; }
115 uint16_t
getFree(
void)
const {
return m_len - m_used; }
122 void setUsed(uint16_t used) { m_used = used; }
165 operator uint8_t *(void) {
return m_buf; }
170 operator const uint8_t *(void)
const {
return m_buf; }
184 const uint8_t &
operator[](
int index)
const {
return m_buf[index]; }
213 , m_pos(buffer->
get())
232 uint8_t *
get(void) {
return m_pos; }
241 const uint8_t *
get(void)
const {
return m_pos; }
275 operator uint8_t *(void) {
return m_pos; }
280 operator const uint8_t *(void)
const {
return m_pos; }
294 const uint8_t &
operator[](
int index)
const {
return m_pos[index]; }
351 uint16_t m_remaining;
355 uint8_t *
volatile m_buf;
356 uint16_t
volatile m_len;
357 uint16_t
volatile m_used;
416 #endif // _EMBEDDED_RPC__MESSAGE_BUFFER_H_ uint16_t getRemaining(void) const
Return remaining free space in current buffer.
Definition: erpc_message_buffer.h:248
erpc_status_t read(uint16_t offset, void *data, uint32_t length)
This function read data from local buffer.
Definition: erpc_message_buffer.cpp:23
const uint8_t & operator[](int index) const
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:294
Cursor(MessageBuffer *buffer)
Constructor.
Definition: erpc_message_buffer.h:211
erpc_status_t copy(const MessageBuffer *other)
This function copy given message buffer to local instance.
Definition: erpc_message_buffer.cpp:65
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:87
MessageBuffer(void)
Constructor.
Definition: erpc_message_buffer.h:45
void setUsed(uint16_t used)
This function sets length of used space of buffer.
Definition: erpc_message_buffer.h:122
virtual ~MessageBufferFactory(void)
ClientManager destructor.
Definition: erpc_message_buffer.h:378
Cursor within a MessageBuffer.
Definition: erpc_message_buffer.h:189
uint8_t & operator[](int index)
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:177
uint16_t getUsed(void) const
This function returns length of used space of buffer.
Definition: erpc_message_buffer.h:108
erpc_status_t read(void *data, uint32_t length)
Read data from current buffer.
Definition: erpc_message_buffer.cpp:99
Cursor & operator--(void)
Substract -1 operator.
Definition: erpc_message_buffer.h:341
uint8_t * get(void)
Return position in buffer.
Definition: erpc_message_buffer.h:232
MessageBufferFactory(void)
Constructor.
Definition: erpc_message_buffer.h:373
uint8_t & operator[](int index)
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:287
Cursor & operator++(void)
Sum +1 operator.
Definition: erpc_message_buffer.h:329
uint16_t getLength(void) const
This function returns length of buffer.
Definition: erpc_message_buffer.h:101
uint16_t getFree(void) const
This function returns length of free space of buffer.
Definition: erpc_message_buffer.h:115
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.h:37
Definition: erpc_arbitrated_client_manager.h:25
void swap(MessageBuffer *other)
This function swap message buffer attributes between given instance and local instance.
Definition: erpc_message_buffer.cpp:75
Cursor(void)
Constructor.
Definition: erpc_message_buffer.h:197
virtual bool createServerBuffer(void)
This function informs server if it has to create buffer for received message.
Definition: erpc_message_buffer.h:392
MessageBuffer(uint8_t *buffer, uint16_t length)
Constructor.
Definition: erpc_message_buffer.h:60
erpc_status_t write(const void *data, uint32_t length)
Read data from current buffer.
Definition: erpc_message_buffer.cpp:121
Abstract interface for message buffer factory.
Definition: erpc_message_buffer.h:365
Cursor & operator-=(uint16_t n)
Substract operator return local buffer.
Definition: erpc_message_buffer.h:317
erpc_status_t write(uint16_t offset, const void *data, uint32_t length)
This function write data to local buffer.
Definition: erpc_message_buffer.cpp:44
Cursor & operator+=(uint16_t n)
Sum operator return local buffer.
Definition: erpc_message_buffer.h:303
const uint8_t & operator[](int index) const
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:184