92 #include <type_traits>
112 template <
typename ValueT, SecurityType SecT = SecurityType::kWithoutSecurity>
115 using UniquePtr = std::unique_ptr<Setter<ValueT, SecT>>;
116 using SharedPtr = std::shared_ptr<Setter<ValueT, SecT>>;
154 template <
typename ConfT,
typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>>
186 bool init()
override;
211 void set(
const ValueT& value);
225 void write(
const ValueT& value);
227 void write_bytes(
const Bytes& data);
229 std::optional<ValueT> value_;
243 template <
typename ValueT>
246 using UniquePtr = std::unique_ptr<SecuritySetter<ValueT>>;
247 using SharedPtr = std::shared_ptr<SecuritySetter<ValueT>>;
259 template <
typename SecurityConfigT = Security::Config>
273 template <
typename SecurityConfigT = Security::Config>
287 template <
typename ConfT,
typename SecurityConfigT = Security::Config,
288 typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>>
306 template <
typename SecurityConfigT = Security::Config>
307 explicit SecuritySetter(
const std::string& url_str, SecurityConfigT&& sec_cfg = {},
Fixed-size 128-byte buffer holder with SBO, five ownership modes and integrated codecs.
Definition: bytes.h:120
Transport-agnostic CRTP base for all VLink communication primitives.
Definition: node.h:164
Convenience alias of Setter with per-message encryption enabled.
Definition: setter.h:244
SecuritySetter(const ConfT &conf, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
Constructs a SecuritySetter from a typed configuration object.
Definition: setter-inl.h:227
std::shared_ptr< SecuritySetter< ValueT > > SharedPtr
Owning shared-pointer alias.
Definition: setter.h:247
std::unique_ptr< SecuritySetter< ValueT > > UniquePtr
Owning unique-pointer alias.
Definition: setter.h:246
static SharedPtr create_shared(const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
Heap-allocates a SecuritySetter and wraps it in a std::shared_ptr.
Definition: setter-inl.h:216
static UniquePtr create_unique(const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
Heap-allocates a SecuritySetter and wraps it in a std::unique_ptr.
Definition: setter-inl.h:205
Type-safe latest-value writer for the VLink field communication model.
Definition: setter.h:113
std::shared_ptr< Setter< ValueT, SecT > > SharedPtr
Owning shared-pointer alias.
Definition: setter.h:116
static SharedPtr create_shared(const std::string &url_str, InitType type=InitType::kWithInit)
Heap-allocates a Setter and wraps it in a std::shared_ptr.
Definition: setter-inl.h:45
void set(const ValueT &value)
Writes a new field value and emits it to every connected Getter.
Definition: setter-inl.h:122
bool init() override
Initialises the setter and registers the late-getter sync() hook.
Definition: setter-inl.h:96
void mark_as_publisher()
Promotes this setter to behave as a Publisher at the transport layer.
Definition: setter-inl.h:140
bool deinit() override
Deinitialises the setter and releases the underlying transport resources.
Definition: setter-inl.h:117
static constexpr ImplType kImplType
Node role tag (kSetter).
Definition: setter.h:118
static UniquePtr create_unique(const std::string &url_str, InitType type=InitType::kWithInit)
Heap-allocates a Setter and wraps it in a std::unique_ptr.
Definition: setter-inl.h:39
Setter(const ConfT &conf, InitType type=InitType::kWithInit)
Constructs a setter from a typed transport configuration object.
Definition: setter-inl.h:52
~Setter() override
Destroys the setter and drains in-flight transport callbacks.
Definition: setter-inl.h:90
std::unique_ptr< Setter< ValueT, SecT > > UniquePtr
Owning unique-pointer alias.
Definition: setter.h:115
static constexpr Serializer::Type kValueType
Codec resolved from ValueT.
Definition: setter.h:119
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
@ kSetter
Field setter (writes latest value).
Definition: types.h:116
Common CRTP base for every VLink communication primitive.
Transport-neutral base class for every field-model setter (latest-value writer).