Syntalos::ipc::SySubscriber

Syntalos::ipc::SySubscriber

Syntalos::ipc::SySubscriber

Subscriber side of a Syntalos data channel. More…

#include <ipc-iox-private.h>

Inherits from iox2::FileDescriptorBased

Public Functions

Name
SySubscriber(const SySubscriber & ) =delete
SySubscriber(SySubscriber && other)
SySubscriber &operator=(const SySubscriber & ) =delete
SySubscriber &operator=(SySubscriber && other)
~SySubscriber() override
autofile_descriptor() const override
autoserviceName() const
template <typename Fn >
void
handleEvents(Fn && callback)
voiddrain()
SySubscribercreate(iox2::Node< iox2::ServiceType::Ipc > & node, const std::string & instanceId, const std::string & channelName)

Detailed Description

class Syntalos::ipc::SySubscriber;

Subscriber side of a Syntalos data channel.

Combines a byte-slice iox2 subscriber with an event notifier and listener on the same service name. On creation, it fires SubscriberConnected. On destruction, it fires SubscriberDisconnected.

The object is FileDescriptorBased (via its listener) so it can be attached to a WaitSet and wake when the publisher fires SentSample. The caller should then call handleEvents() to dispatch events and read data.

Public Functions Documentation

function SySubscriber

SySubscriber(
    const SySubscriber & 
) =delete

function SySubscriber

inline SySubscriber(
    SySubscriber && other
)

function operator=

SySubscriber & operator=(
    const SySubscriber & 
) =delete

function operator=

inline SySubscriber & operator=(
    SySubscriber && other
)

function ~SySubscriber

inline ~SySubscriber() override

function file_descriptor

inline auto file_descriptor() const override

function serviceName

inline auto serviceName() const

function handleEvents

template <typename Fn >
inline void handleEvents(
    Fn && callback
)

Drain the event listener completely, calling callback(payload) for every sample.

Any event that isn’t on a received sample is handled internally.

function drain

inline void drain()

Discard any pending data.

function create

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

Create a SySubscriber for the given instance/channel. Uses open_or_create so either side may arrive first.


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