iceoryx_posh 2.0.3
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
iox::mepoo::ChunkHeader Struct Reference

Public Types

using UserPayloadOffset_t = uint32_t
 

Public Member Functions

 ChunkHeader (const uint32_t chunkSize, const ChunkSettings &chunkSettings) noexcept
 constructs and initializes a ChunkHeader More...
 
 ChunkHeader (const ChunkHeader &)=delete
 
 ChunkHeader (ChunkHeader &&)=delete
 
ChunkHeaderoperator= (const ChunkHeader &)=delete
 
ChunkHeaderoperator= (ChunkHeader &&)=delete
 
uint8_t chunkHeaderVersion () const noexcept
 The ChunkHeader version is used to detect incompatibilities for record&replay functionality. More...
 
uint16_t userHeaderId () const noexcept
 The id of the user-header used by the chunk; if no user-header is used, this is set to NO_USER_HEADER. More...
 
void * userHeader () noexcept
 Get the pointer to the user-header. More...
 
const void * userHeader () const noexcept
 Get the const pointer to the user-header. More...
 
void * userPayload () noexcept
 Get a pointer to the user-payload carried by the chunk. More...
 
const void * userPayload () const noexcept
 Get a const pointer to the user-payload carried by the chunk. More...
 
uint32_t usedSizeOfChunk () const noexcept
 Calculates the used size of the chunk with the ChunkHeader, user-heander and user-payload. More...
 
uint32_t chunkSize () const noexcept
 The size of the whole chunk, including the header. More...
 
uint32_t userHeaderSize () const noexcept
 The size of the chunk occupied by the user-header. More...
 
uint32_t userPayloadSize () const noexcept
 The size of the chunk occupied by the user-payload. More...
 
uint32_t userPayloadAlignment () const noexcept
 The alignment of the chunk occupied by the user-payload. More...
 
popo::UniquePortId originId () const noexcept
 The unique identifier of the publisher the chunk was sent from. More...
 
uint64_t sequenceNumber () const noexcept
 A serial number for the sent chunks. More...
 

Static Public Member Functions

static ChunkHeaderfromUserPayload (void *const userPayload) noexcept
 Get a pointer to the ChunkHeader associated to the user-payload of the chunk. More...
 
static const ChunkHeaderfromUserPayload (const void *const userPayload) noexcept
 Get a const pointer to the ChunkHeader associated to the user-payload of the chunk. More...
 
static ChunkHeaderfromUserHeader (void *const userHeader) noexcept
 Get a pointer to the ChunkHeader associated to the user-header of the chunk. More...
 
static const ChunkHeaderfromUserHeader (const void *const userHeader) noexcept
 Get a const pointer to the ChunkHeader associated to the user-header of the chunk. More...
 

Static Public Attributes

static constexpr uint8_t CHUNK_HEADER_VERSION {1U}
 From the 1.0 release onward, this must be incremented for each incompatible change, e.g. More...
 
static constexpr uint16_t NO_USER_HEADER {0x0000}
 User-Header id for no user-header.
 
static constexpr uint16_t UNKNOWN_USER_HEADER {0xFFFF}
 User-Header id for an unknown user-header.
 

Friends

template<typename T >
class popo::ChunkSender
 

Constructor & Destructor Documentation

◆ ChunkHeader()

iox::mepoo::ChunkHeader::ChunkHeader ( const uint32_t  chunkSize,
const ChunkSettings chunkSettings 
)
noexcept

constructs and initializes a ChunkHeader

Parameters
[in]chunkSizeis the size of the chunk the ChunkHeader is constructed
[in]chunkSettingsare the settings like user-payload size and user-header alignment

Member Function Documentation

◆ chunkHeaderVersion()

uint8_t iox::mepoo::ChunkHeader::chunkHeaderVersion ( ) const
noexcept

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

Returns
the ChunkHeader version

◆ chunkSize()

uint32_t iox::mepoo::ChunkHeader::chunkSize ( ) const
noexcept

The size of the whole chunk, including the header.

Returns
the chunk size

◆ fromUserHeader() [1/2]

