eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc::Cursor Class Reference

Cursor within a MessageBuffer. More...

#include <erpc_message_buffer.hpp>

Public Member Functions

 Cursor (void)
 Constructor. More...
 
 Cursor (MessageBuffer &buffer)
 Constructor. More...
 
void setBuffer (MessageBuffer &buffer, uint8_t reserved=0)
 Set message buffer. More...
 
MessageBuffer getBuffer (void)
 Get message buffer.
 
MessageBuffergetBufferRef (void)
 Get message buffer.
 
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...
 
uint16_t getRemainingUsed (void) const
 Return remaining space from used of 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)
 Subtract operator return local buffer. More...
 
Cursoroperator++ (void)
 Sum +1 operator. More...
 
Cursoroperator-- (void)
 Subtract -1 operator. More...
 

Detailed Description

Constructor & Destructor Documentation

erpc::Cursor::Cursor ( void  )
inline

Constructor.

This function initializes object attributes.

erpc::Cursor::Cursor ( MessageBuffer buffer)
inlineexplicit

Constructor.

This function initializes object attributes.

Parameters
[in]bufferMessageBuffer for sending/receiving.

Member Function Documentation

void Cursor::setBuffer ( MessageBuffer buffer,
uint8_t  reserved = 0 
)

Set message buffer.

Parameters
[in]bufferMessage buffer to set.
[in]reservedMoved cursor position outside of reserved memory.
uint8_t* erpc::Cursor::get ( void  )
inline

Return position in buffer.

Return position, where it last write/read.

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

Return position in buffer.

Return position, where it last write/read.

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

Return remaining free space in current buffer.

Returns
Remaining free space in current buffer.
uint16_t erpc::Cursor::getRemainingUsed ( void  ) const
inline

Return remaining space from used of current buffer.

Returns
Remaining space from used of current buffer.
erpc_status_t 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 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 & Cursor::operator[] ( int  index)

Array operator return value of buffer at given index.

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

Array operator return value of buffer at given index.

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

Sum operator return local buffer.

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

Subtract operator return local buffer.

Parameters
[in]nSubtracting with n.
Returns
Current cursor instance.
Cursor & Cursor::operator++ ( void  )

Sum +1 operator.

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

Subtract -1 operator.

Returns
Current cursor instance.

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