10 #ifndef _EMBEDDED_RPC__MESSAGE_BUFFER_H_ 11 #define _EMBEDDED_RPC__MESSAGE_BUFFER_H_ 13 #include "erpc_common.h" 74 void set(uint8_t *buffer, uint16_t length)
86 uint8_t *
get(void) {
return m_buf; }
93 const uint8_t *
get(void)
const {
return m_buf; }
107 uint16_t
getUsed(
void)
const {
return m_used; }
114 uint16_t
getFree(
void)
const {
return m_len - m_used; }
121 void setUsed(uint16_t used) { m_used = used; }
164 operator uint8_t *(void) {
return m_buf; }
169 operator const uint8_t *(void)
const {
return m_buf; }
183 const uint8_t &
operator[](
int index)
const {
return m_buf[index]; }
212 , m_pos(buffer->
get())
231 uint8_t *
get(void) {
return m_pos; }
240 const uint8_t *
get(void)
const {
return m_pos; }
274 operator uint8_t *(void) {
return m_pos; }
279 operator const uint8_t *(void)
const {
return m_pos; }
293 const uint8_t &
operator[](
int index)
const {
return m_pos[index]; }
350 uint16_t m_remaining;
354 uint8_t *
volatile m_buf;
355 uint16_t
volatile m_len;
356 uint16_t
volatile m_used;
415 #endif // _EMBEDDED_RPC__MESSAGE_BUFFER_H_ uint16_t getRemaining(void) const
Return remaining free space in current buffer.
Definition: erpc_message_buffer.h:247
erpc_status_t read(uint16_t offset, void *data, uint32_t length)
This function read data from local buffer.
Definition: erpc_message_buffer.cpp:21
const uint8_t & operator[](int index) const
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:293
int32_t erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:86
Cursor(MessageBuffer *buffer)
Constructor.
Definition: erpc_message_buffer.h:210
erpc_status_t copy(const MessageBuffer *other)
This function copy given message buffer to local instance.
Definition: erpc_message_buffer.cpp:51
MessageBuffer(void)
Constructor.
Definition: erpc_message_buffer.h:44
void setUsed(uint16_t used)
This function sets length of used space of buffer.
Definition: erpc_message_buffer.h:121
virtual ~MessageBufferFactory(void)
ClientManager destructor.
Definition: erpc_message_buffer.h:377
Cursor within a MessageBuffer.
Definition: erpc_message_buffer.h:188
uint8_t & operator[](int index)
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:176
uint16_t getUsed(void) const
This function returns length of used space of buffer.
Definition: erpc_message_buffer.h:107
erpc_status_t read(void *data, uint32_t length)
Read data from current buffer.
Definition: erpc_message_buffer.cpp:82
Cursor & operator--(void)
Substract -1 operator.
Definition: erpc_message_buffer.h:340
uint8_t * get(void)
Return position in buffer.
Definition: erpc_message_buffer.h:231
MessageBufferFactory(void)
Constructor.
Definition: erpc_message_buffer.h:372
uint8_t & operator[](int index)
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:286
Cursor & operator++(void)
Sum +1 operator.
Definition: erpc_message_buffer.h:328
uint16_t getLength(void) const
This function returns length of buffer.
Definition: erpc_message_buffer.h:100
uint16_t getFree(void) const
This function returns length of free space of buffer.
Definition: erpc_message_buffer.h:114
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.h:36
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:60
Cursor(void)
Constructor.
Definition: erpc_message_buffer.h:196
virtual bool createServerBuffer(void)
This function inform server if it has to create buffer for received message.
Definition: erpc_message_buffer.h:391
MessageBuffer(uint8_t *buffer, uint16_t length)
Constructor.
Definition: erpc_message_buffer.h:59
erpc_status_t write(const void *data, uint32_t length)
Read data from current buffer.
Definition: erpc_message_buffer.cpp:97
Abstract interface for message buffer factory.
Definition: erpc_message_buffer.h:364
Cursor & operator-=(uint16_t n)
Substract operator return local buffer.
Definition: erpc_message_buffer.h:316
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:36
Cursor & operator+=(uint16_t n)
Sum operator return local buffer.
Definition: erpc_message_buffer.h:302
const uint8_t & operator[](int index) const
Array operator return value of buffer at given index.
Definition: erpc_message_buffer.h:183