Skip to content

TSample<TPayload, TUserHeader>

Stores the payload and is acquired by the TSubscriber whenever it receives new data from a TPublisher via TSubscriber.Receive.

Definition

Unit: Neslib.Iceoryx2.PublishSubscribe

type TSample<TPayload, TUserHeader> = record ... end;

Type Parameters

TPayload:

TUserHeader:

Remarks

IMPORTANT: Do not move the sample into another thread!

Nested Types

Name Description
PPayload
PUserHeader

Properties

Name Description
Handle
Header Returns a reference to the header of the TSample.
Origin Returns the TUniquePublisherId of the TPublisher.
UserHeader Returns a reference to the user header of the sample

Constructors

Name Description
Assign
Finalize
Initialize

Operators

Name Description
Equal
NotEqual

Methods

Name Description
Payload Returns a reference to the payload of the sample.
PayloadSlice<T> Returns a slice to navigate the payload of the sample.

Property Descriptions

Handle

property Handle: THandle read GetHandle

Type: THandle


Returns a reference to the header of the TSample.

property Header: THeaderPublishSubscribe read GetHeader

Type: THeaderPublishSubscribe


Origin

Returns the TUniquePublisherId of the TPublisher.

property Origin: TUniquePublisherId read GetOrigin

Type: TUniquePublisherId


UserHeader

Returns a reference to the user header of the sample

property UserHeader: PUserHeader read GetUserHeader

Type: PUserHeader

Remarks

Cannot be used when there is no TUserHeader (that is, when TUserHeader=Void). This is checked with an assertion.


Constructor Descriptions

Assign

constructor Assign(var ADest: TSample<TPayload, TUserHeader>; const ASrc: TSample<TPayload, TUserHeader>)

Parameters

ADest: TSample<TPayload, TUserHeader>

ASrc: TSample<TPayload, TUserHeader>


Finalize

destructor Finalize


Initialize

constructor Initialize


Operator Descriptions

Equal(TSample, Pointer)

class operator Equal(const ALeft: TSample<TPayload, TUserHeader>; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSample<TPayload, TUserHeader>

ARight: Pointer

Returns

Boolean


NotEqual(TSample, Pointer)

class operator NotEqual(const ALeft: TSample<TPayload, TUserHeader>; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSample<TPayload, TUserHeader>

ARight: Pointer

Returns

Boolean


Method Descriptions

Payload

Returns a reference to the payload of the sample.

function Payload: PPayload; inline

Returns

PPayload

Remarks

Cannot be used when TPayload is a slice (TSlice). This is checked with an assertion. Otherwise use PayloadSlice instead.


PayloadSlice<T>

Returns a slice to navigate the payload of the sample.

function PayloadSlice<T>: TSlice<T>; inline

Type Parameters

T:

Returns

TSlice<T>

Remarks

Can only be used when TPayload is a slice (TSlice). This is checked with an assertion. Otherwise use Payload instead.

The type parameter T must be the element type of the slice. E.g. if TPayload = TSlice<word>, then T must be Word. This is checked with an assertion.