119 #include <type_traits>
141 template <
typename MsgT, SecurityType SecT = SecurityType::kWithoutSecurity>
144 using UniquePtr = std::unique_ptr<Subscriber<MsgT, SecT>>;
145 using SharedPtr = std::shared_ptr<Subscriber<MsgT, SecT>>;
183 template <
typename ConfT,
typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>>
292 template <
typename MsgT>
295 using UniquePtr = std::unique_ptr<SecuritySubscriber<MsgT>>;
296 using SharedPtr = std::shared_ptr<SecuritySubscriber<MsgT>>;
308 template <
typename SecurityConfigT = Security::Config>
322 template <
typename SecurityConfigT = Security::Config>
336 template <
typename ConfT,
typename SecurityConfigT = Security::Config,
337 typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>>
355 template <
typename SecurityConfigT = Security::Config>
356 explicit SecuritySubscriber(
const std::string& url_str, SecurityConfigT&& sec_cfg = {},
Copyable type-erased callable analogue of std::function with a tunable SBO and pool spill.
Definition: functional.h:131
Transport-agnostic CRTP base for all VLink communication primitives.
Definition: node.h:164
Convenience alias of Subscriber with per-message decryption enabled.
Definition: subscriber.h:293
std::shared_ptr< SecuritySubscriber< MsgT > > SharedPtr
Owning shared-pointer alias.
Definition: subscriber.h:296
static SharedPtr create_shared(const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
Heap-allocates a SecuritySubscriber and wraps it in a std::shared_ptr.
Definition: subscriber-inl.h:245
static UniquePtr create_unique(const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
Heap-allocates a SecuritySubscriber and wraps it in a std::unique_ptr.
Definition: subscriber-inl.h:234
std::unique_ptr< SecuritySubscriber< MsgT > > UniquePtr
Owning unique-pointer alias.
Definition: subscriber.h:295
SecuritySubscriber(const ConfT &conf, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
Constructs a SecuritySubscriber from a typed configuration object.
Definition: subscriber-inl.h:256
Type-safe topic listener for the VLink event communication model.
Definition: subscriber.h:142
static constexpr ImplType kImplType
Node role tag (kSubscriber).
Definition: subscriber.h:148
bool listen(MsgCallback &&callback)
Installs the receive callback that runs for every inbound message.
Definition: subscriber-inl.h:90
static UniquePtr create_unique(const std::string &url_str, InitType type=InitType::kWithInit)
Heap-allocates a Subscriber and wraps it in a std::unique_ptr.
Definition: subscriber-inl.h:39
void mark_as_getter()
Promotes this subscriber to behave as a Getter (field-reader) at the transport layer.
Definition: subscriber-inl.h:150
bool is_latency_and_lost_enabled() const
Reports whether latency and sample-loss tracking is currently active.
Definition: subscriber-inl.h:135
static SharedPtr create_shared(const std::string &url_str, InitType type=InitType::kWithInit)
Heap-allocates a Subscriber and wraps it in a std::shared_ptr.
Definition: subscriber-inl.h:45
SampleLostInfo get_lost() const
Returns cumulative sample-delivery statistics.
Definition: subscriber-inl.h:145
static constexpr Serializer::Type kMsgType
Codec resolved from MsgT.
Definition: subscriber.h:149
std::unique_ptr< Subscriber< MsgT, SecT > > UniquePtr
Owning unique-pointer alias.
Definition: subscriber.h:144
int64_t get_latency() const
Returns the most recent end-to-end latency measurement.
Definition: subscriber-inl.h:140
void set_latency_and_lost_enabled(bool enable)
Toggles per-message latency and sample-loss measurement.
Definition: subscriber-inl.h:130
std::shared_ptr< Subscriber< MsgT, SecT > > SharedPtr
Owning shared-pointer alias.
Definition: subscriber.h:145
void set_manual_unloan(bool manual_unloan) override
Enables or disables manual-unloan mode for zero-copy receives.
Definition: subscriber-inl.h:124
Subscriber(const ConfT &conf, InitType type=InitType::kWithInit)
Constructs a subscriber from a typed transport configuration object.
Definition: subscriber-inl.h:52
Pool-backed type-erased callables: copyable vlink::Function and move-only vlink::MoveFunction.
Type
Identifies the codec to use for a given C++ message type.
Definition: serializer.h:154
constexpr bool is_supported(Type type) noexcept
Reports whether type identifies a usable codec.
Definition: serializer-inl.h:160
InitType
Selects between immediate and deferred node initialisation.
Definition: types.h:154
@ kWithInit
Initialise immediately in the constructor.
ImplType
Bitmask identifying the role of a VLink node implementation.
Definition: types.h:110
@ kSubscriber
Event subscriber (receives broadcasts).
Definition: types.h:115
Common CRTP base for every VLink communication primitive.
Aggregate of cumulative delivered / lost sample counts.
Definition: types.h:273
Transport-neutral base class for every event-model subscriber implementation.