eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc::Codec Class Referenceabstract

Abstract serialization encoder/decoder interface. More...

#include <erpc_codec.hpp>

+ Inheritance diagram for erpc::Codec:
+ Collaboration diagram for erpc::Codec:

Public Member Functions

 Codec (void)
 Constructor. More...
 
virtual ~Codec (void)
 Codec destructor.
 
MessageBuffer getBuffer (void)
 Return message buffer used for read and write data. More...
 
MessageBuffergetBufferRef (void)
 
virtual void setBuffer (MessageBuffer &buf, uint8_t skip=0)
 Prototype for set message buffer used for read and write data. More...
 
virtual void reset (uint8_t skip=0)
 Reset the codec to initial state. More...
 
erpc_status_t getStatus (void)
 Return current status of eRPC message processing. More...
 
bool isStatusOk (void)
 Return bool value representing current status. More...
 
void updateStatus (erpc_status_t status)
 Set current status of eRPC message processing to given value. More...
 
Encoding
virtual void startWriteMessage (message_type_t type, uint32_t service, uint32_t request, uint32_t sequence)=0
 Prototype for write header of message. More...
 
virtual void write (bool value)=0
 Prototype for write boolean value. More...
 
virtual void write (int8_t value)=0
 Prototype for write int8_t value. More...
 
virtual void write (int16_t value)=0
 Prototype for write int16_t value. More...
 
virtual void write (int32_t value)=0
 Prototype for write int32_t value. More...
 
virtual void write (int64_t value)=0
 Prototype for write int64_t value. More...
 
virtual void write (uint8_t value)=0
 Prototype for write uint8_t value. More...
 
virtual void write (uint16_t value)=0
 Prototype for write uint16_t value. More...
 
virtual void write (uint32_t value)=0
 Prototype for write uint32_t value. More...
 
virtual void write (uint64_t value)=0
 Prototype for write uint64_t value. More...
 
virtual void write (float value)=0
 Prototype for write float value. More...
 
virtual void write (double value)=0
 Prototype for write double value. More...
 
virtual void writePtr (uintptr_t value)=0
 Prototype for write uintptr value. More...
 
virtual void writeString (uint32_t length, const char *value)=0
 Prototype for write string value. More...
 
virtual void writeBinary (uint32_t length, const uint8_t *value)=0
 Prototype for write binary value. More...
 
virtual void startWriteList (uint32_t length)=0
 Prototype for start write list. More...
 
virtual void startWriteUnion (int32_t discriminator)=0
 Prototype for start write union. More...
 
virtual void writeNullFlag (bool isNull)=0
 Writes a flag indicating whether the next value is null. More...
 

Decoding

Cursor m_cursor
 
erpc_status_t m_status
 
virtual void startReadMessage (message_type_t &type, uint32_t &service, uint32_t &request, uint32_t &sequence)=0
 Prototype for read header of message. More...
 
virtual void read (bool &value)=0
 Prototype for read boolean value. More...
 
virtual void read (int8_t &value)=0
 Prototype for read int8_t value. More...
 
virtual void read (int16_t &value)=0
 Prototype for read int16_t value. More...
 
virtual void read (int32_t &value)=0
 Prototype for read int32_t value. More...
 
virtual void read (int64_t &value)=0
 Prototype for read int64_t value. More...
 
virtual void read (uint8_t &value)=0
 Prototype for read uint8_t value. More...
 
virtual void read (uint16_t &value)=0
 Prototype for read uint16_t value. More...
 
virtual void read (uint32_t &value)=0
 Prototype for read uint32_t value. More...
 
virtual void read (uint64_t &value)=0
 Prototype for read uint64_t value. More...
 
virtual void read (float &value)=0
 Prototype for read float value. More...
 
virtual void read (double &value)=0
 Prototype for read double value. More...
 
virtual void readPtr (uintptr_t &value)=0
 Prototype for read uintptr value. More...
 
virtual void readString (uint32_t &length, char **value)=0
 Prototype for read string value. More...
 
virtual void readBinary (uint32_t &length, uint8_t **value)=0
 Prototype for read binary value. More...
 
virtual void startReadList (uint32_t &length)=0
 Prototype for start read list. More...
 
virtual void startReadUnion (int32_t &discriminator)=0
 Prototype for start read union. More...
 
virtual void readNullFlag (bool &isNull)=0
 Reads a flag indicating whether the next value is null. More...
 

Detailed Description

Abstract serialization encoder/decoder interface.

Codecs write to or read from a MessageBuffer.

Constructor & Destructor Documentation

erpc::Codec::Codec ( void  )
inline

Constructor.

This function initializes object attributes.

Member Function Documentation

MessageBuffer erpc::Codec::getBuffer ( void  )
inline

Return message buffer used for read and write data.

Returns
Pointer to used message buffer.
virtual void erpc::Codec::setBuffer ( MessageBuffer buf,
uint8_t  skip = 0 
)
inlinevirtual

Prototype for set message buffer used for read and write data.

Parameters
[in]bufMessage buffer to set.
[in]skipHow many bytes to skip from reading.
virtual void erpc::Codec::reset ( uint8_t  skip = 0)
inlinevirtual

Reset the codec to initial state.

Parameters
[in]skipHow many bytes to skip from reading.
erpc_status_t erpc::Codec::getStatus ( void  )
inline

Return current status of eRPC message processing.

Returns
Current status of eRPC message processing.
bool erpc::Codec::isStatusOk ( void  )
inline

Return bool value representing current status.

Return values
TrueCurrent status value is kErpcStatus_Success.
FalseCurrent status is other than kErpcStatus_Success.
void erpc::Codec::updateStatus ( erpc_status_t  status)
inline