static const ChunkHeader * iox::mepoo::ChunkHeader::fromUserHeader ( const void *const  userHeader)
staticnoexcept

Get a const pointer to the ChunkHeader associated to the user-header of the chunk.

Parameters
[in]userHeaderis the const pointer to the user-header of the chunk
Returns
the const pointer to the ChunkHeader or a nullptr if userPayload is a nullptr

◆ fromUserHeader() [2/2]

static ChunkHeader * iox::mepoo::ChunkHeader::fromUserHeader ( void *const  userHeader)
staticnoexcept

Get a pointer to the ChunkHeader associated to the user-header of the chunk.

Parameters
[in]userHeaderis the pointer to the user-header of the chunk
Returns
the pointer to the ChunkHeader or a nullptr if userHeader is a nullptr

◆ fromUserPayload() [1/2]

static const ChunkHeader * iox::mepoo::ChunkHeader::fromUserPayload ( const void *const  userPayload)
staticnoexcept

Get a const pointer to the ChunkHeader associated to the user-payload of the chunk.

Parameters
[in]userPayloadis the const pointer to the user-payload of the chunk
Returns
the const pointer to the ChunkHeader or a nullptr if userPayload is a nullptr

◆ fromUserPayload() [2/2]

static ChunkHeader * iox::mepoo::ChunkHeader::fromUserPayload ( void *const  userPayload)
staticnoexcept

Get a pointer to the ChunkHeader associated to the user-payload of the chunk.

Parameters
[in]userPayloadis the pointer to the user-payload of the chunk
Returns
the pointer to the ChunkHeader or a nullptr if userPayload is a nullptr

◆ originId()

popo::UniquePortId iox::mepoo::ChunkHeader::originId ( ) const
noexcept

The unique identifier of the publisher the chunk was sent from.

Returns
the id of the publisher the chunk was sent from

◆ sequenceNumber()

uint64_t iox::mepoo::ChunkHeader::sequenceNumber ( ) const
noexcept

A serial number for the sent chunks.

the serquence number of the chunk

◆ usedSizeOfChunk()

uint32_t iox::mepoo::ChunkHeader::usedSizeOfChunk ( ) const
noexcept

Calculates the used size of the chunk with the ChunkHeader, user-heander and user-payload.

Returns
the used size of the chunk

◆ userHeader() [1/2]

const void * iox::mepoo::ChunkHeader::userHeader ( ) const
noexcept

Get the const pointer to the user-header.

Returns
the const pointer to the user-header

◆ userHeader() [2/2]

void * iox::mepoo::ChunkHeader::userHeader ( )
noexcept

Get the pointer to the user-header.

Returns
the pointer to the user-header

◆ userHeaderId()

uint16_t iox::mepoo::ChunkHeader::userHeaderId ( ) const
noexcept

The id of the user-header used by the chunk; if no user-header is used, this is set to NO_USER_HEADER.

Returns
the user-header id of the chunk

◆ userHeaderSize()

uint32_t iox::mepoo::ChunkHeader::userHeaderSize ( ) const
noexcept

The size of the chunk occupied by the user-header.

Returns
the user-header size

◆ userPayload() [1/2]

const void * iox::mepoo::ChunkHeader::userPayload ( ) const
noexcept

Get a const pointer to the user-payload carried by the chunk.

Returns
the const pointer to the user-payload

◆ userPayload() [2/2]

void * iox::mepoo::ChunkHeader::userPayload ( )
noexcept

Get a pointer to the user-payload carried by the chunk.

Returns
the pointer to the user-payload

◆ userPayloadAlignment()

uint32_t iox::mepoo::ChunkHeader::userPayloadAlignment ( ) const
noexcept

The alignment of the chunk occupied by the user-payload.

Returns
the user-payload alignment

◆ userPayloadSize()

uint32_t iox::mepoo::ChunkHeader::userPayloadSize ( ) const
noexcept

The size of the chunk occupied by the user-payload.

Returns
the user-payload size

Member Data Documentation

◆ CHUNK_HEADER_VERSION

constexpr uint8_t iox::mepoo::ChunkHeader::CHUNK_HEADER_VERSION {1U}
staticconstexpr

From the 1.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

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