Class RpcBaseHeader

Inheritance Relationships

Derived Types

Class Documentation

class RpcBaseHeader

Subclassed by iox::popo::RequestHeader, iox::popo::ResponseHeader

Public Functions

explicit RpcBaseHeader(const cxx::UniqueId &uniqueClientQueueId, const uint32_t lastKnownClientQueueIndex, const int64_t sequenceId, const uint8_t rpcHeaderVersion) noexcept

Constructs and initializes a RpcBaseHeader.

Parameters:
  • uniqueClientQueueId[in] is the cxx::UniqueId of the client queue where the response shall be delivered

  • lastKnownClientQueueIndex[in] is the last know index of the client queue in the ChunkDistributor for fast lookup

  • sequenceId[in] is a custom ID to map a response to a request

  • rpcHeaderVersion[in] is set by RequestHeader/ResponseHeader and should be RPC_HEADER_VERSION

RpcBaseHeader(const RpcBaseHeader &other) = delete
RpcBaseHeader &operator=(const RpcBaseHeader&) = delete
RpcBaseHeader(RpcBaseHeader &&rhs) noexcept = default
RpcBaseHeader &operator=(RpcBaseHeader &&rhs) noexcept = default
~RpcBaseHeader() noexcept = default
uint8_t getRpcHeaderVersion() const noexcept

The RpcBaseHeader version is used to detect incompatibilities for record&replay functionality.

Returns:

the RpcBaseHeader version

int64_t getSequenceId() const noexcept

@briet Obtains the sequence ID of the RPC message

Returns:

the sequenceId of the RPC message

mepoo::ChunkHeader *getChunkHeader() noexcept

Get the pointer to the ChunkHeader.

Returns:

the pointer to the ChunkHeader

const mepoo::ChunkHeader *getChunkHeader() const noexcept

Get the const pointer to the ChunkHeader.

Returns:

the const pointer to the ChunkHeader

void *getUserPayload() noexcept

Get the pointer to the user-payload.

Returns:

the pointer to the user-payload

const void *getUserPayload() const noexcept

Get the const pointer to the user-payload.

Returns:

the const pointer to the user-payload

Public Static Attributes

static constexpr uint8_t RPC_HEADER_VERSION = {1U}

From the 2.0 release onward, this must be incremented for each incompatible change, e.g.

  • data width of members changes

  • members are rearranged

  • semantic meaning of a member changes in any of RpcBaseHeader, RequestHeader or ResponseHeader!

static constexpr uint32_t UNKNOWN_CLIENT_QUEUE_INDEX = {std::numeric_limits<uint32_t>::max()}
static constexpr int64_t START_SEQUENCE_ID = {0}

Protected Attributes

uint8_t m_rpcHeaderVersion = {RPC_HEADER_VERSION}
uint32_t m_lastKnownClientQueueIndex = {UNKNOWN_CLIENT_QUEUE_INDEX}
cxx::UniqueId m_uniqueClientQueueId
int64_t m_sequenceId = {0}

Friends

friend class ServerPortUser