TPublisher<TPayload, TUserHeader>
Sending endpoint of a publish-subscriber based communication.
Definition
Unit: Neslib.Iceoryx2.PublishSubscribe
Type Parameters
TPayload:
TUserHeader:
Nested Types
| Name | Description |
|---|---|
| PPayload |
Properties
| Name | Description |
|---|---|
| AllocationStrategy | Returns the TAllocationStrategy that is used when the provided TPublisher loans a slice bigger than the initial maximum slice length. |
| BackpressureStrategy | Returns the strategy the TPublisher follows when a TSampleMut cannot be delivered since the TSubscriber's buffer is full. |
| Handle | |
| Id | Returns the TUniquePublisherId of the TPublisher |
| InitialMaxSliceLen | Returns the maximum number of elements that can be loaned in a slice. |
| MaxLoanedSamples | Returns the maximum number of TSampleMut's that can be loaned in parallel. |
| Name | Returns the TPortNameView of the TPublisher |
Constructors
| Name | Description |
|---|---|
| Assign | |
| Finalize | |
| Initialize |
Operators
| Name | Description |
|---|---|
| Equal | |
| NotEqual |
Methods
| Name | Description |
|---|---|
| Loan | Loans/allocates a TSampleMut from the underlying data segment of the publisher and initialize it with the default value. This can be a performance hit and TPublisher.LoanUninit can be used to loan an uninitialized TSampleMut. |
| LoanSlice | Loans/allocates a TSampleMut from the underlying data segment of the TPublisher and initializes all slice elements with the default value. This can be a performance hit and TPublisher.LoanSliceUninit can be used to loan a slice of uninitialized payload. |
| LoanSliceUninit | Loans/allocates a TSampleMutUninit from the underlying data segment of the Publisher. The user has to initialize the payload before it can be sent. |
| LoanUninit | Loans/allocates a TSampleMutUninit from the underlying data segment of the publisher. The user has to initialize the payload before it can be sent. |
| SendCopy | Copies the input value into a TSampleMut and delivers it. On success it returns the number of TSubscriber's that received the data, otherwise a TSendError describing the failure. |
| SendSliceCopy | Copies the input APayload slice into a TSampleMut and delivers it. On success it returns the number of TSubscriber's that received the data, otherwise a TSendError describing the failure. |
| UpdateConnections | Explicitly updates all connections to the TSubscriber's. This is required to be called whenever a new TSubscriber is connected to the service. It is called implicitly whenever TSampleMut.Send or TPublisher.SendCopy is called. When a TSubscriber is connected that requires a history this call will deliver it. |
Property Descriptions
AllocationStrategy
Returns the TAllocationStrategy that is used when the provided TPublisher loans a slice bigger than the initial maximum slice length.
property AllocationStrategy: TAllocationStrategy read GetAllocationStrategy
Type: TAllocationStrategy
Remarks
Can only be used when TPayload is a slice (TSlice
BackpressureStrategy
Returns the strategy the TPublisher follows when a TSampleMut cannot be delivered since the TSubscriber's buffer is full.
property BackpressureStrategy: TBackpressureStrategy read GetBackpressureStrategy
Type: TBackpressureStrategy
Handle
property Handle: THandle read GetHandle
Type: THandle
Id
Returns the TUniquePublisherId of the TPublisher
property Id: TUniquePublisherId read GetId
Type: TUniquePublisherId
InitialMaxSliceLen
Returns the maximum number of elements that can be loaned in a slice.
property InitialMaxSliceLen: Int64 read GetInitialMaxSliceLen
Type: Int64
Remarks
Can only be used when TPayload is a slice (TSlice
MaxLoanedSamples
Returns the maximum number of TSampleMut's that can be loaned in parallel.
property MaxLoanedSamples: Int64 read GetMaxLoanedSamples
Type: Int64
Name
Returns the TPortNameView of the TPublisher
property Name: TPortNameView read GetName
Type: TPortNameView
Constructor Descriptions
Assign
constructor Assign(var ADest: TPublisher<TPayload, TUserHeader>; const ASrc: TPublisher<TPayload, TUserHeader>)
Parameters
ADest: TPublisher<TPayload, TUserHeader>
ASrc: TPublisher<TPayload, TUserHeader>
Finalize
destructor Finalize
Initialize
constructor Initialize
Operator Descriptions
Equal(TPublisher, Pointer)
class operator Equal(const ALeft: TPublisher<TPayload, TUserHeader>; const ARight: Pointer): Boolean; inline; static
Parameters
ALeft: TPublisher<TPayload, TUserHeader>
ARight: Pointer
Returns
Boolean
NotEqual(TPublisher, Pointer)
class operator NotEqual(const ALeft: TPublisher<TPayload, TUserHeader>; const ARight: Pointer): Boolean; inline; static
Parameters
ALeft: TPublisher<TPayload, TUserHeader>
ARight: Pointer
Returns
Boolean
Method Descriptions
Loan
Loans/allocates a TSampleMut from the underlying data segment of the publisher and initialize it with the default value. This can be a performance hit and TPublisher.LoanUninit can be used to loan an uninitialized TSampleMut.
On failure it returns a TLoanError describing the failure.
function Loan: TResult<TSampleMut<TPayload>, TLoanError>; inline
Returns
TResult<TSampleMut<TPayload>, TLoanError>
Remarks
Cannot be used when TPayload is a slice (TSlice
LoanSlice(UInt64)
Loans/allocates a TSampleMut from the underlying data segment of the TPublisher and initializes all slice elements with the default value. This can be a performance hit and TPublisher.LoanSliceUninit can be used to loan a slice of uninitialized payload.
On failure it returns TLoanError describing the failure.
function LoanSlice(const ANumerOfElements: UInt64): TResult<TSampleMut<TPayload>, TLoanError>; inline
Parameters
ANumerOfElements: UInt64
Returns
TResult<TSampleMut<TPayload>, TLoanError>
Remarks
Can only be used when TPayload is a slice (TSlice
LoanSliceUninit(UInt64)
Loans/allocates a TSampleMutUninit from the underlying data segment of the Publisher. The user has to initialize the payload before it can be sent.
On failure it returns a TLoanError describing the failure.
function LoanSliceUninit(const ANumerOfElements: UInt64): TResult<TSampleMutUninit<TPayload>, TLoanError>; inline
Parameters
ANumerOfElements: UInt64
Returns
TResult<TSampleMutUninit<TPayload>, TLoanError>
Remarks
Can only be used when TPayload is a slice (TSlice
LoanUninit
Loans/allocates a TSampleMutUninit from the underlying data segment of the publisher. The user has to initialize the payload before it can be sent.
function LoanUninit: TResult<TSampleMutUninit<TPayload>, TLoanError>; inline
Returns
TResult<TSampleMutUninit<TPayload>, TLoanError>
Remarks
Cannot be used when TPayload is a slice (TSlice
SendCopy(TPayload)
Copies the input value into a TSampleMut and delivers it. On success it returns the number of TSubscriber's that received the data, otherwise a TSendError describing the failure.
function SendCopy(const APayload: TPayload): TResult<NativeInt, TSendError>; inline
Parameters
APayload: TPayload
Returns
TResult<NativeInt, TSendError>
Remarks
Cannot be used when TPayload is a slice (TSlice
SendSliceCopy(TPayload)
Copies the input APayload slice into a TSampleMut and delivers it. On success it returns the number of TSubscriber's that received the data, otherwise a TSendError describing the failure.
function SendSliceCopy(const APayload: TPayload): TResult<NativeInt, TSendError>; inline
Parameters
APayload: TPayload
Returns
TResult<NativeInt, TSendError>
Remarks
Can only be used when TPayload is a slice (TSlice
UpdateConnections
Explicitly updates all connections to the TSubscriber's. This is required to be called whenever a new TSubscriber is connected to the service. It is called implicitly whenever TSampleMut.Send or TPublisher.SendCopy is called. When a TSubscriber is connected that requires a history this call will deliver it.
function UpdateConnections: TResult<Void, TConnectionFailure>; inline
Returns
TResult<Void, TConnectionFailure>