MessagePort Class Reference

Space-ng SDK: sol3::core::MessagePort Class Reference
Space-ng SDK
sol3::core::MessagePort Class Reference

#include <sol3/core/message_port.h>

Public Member Functions

 MessagePort ()=default
 Default-constructed port with zero value and payload type. More...
 
 MessagePort (uint32_t encoded, uint32_t payload_type)
 Construct from encoded value. More...
 
 MessagePort (uint32_t component_id, msg::InterfaceType interface_type, uint32_t interface_id, uint32_t payload_type)
 
uint16_t componentId () const
 12-bit component identifier extracted from the port value. More...
 
sol3::core::msg::InterfaceType interfaceType () const
 Interface type encoded in bits [15:12]. More...
 
uint16_t interfaceId () const
 12-bit interface/index extracted from the port value. More...
 
uint32_t payloadType () const
 32-bit FlatBuffers file identifier of the payload type for this port. More...
 
uint32_t encoded () const
 Packed 32-bit port value. More...
 

Detailed Description

A logical message port (component id, interface type, interface id) and associated payload type.

The encoded bit layout: [31:28] unused (0) [27:16] component id (12 bits) [15:12] interface type (4 bits) [11:00] interface id (12 bits)

The payloadType() stores the 32-bit identifier for the payload type carried on this port. Typically this is the flatbuffer file_identifer.

Constructor & Destructor Documentation

◆ MessagePort() [1/3]

sol3::core::MessagePort::MessagePort ( )
default

Default-constructed port with zero value and payload type.

◆ MessagePort() [2/3]

sol3::core::MessagePort::MessagePort ( uint32_t  encoded,
uint32_t  payload_type 
)
inline

Construct from encoded value.

◆ MessagePort() [3/3]

sol3::core::MessagePort::MessagePort ( uint32_t  component_id,
msg::InterfaceType  interface_type,
uint32_t  interface_id,
uint32_t  payload_type 
)
inline

Constructs a port from its components and associates a payload type.

Only the low 12 bits of component and interface are kept. Only the low 4 bits of interface_type are kept.

Member Function Documentation

◆ componentId()

uint16_t sol3::core::MessagePort::componentId ( ) const
inline

12-bit component identifier extracted from the port value.

◆ encoded()

uint32_t sol3::core::MessagePort::encoded ( ) const
inline

Packed 32-bit port value.

◆ interfaceId()

uint16_t sol3::core::MessagePort::interfaceId ( ) const
inline

12-bit interface/index extracted from the port value.

◆ interfaceType()

sol3::core::msg::InterfaceType sol3::core::MessagePort::interfaceType ( ) const
inline

Interface type encoded in bits [15:12].

◆ payloadType()

uint32_t sol3::core::MessagePort::payloadType ( ) const
inline

32-bit FlatBuffers file identifier of the payload type for this port.


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