Set current status of eRPC message processing to given value.

Parameters
[in]statusNew current value.
virtual void erpc::Codec::startWriteMessage ( message_type_t  type,
uint32_t  service,
uint32_t  request,
uint32_t  sequence 
)
pure virtual

Prototype for write header of message.

Parameters
[in]typeType of message.
[in]serviceWhich interface is requested.
[in]requestWhich function need be called.
[in]sequenceSend sequence number to be sure that received message is reply for current request.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( bool  value)
pure virtual

Prototype for write boolean value.

Parameters
[in]valueBoolean typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( int8_t  value)
pure virtual

Prototype for write int8_t value.

Parameters
[in]valueint8_t typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( int16_t  value)
pure virtual

Prototype for write int16_t value.

Parameters
[in]valueint16_t typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( int32_t  value)
pure virtual

Prototype for write int32_t value.

Parameters
[in]valueint32_t typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( int64_t  value)
pure virtual

Prototype for write int64_t value.

Parameters
[in]valueint64_t typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( uint8_t  value)
pure virtual

Prototype for write uint8_t value.

Parameters
[in]valueuint8_t typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( uint16_t  value)
pure virtual

Prototype for write uint16_t value.

Parameters
[in]valueuint16_t typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( uint32_t  value)
pure virtual

Prototype for write uint32_t value.

Parameters
[in]valueuint32_t typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( uint64_t  value)
pure virtual

Prototype for write uint64_t value.

Parameters
[in]valueuint64_t typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( float  value)
pure virtual

Prototype for write float value.

Parameters
[in]valuefloat typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::write ( double  value)
pure virtual

Prototype for write double value.

Parameters
[in]valuedouble typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::writePtr ( uintptr_t  value)
pure virtual

Prototype for write uintptr value.

Parameters
[in]valueuintptr typed value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::writeString ( uint32_t  length,
const char *  value 
)
pure virtual

Prototype for write string value.

Parameters
[in]lengthof string.
[in]valuestring value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::writeBinary ( uint32_t  length,
const uint8_t *  value 
)
pure virtual

Prototype for write binary value.

Parameters
[in]lengthof binary.
[in]valueBinary value to write.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::startWriteList ( uint32_t  length)
pure virtual

Prototype for start write list.

Parameters
[in]lengthLength of list.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::startWriteUnion ( int32_t  discriminator)
pure virtual

Prototype for start write union.

Parameters
[in]discriminatorDiscriminator of union.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::writeNullFlag ( bool  isNull)
pure virtual

Writes a flag indicating whether the next value is null.

Parameters
[in]isNullNull flag to send.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::startReadMessage ( message_type_t type,
uint32_t &  service,
uint32_t &  request,
uint32_t &  sequence 
)
pure virtual

Prototype for read header of message.

Parameters
[in]typeType of message.
[in]serviceWhich interface was used.
[in]requestWhich function was called.
[in]sequenceReturned sequence number to be sure that received message is reply for current request.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( bool &  value)
pure virtual

Prototype for read boolean value.

Parameters
[in]valueBoolean typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( int8_t &  value)
pure virtual

Prototype for read int8_t value.

Parameters
[in]valueint8_t typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( int16_t &  value)
pure virtual

Prototype for read int16_t value.

Parameters
[in]valueint16_t typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( int32_t &  value)
pure virtual

Prototype for read int32_t value.

Parameters
[in]valueint32_t typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( int64_t &  value)
pure virtual

Prototype for read int64_t value.

Parameters
[in]valueint64_t typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( uint8_t &  value)
pure virtual

Prototype for read uint8_t value.

Parameters
[in]valueuint8_t typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( uint16_t &  value)
pure virtual

Prototype for read uint16_t value.

Parameters
[in]valueuint16_t typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( uint32_t &  value)
pure virtual

Prototype for read uint32_t value.

Parameters
[in]valueuint32_t typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( uint64_t &  value)
pure virtual

Prototype for read uint64_t value.

Parameters
[in]valueuint64_t typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( float &  value)
pure virtual

Prototype for read float value.

Parameters
[in]valuefloat typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::read ( double &  value)
pure virtual

Prototype for read double value.

Parameters
[in]valuedouble typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::readPtr ( uintptr_t &  value)
pure virtual

Prototype for read uintptr value.

Parameters
[in]valueuintptr typed value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::readString ( uint32_t &  length,
char **  value 
)
pure virtual

Prototype for read string value.

Parameters
[in]lengthof string.
[in]valueString value to read.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::readBinary ( uint32_t &  length,
uint8_t **  value 
)
pure virtual

Prototype for read binary value.

Parameters
[out]lengthof binary. 0 can be valid value or in case of error.
[out]valueBinary value to read. Null in case of error.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::startReadList ( uint32_t &  length)
pure virtual

Prototype for start read list.

Parameters
[in]lengthLength of list.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::startReadUnion ( int32_t &  discriminator)
pure virtual

Prototype for start read union.

Parameters
[in]discriminatorDiscriminator of union.

Implemented in erpc::BasicCodec.

virtual void erpc::Codec::readNullFlag ( bool &  isNull)
pure virtual

Reads a flag indicating whether the next value is null.

Parameters
[in]isNullNull flag to read.

Implemented in erpc::BasicCodec.

Member Data Documentation

Cursor erpc::Codec::m_cursor
protected

Copy data to message buffers.

erpc_status_t erpc::Codec::m_status
protected

Status of serialized data.


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