109template <
typename MsgT, SecurityType SecT = SecurityType::kWithoutSecurity>
113 using UniquePtr = std::unique_ptr<Subscriber<MsgT, SecT>>;
116 using SharedPtr = std::shared_ptr<Subscriber<MsgT, SecT>>;
160 template <
typename ConfT,
typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>>
275template <
typename MsgT>
std::function< void(const IntraData &)> IntraMsgCallback
Callback delivering an in-process IntraData message.
Definition node_impl.h:186
std::function< void(const Bytes &)> MsgCallback
Callback delivering a raw serialised message to a SubscriberImpl or GetterImpl.
Definition node_impl.h:177
Node()
Definition node-inl.h:322
Convenience alias for Subscriber with message security enabled.
Definition subscriber.h:276
static constexpr ImplType kImplType
Node role identifier (kSubscriber).
Definition subscriber.h:122
bool listen(MsgCallback &&callback)
Registers the receive callback for incoming messages.
Definition subscriber-inl.h:91
static UniquePtr create_unique(const std::string &url_str, InitType type=InitType::kWithInit)
Creates a Subscriber on the heap wrapped in a unique_ptr.
Definition subscriber-inl.h:39
std::shared_ptr< Subscriber< MsgT, SecT > > SharedPtr
Shared-pointer alias for heap allocation.
Definition subscriber.h:116
void mark_as_getter()
Changes this subscriber's role to kGetter (field-reader).
Definition subscriber-inl.h:151
bool is_latency_and_lost_enabled() const
Returns true if latency and sample-loss tracking is active.
Definition subscriber-inl.h:136
static SharedPtr create_shared(const std::string &url_str, InitType type=InitType::kWithInit)
Creates a Subscriber on the heap wrapped in a shared_ptr.
Definition subscriber-inl.h:45
SampleLostInfo get_lost() const
Returns cumulative sample delivery statistics.
Definition subscriber-inl.h:146
static constexpr Serializer::Type kMsgType
Serializer type resolved at compile time from MsgT.
Definition subscriber.h:125
std::function< void(const MsgT &)> MsgCallback
User-facing callback type for received messages.
Definition subscriber.h:119
int64_t get_latency() const
Returns the most recently measured end-to-end message latency.
Definition subscriber-inl.h:141
void set_latency_and_lost_enabled(bool enable)
Enables or disables per-message latency and sample-loss tracking.
Definition subscriber-inl.h:131
std::unique_ptr< Subscriber< MsgT, SecT > > UniquePtr
Unique-pointer alias for heap allocation.
Definition subscriber.h:113
void set_manual_unloan(bool manual_unloan) override
Enables or disables manual-unloan mode for zero-copy receives.
Definition subscriber-inl.h:125
Subscriber(const ConfT &conf, InitType type=InitType::kWithInit)
Constructs a subscriber from a typed transport configuration object.
Definition subscriber-inl.h:52
constexpr Type get_type_of() noexcept
Deduces the Type enumerator for T at compile time.
Definition serializer-inl.h:160
Type
Identifies the serialisation codec to use for a given C++ type.
Definition serializer.h:123
constexpr bool is_supported(Type type) noexcept
Returns true when type identifies a supported serializer.
Definition serializer-inl.h:157
InitType
Controls whether a node is initialised immediately at construction.
Definition types.h:132
@ kWithInit
Initialise immediately in the constructor.
Definition types.h:134
ImplType
Bitmask identifying the role of a VLink node implementation.
Definition types.h:89
@ kSubscriber
Event subscriber (receive broadcast).
Definition types.h:94
@ kWithSecurity
Encrypted and authenticated transport.
Definition types.h:150
Base CRTP template for all VLink communication nodes.
Cumulative sample delivery statistics for a subscriber or getter.
Definition types.h:217
Abstract base class for all transport-specific subscriber implementations.