Syntalos::ipc::SyPublisher

Syntalos::ipc::SyPublisher

Syntalos::ipc::SyPublisher

Publisher side of a Syntalos data channel. More…

#include <ipc-iox-private.h>

Inherits from iox2::FileDescriptorBased

Public Types

Name
using iox2::SampleMutUninit< iox2::ServiceType::Ipc, iox2::bb::Slice< std::byte >, void >SliceLoan
The uninitialised loan type returned by loanSlice().

Public Functions

Name
SyPublisher(const SyPublisher & ) =delete
SyPublisher(SyPublisher && other)
SyPublisher &operator=(const SyPublisher & ) =delete
SyPublisher &operator=(SyPublisher && other)
~SyPublisher() override
autofile_descriptor() const override
autoserviceName() const
voidhandleEvents()
autoloanSlice(size_t size)
voidsendSlice(SliceLoan && loan)
voidsendBytes(const std::byte * data, size_t size)
SyPublishercreate(iox2::Node< iox2::ServiceType::Ipc > & node, const std::string & instanceId, const std::string & channelName)

Detailed Description

class Syntalos::ipc::SyPublisher;

Publisher side of a Syntalos data channel.

Combines a byte-slice iox2 publisher with an event notifier and listener on the same service name. On creation it fires PublisherConnected; on destruction it fires PublisherDisconnected. Every send() fires SentSample so attached subscribers wake immediately.

The object is FileDescriptorBased (via its listener) so it can be attached to a WaitSet to receive SubscriberConnected / SubscriberDisconnected events from the other side.

No history is used — Syntalos guarantees workers are ready before the master starts emitting data.

Public Types Documentation

using SliceLoan

using Syntalos::ipc::SyPublisher::SliceLoan =  iox2::SampleMutUninit<iox2::ServiceType::Ipc, iox2::bb::Slice<std::byte>, void>;

The uninitialised loan type returned by loanSlice().

Public Functions Documentation

function SyPublisher

SyPublisher(
    const SyPublisher & 
) =delete

function SyPublisher

inline SyPublisher(
    SyPublisher && other
)

function operator=

SyPublisher & operator=(
    const SyPublisher & 
) =delete

function operator=

inline SyPublisher & operator=(
    SyPublisher && other
)

function ~SyPublisher

inline ~SyPublisher() override

function file_descriptor

inline auto file_descriptor() const override

function serviceName

inline auto serviceName() const

function handleEvents

inline void handleEvents()

function loanSlice

inline auto loanSlice(
    size_t size
)

Loan a shared-memory slice of size bytes from the publisher.

The caller writes into the slice via loan.payload_mut(), then passes the loan to sendSlice() to publish it and notify subscribers.

function sendSlice

inline void sendSlice(
    SliceLoan && loan
)

Mark a loaned slice as initialized, publish it, and fire a notification so subscribers wake up.

function sendBytes

inline void sendBytes(
    const std::byte * data,
    size_t size
)

Convenience overload: copy size bytes from data into a freshly loaned slice and publish it. Use loanSlice()/commitAndSend() directly when the data type can write into shared memory itself (zero-copy).

function create

static inline SyPublisher create(
    iox2::Node< iox2::ServiceType::Ipc > & node,
    const std::string & instanceId,
    const std::string & channelName
)

Create a SyPublisher for the given instance/channel. Either side may arrive first.


Updated on 2026-03-16 at 19:16:01 +0000