90template <
typename ValueT, SecurityType SecT = SecurityType::kWithoutSecurity>
94 using UniquePtr = std::unique_ptr<Setter<ValueT, SecT>>;
97 using SharedPtr = std::shared_ptr<Setter<ValueT, SecT>>;
138 template <
typename ConfT,
typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>>
159 bool init()
override;
184 void set(
const ValueT& value);
199 void write(
const ValueT& value);
201 void write_bytes(
const Bytes& data);
203 std::optional<ValueT> value_;
217template <
typename ValueT>
Versatile 128-byte byte buffer with SBO, five ownership modes and compression helpers.
Definition bytes.h:113
Node()
Definition node-inl.h:322
Convenience alias for Setter with message security enabled.
Definition setter.h:218
static SharedPtr create_shared(const std::string &url_str, InitType type=InitType::kWithInit)
Creates a Setter on the heap wrapped in a shared_ptr.
Definition setter-inl.h:44
void set(const ValueT &value)
Writes a new field value and notifies all connected Getter nodes.
Definition setter-inl.h:110
bool init() override
Initializes the setter transport and registers the late-getter sync callback.
Definition setter-inl.h:90
void mark_as_publisher()
Changes this setter's role to kPublisher (event-emitter).
Definition setter-inl.h:124
bool deinit() override
Deinitializes the setter and releases the underlying transport resources.
Definition setter-inl.h:105
std::shared_ptr< Setter< ValueT, SecT > > SharedPtr
Shared-pointer alias.
Definition setter.h:97
static constexpr ImplType kImplType
Node role identifier (kSetter).
Definition setter.h:100
static UniquePtr create_unique(const std::string &url_str, InitType type=InitType::kWithInit)
Creates a Setter on the heap wrapped in a unique_ptr.
Definition setter-inl.h:38
Setter(const ConfT &conf, InitType type=InitType::kWithInit)
Constructs a setter from a typed transport configuration object.
Definition setter-inl.h:51
std::unique_ptr< Setter< ValueT, SecT > > UniquePtr
Unique-pointer alias.
Definition setter.h:94
static constexpr Serializer::Type kValueType
Serializer type resolved at compile time from ValueT.
Definition setter.h:103
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
@ kSetter
Field setter (update latest value).
Definition types.h:95
@ kWithSecurity
Encrypted and authenticated transport.
Definition types.h:150
Base CRTP template for all VLink communication nodes.
Abstract base class for all transport-specific setter (field writer) implementations.