36 #ifndef _EMBEDDED_RPC__MESSAGE_BUFFER_H_ 37 #define _EMBEDDED_RPC__MESSAGE_BUFFER_H_ 39 #include "erpc_common.h" 100 void set(uint8_t *buffer, uint16_t length)
112 uint8_t *
get(void) {
return m_buf; }
119 const uint8_t *
get(void)
const {
return m_buf; }
133 uint16_t
getUsed(
void)
const {
return m_used; }
140 uint16_t
getFree(
void)
const {
return m_len - m_used; }
147 void setUsed(uint16_t used) { m_used = used; }
190 operator uint8_t *(void) {
return m_buf; }
195 operator const uint8_t *(void)
const {
return m_buf; }
209 const uint8_t &
operator[](
int index)
const {
return m_buf[index]; }
238 , m_pos(buffer->
get())
257 uint8_t *
get(void) {
return m_pos; }
266 const uint8_t *
get(void)
const {
return m_pos; }
300 operator uint8_t *(void) {
return m_pos; }
305 operator const uint8_t *(void)
const {
return m_pos; }
319 const uint8_t &
operator[](
int index)
const {
return m_pos[index]; }
376 uint16_t m_remaining;
380 uint8_t *
volatile m_buf;
381 uint16_t
volatile m_len;
382 uint16_t
volatile m_used;
441 #endif // _EMBEDDED_RPC__MESSAGE_BUFFER_H_ uint16_t getRemaining(void) const
Return remaining free space in current buffer.
Definition: erpc_message_buffer.h:273
erpc_status_t read(uint16_t offset, void *data, uint32_t length)
This function read data from local buffer.
Definition: erpc_message_buffer.cpp:47
const uint8_t & operator[](int index) const
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:319
int32_t erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:112
Cursor(MessageBuffer *buffer)
Constructor.
Definition: erpc_message_buffer.h:236
erpc_status_t copy(const MessageBuffer *other)
This function copy given message buffer to local instance.
Definition: erpc_message_buffer.cpp:77
MessageBuffer(void)
Constructor.
Definition: erpc_message_buffer.h:70
void setUsed(uint16_t used)
This function sets length of used space of buffer.
Definition: erpc_message_buffer.h:147
virtual ~MessageBufferFactory(void)
ClientManager destructor.
Definition: erpc_message_buffer.h:403
Cursor within a MessageBuffer.
Definition: erpc_message_buffer.h:214
uint8_t & operator[](int index)
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:202
uint16_t getUsed(void) const
This function returns length of used space of buffer.
Definition: erpc_message_buffer.h:133
erpc_status_t read(void *data, uint32_t length)
Read data from current buffer.
Definition: erpc_message_buffer.cpp:108
Cursor & operator--(void)
Substract -1 operator.
Definition: erpc_message_buffer.h:366
uint8_t * get(void)
Return position in buffer.
Definition: erpc_message_buffer.h:257
MessageBufferFactory(void)
Constructor.
Definition: erpc_message_buffer.h:398
uint8_t & operator[](int index)
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:312
Cursor & operator++(void)
Sum +1 operator.
Definition: erpc_message_buffer.h:354
uint16_t getLength(void) const
This function returns length of buffer.
Definition: erpc_message_buffer.h:126
uint16_t getFree(void) const
This function returns length of free space of buffer.
Definition: erpc_message_buffer.h:140
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.h:62
Definition: erpc_arbitrated_client_manager.h:51
void swap(MessageBuffer *other)
This function swap message buffer attributes between given instance and local instance.
Definition: erpc_message_buffer.cpp:86
Cursor(void)
Constructor.
Definition: erpc_message_buffer.h:222
virtual bool createServerBuffer(void)
This function inform server if it has to create buffer for received message.
Definition: erpc_message_buffer.h:417
MessageBuffer(uint8_t *buffer, uint16_t length)
Constructor.
Definition: erpc_message_buffer.h:85
erpc_status_t write(const void *data, uint32_t length)
Read data from current buffer.
Definition: erpc_message_buffer.cpp:123
Abstract interface for message buffer factory.
Definition: erpc_message_buffer.h:390
Cursor & operator-=(uint16_t n)
Substract operator return local buffer.
Definition: erpc_message_buffer.h:342
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:62
Cursor & operator+=(uint16_t n)
Sum operator return local buffer.
Definition: erpc_message_buffer.h:328
const uint8_t & operator[](int index) const
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:209