|
VLink
2.0.0
A high-performance communication middleware
|
Convenience alias of Setter with per-message encryption enabled.
更多...
#include <setter.h>
Public 类型 | |
| using | UniquePtr = std::unique_ptr< SecuritySetter< ValueT > > |
| Owning unique-pointer alias. 更多... | |
| using | SharedPtr = std::shared_ptr< SecuritySetter< ValueT > > |
| Owning shared-pointer alias. 更多... | |
Public 类型 继承自 vlink::Setter< ValueT, SecurityType::kWithSecurity > | |
| using | UniquePtr = std::unique_ptr< Setter< ValueT, SecT > > |
| Owning unique-pointer alias. 更多... | |
| using | SharedPtr = std::shared_ptr< Setter< ValueT, SecT > > |
| Owning shared-pointer alias. 更多... | |
Public 类型 继承自 vlink::Node< ImplT, SecT > | |
| using | StatusCallback = NodeImpl::StatusCallback |
| Handler signature for status-change notifications. 更多... | |
Public 成员函数 | |
| template<typename ConfT , typename SecurityConfigT = Security::Config, typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>> | |
| SecuritySetter (const ConfT &conf, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit) | |
Constructs a SecuritySetter from a typed configuration object. 更多... | |
| template<typename SecurityConfigT = Security::Config> | |
| SecuritySetter (const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit) | |
Constructs a SecuritySetter from a URL string and installs the security configuration. 更多... | |
Public 成员函数 继承自 vlink::Setter< ValueT, SecurityType::kWithSecurity > | |
| Setter (const ConfT &conf, InitType type=InitType::kWithInit) | |
| Constructs a setter from a typed transport configuration object. 更多... | |
| Setter (const std::string &url_str, InitType type=InitType::kWithInit) | |
| Constructs a setter from a URL string. 更多... | |
| ~Setter () override | |
| Destroys the setter and drains in-flight transport callbacks. 更多... | |
| bool | init () override |
Initialises the setter and registers the late-getter sync() hook. 更多... | |
| bool | deinit () override |
| Deinitialises the setter and releases the underlying transport resources. 更多... | |
| void | set (const ValueT &value) |
Writes a new field value and emits it to every connected Getter. 更多... | |
| void | mark_as_publisher () |
Promotes this setter to behave as a Publisher at the transport layer. 更多... | |
Public 成员函数 继承自 vlink::Node< ImplT, SecT > | |
| virtual void | interrupt () |
| Aborts any blocking wait on this node. 更多... | |
| bool | has_inited () const |
Reports whether init() has been successfully called. 更多... | |
| bool | is_support_loan () const |
| Reports whether the transport supports zero-copy loaned buffers. 更多... | |
| Bytes | loan (int64_t size) |
| Allocates a loaned buffer from the transport memory pool. 更多... | |
| bool | return_loan (const Bytes &bytes) |
| Returns a previously loaned buffer to the transport pool. 更多... | |
| virtual void | set_manual_unloan (bool manual_unloan) |
| Toggles manual-unloan mode for zero-copy receives. 更多... | |
| virtual bool | is_manual_unloan () const |
| Reports whether manual-unloan mode is currently active. 更多... | |
| bool | suspend () |
| Suspends message delivery on this node. 更多... | |
| bool | resume () |
Resumes message delivery after a prior suspend(). 更多... | |
| bool | is_suspend () const |
| Reports whether the node is currently suspended. 更多... | |
| bool | attach (class MessageLoop *message_loop) |
Attaches the node to a MessageLoop for callback dispatch. 更多... | |
| bool | detach () |
Detaches the node from its current MessageLoop. 更多... | |
| class MessageLoop * | get_message_loop () const |
Returns the MessageLoop this node is currently attached to. 更多... | |
| const AbstractNode * | get_abstract_node () const |
| Returns the abstract-graph handle for runtime topology inspection. 更多... | |
| Status::BasePtr | get_status (Status::Type type) const |
| Retrieves the current status object for the requested category. 更多... | |
| void | register_status_handler (StatusCallback &&callback) |
| Registers a handler invoked whenever the node's status changes. 更多... | |
| void | set_property (const std::string &prop, const std::string &value) |
| Sets a transport-specific string-keyed property. 更多... | |
| std::string | get_property (const std::string &prop) const |
| Retrieves a previously set transport-specific property value. 更多... | |
| TransportType | get_transport_type () const |
Returns the TransportType this node is bound to. 更多... | |
| const std::string & | get_url () const |
| Returns the URL string used to construct this node. 更多... | |
| void | set_record_path (const std::string &path) |
| Enables recording of inbound or outbound messages to a bag file. 更多... | |
| void | set_ser_type (const std::string &ser_type, SchemaType schema_type=SchemaType::kUnknown) |
| Overrides the runtime wire-metadata identifiers for this node. 更多... | |
| const std::string & | get_ser_type () const |
| Returns the current concrete runtime type identifier. 更多... | |
| SchemaType | get_schema_type () const |
| Returns the current coarse schema family. 更多... | |
| void | set_discovery_enabled (bool enable) |
| Toggles peer-discovery on this node. 更多... | |
| bool | get_discovery_enabled () const |
| Reports whether peer-discovery is currently enabled. 更多... | |
| void | bind_proto_arena (void *proto_arena) |
| Binds a Protobuf Arena for arena-allocated message objects. 更多... | |
| double | get_cpu_usage () const |
| Returns the cumulative CPU-usage ratio sampled by the profiler. 更多... | |
| bool | get_safety_quit () const |
| Reports whether safe-quit mode is currently active. 更多... | |
| void | set_safety_quit (bool safety_quit) |
| Enables or disables safe-quit mode. 更多... | |
| void | set_ssl_options (const SslOptions &options) |
| Configures transport-layer SSL/TLS encryption for this node. 更多... | |
静态 Public 成员函数 | |
| template<typename SecurityConfigT = Security::Config> | |
| 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. 更多... | |
| template<typename SecurityConfigT = Security::Config> | |
| 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. 更多... | |
静态 Public 成员函数 继承自 vlink::Setter< ValueT, SecurityType::kWithSecurity > | |
| 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. 更多... | |
| 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. 更多... | |
额外继承的成员函数 | |
静态 Public 属性 继承自 vlink::Setter< ValueT, SecurityType::kWithSecurity > | |
| static constexpr ImplType | kImplType |
Node role tag (kSetter). 更多... | |
| static constexpr Serializer::Type | kValueType |
Codec resolved from ValueT. 更多... | |
Protected 成员函数 继承自 vlink::Node< ImplT, SecT > | |
| Node () | |
| virtual | ~Node () |
| bool | enable_security (const Security::Config &cfg) |
Installs a Security configuration before transport initialisation. 更多... | |
| bool | enable_security (Security::Config &&cfg) |
| Move overload for construction-time security installation. 更多... | |
| template<typename CallbackT , typename... ArgsT> | |
| void | invoke_callback (const CallbackT &callback, ArgsT &&... args) |
| template<typename TypeT > | |
| TypeT | get_default_value () |
Protected 属性 继承自 vlink::Node< ImplT, SecT > | |
| void * | proto_arena_ {nullptr} |
| bool | is_support_loan_ {false} |
| bool | is_manual_unloan_ {false} |
| std::atomic_bool | has_inited_ {false} |
| std::optional< std::mutex > | quit_mtx_ |
| std::unique_ptr< ImplT > | impl_ |
Convenience alias of Setter with per-message encryption enabled.
Equivalent to Setter<ValueT, SecurityType::kWithSecurity>. Each outgoing payload is encrypted before transmission.
| ValueT | Value type to write. |
| using vlink::SecuritySetter< ValueT >::SharedPtr = std::shared_ptr<SecuritySetter<ValueT> > |
Owning shared-pointer alias.
| using vlink::SecuritySetter< ValueT >::UniquePtr = std::unique_ptr<SecuritySetter<ValueT> > |
Owning unique-pointer alias.
|
inlineexplicit |
Constructs a SecuritySetter from a typed configuration object.
| ConfT | Configuration type derived from Conf. |
| SecurityConfigT | Forwardable Security::Config compatible type. |
| conf | Populated configuration aggregate. |
| sec_cfg | Security configuration; empty uses the default symmetric slot. |
| type | Whether to call init() inline; default is InitType::kWithInit. |
|
inlineexplicit |
Constructs a SecuritySetter from a URL string and installs the security configuration.
Builds the base Setter in kWithoutInit mode, installs sec_cfg via enable_security(), then calls init() unless deferred. When enable_security() fails to produce a usable NodeImpl::security the subsequent init() will fail.
| SecurityConfigT | Forwardable Security::Config compatible type. |
| url_str | Field URL string. |
| sec_cfg | Security configuration; empty uses the default symmetric slot. |
| type | Whether to call init() inline; default is InitType::kWithInit. |
|
inlinestatic |
Heap-allocates a SecuritySetter and wraps it in a std::shared_ptr.
| SecurityConfigT | Forwardable Security::Config compatible type. |
| url_str | Field URL string. |
| sec_cfg | Security configuration; empty uses the default symmetric slot. |
| type | Whether to call init() inline; default is InitType::kWithInit. |
SharedPtr to the new secure setter.
|
inlinestatic |
Heap-allocates a SecuritySetter and wraps it in a std::unique_ptr.
| SecurityConfigT | Forwardable Security::Config compatible type. |
| url_str | Field URL string. |
| sec_cfg | Security configuration; empty uses the default symmetric slot. |
| type | Whether to call init() inline; default is InitType::kWithInit. |
UniquePtr to the new secure setter.