eRPC API Reference  Rev. 1.7.2
NXP Semiconductors
erpc::MessageBuffer::Cursor Class Reference

Cursor within a MessageBuffer. More...

#include <erpc_message_buffer.h>

Public Member Functions

 Cursor (void)
 Constructor. More...
 
 Cursor (MessageBuffer *buffer)
 Constructor. More...
 
void set (MessageBuffer *buffer)
 Set message buffer. More...
 
uint8_t * get (void)
 Return position in buffer. More...
 
const uint8_t * get (void) const
 Return position in buffer. More...
 
uint16_t getRemaining (void) const
 Return remaining free space in current buffer. More...
 
erpc_status_t read (void *data, uint32_t length)
 Read data from current buffer. More...
 
erpc_status_t write (const void *data, uint32_t length)
 Read data from current buffer. More...
 
 operator uint8_t * (void)
 Casting operator return local buffer.
 
 operator const uint8_t * (void) const
 Casting operator return local buffer.
 
uint8_t & operator[] (int index)
 Array operator return value of buffer at given index. More...
 
const uint8_t & operator[] (int index) const
 Array operator return value of buffer at given index. More...
 
Cursoroperator+= (uint16_t n)
 Sum operator return local buffer. More...
 
Cursoroperator-= (uint16_t n)
 Substract operator return local buffer. More...
 
Cursoroperator++ (void)
 Sum +1 operator. More...
 
Cursoroperator-- (void)
 Substract -1 operator. More...
 

Detailed Description

Constructor & Destructor Documentation

erpc::MessageBuffer::Cursor::Cursor ( void  )
inline

Constructor.

This function initializes object attributes.

erpc::MessageBuffer::Cursor::Cursor ( MessageBuffer buffer)
inline

Constructor.

This function initializes object attributes.

param[in] buffer MessageBuffer for sending/receiving.

Member Function Documentation

void MessageBuffer::Cursor::set ( MessageBuffer buffer)

Set message buffer.

Parameters
[in]bufferMessage buffer to set.
uint8_t* erpc::MessageBuffer::Cursor::get ( void  )
inline

Return position in buffer.

Return position, where it last write/read.

Returns
Return position in buffer.
const uint8_t* erpc::MessageBuffer::Cursor::get ( void  ) const
inline

Return position in buffer.

Return position, where it last write/read.

Returns
Return position in buffer.
uint16_t erpc::MessageBuffer::Cursor::getRemaining ( void  ) const
inline

Return remaining free space in current buffer.

Returns
Remaining free space in current buffer.
erpc_status_t MessageBuffer::Cursor::read ( void *  data,
uint32_t  length 
)

Read data from current buffer.

Parameters
[out]dataPointer to value, where copy read data.
[in]lengthHow much bytes need be read.
Return values
kErpcStatus_Success
kErpcStatus_BufferOverrun
erpc_status_t MessageBuffer::Cursor::write ( const void *  data,
uint32_t  length 
)

Read data from current buffer.

Parameters
[out]dataPointer to value to be sent.
[in]lengthHow much bytes need be wrote.
Return values
kErpcStatus_Success
kErpcStatus_BufferOverrun
uint8_t& erpc::MessageBuffer::Cursor::operator[] ( int  index)
inline

Array operator return value of buffer at given index.

Parameters
[in]indexIndex in buffer.
const uint8_t& erpc::MessageBuffer::Cursor::operator[] ( int  index) const
inline

Array operator return value of buffer at given index.

Parameters
[in]indexIndex in buffer.
Cursor& erpc::MessageBuffer::Cursor::operator+= ( uint16_t  n)
inline

Sum operator return local buffer.

Parameters
[in]nSumming with n.
Returns
Current cursor instance.
Cursor& erpc::MessageBuffer::Cursor::operator-= ( uint16_t  n)
inline

Substract operator return local buffer.

Parameters
[in]nSubstracting with n.
Returns
Current cursor instance.
Cursor& erpc::MessageBuffer::Cursor::operator++ ( void  )
inline

Sum +1 operator.

Returns
Current cursor instance.
Cursor& erpc::MessageBuffer::Cursor::operator-- ( void  )
inline

Substract -1 operator.

Returns
Current cursor instance.

The documentation for this class was generated from the following files: