|
VLink 2.0.0
A high-performance communication middleware
|
Transport-agnostic base for setter (field writer) node implementations. More...
#include <setter_impl.h>
Public Member Functions | |
| ~SetterImpl () override | |
| Destructor. | |
| virtual void | write (const Bytes &msg_data)=0 |
| Writes a new field value to all connected getter nodes. | |
| virtual void | sync (SyncCallback &&callback)=0 |
| Waits for the most recently written value to be propagated, then fires the completion callback. | |
| Public Member Functions inherited from vlink::NodeImpl | |
| virtual void | init ()=0 |
| Initialises the underlying transport channel. | |
| virtual void | deinit ()=0 |
| Tears down the underlying transport channel. | |
| virtual bool | suspend () |
| Temporarily suspends message delivery without tearing down the channel. | |
| virtual bool | resume () |
Resumes message delivery after a suspend() call. | |
| virtual bool | is_suspend () const |
Returns true when the node is currently suspended. | |
| virtual void | interrupt () |
| Signals any blocking operations to unblock and return immediately. | |
| virtual bool | is_support_loan () const |
Returns true if the transport supports zero-copy loaning. | |
| virtual Bytes | loan (int64_t size) |
Borrows a write buffer of size bytes from the transport. | |
| virtual bool | return_loan (const Bytes &bytes) |
| Returns a previously loaned buffer to the transport. | |
| virtual void | set_manual_unloan (bool manual_unloan) |
| Configures manual unloan mode for zero-copy transports. | |
| virtual const struct Conf * | get_conf () const |
Returns a pointer to the associated Conf configuration object. | |
| virtual const AbstractNode * | get_abstract_node () const |
Returns a pointer to the AbstractNode peer (if any). | |
| virtual Status::BasePtr | get_status (Status::Type type) const |
| Retrieves a transport-specific status object. | |
| virtual bool | check_version (const Version &version) |
Checks whether version matches the runtime VLink library version. | |
| virtual bool | attach (class MessageLoop *message_loop) |
Attaches the node to a MessageLoop for callback dispatch. | |
| virtual bool | detach () |
Detaches the node from its MessageLoop. | |
| class MessageLoop * | get_message_loop () const |
Returns the MessageLoop this node is attached to. | |
| template<typename T> | |
| const T * | get_target_conf () const |
Returns a typed pointer to the conf by downcasting to T. | |
| void | register_status_handler (StatusCallback &&callback) |
| Registers a callback for DDS status events. | |
| bool | has_register_status () const |
Returns true if a status handler has been registered. | |
| void | call_status (Status::BasePtr ptr) |
| Dispatches a status event to the registered status handler. | |
| void | set_property (const std::string &prop, const std::string &value) |
| Sets a named transport property on this node. | |
| std::string | get_property (const std::string &prop) const |
| Retrieves a named transport property. | |
| Conf::PropertiesMap | get_all_properties () const |
| Returns a snapshot of all properties set on this node. | |
| void | set_discovery_enabled (bool enable) |
| Enables or disables discovery reporting for this node. | |
| bool | get_discovery_enabled () const |
Returns true if discovery reporting is enabled for this node. | |
| void | set_record_path (const std::string &path) |
| Sets the file path for per-node message recording. | |
| void | set_ssl_options (const SslOptions &options) |
| Merges SSL/TLS options into the node property map. | |
| void | try_record (ActionType action_type, const Bytes &data) |
| Records a message to the global and/or per-node bag writers. | |
| void | reset_interrupted () |
Clears the interrupted flag set by interrupt(). | |
| bool | is_interrupted () const |
Returns true if interrupt() has been called and not yet reset. | |
| void | init_ext () |
Registers the node with the global DiscoveryReporter. | |
| void | deinit_ext () |
Deregisters the node from the global DiscoveryReporter. | |
Protected Member Functions | |
| SetterImpl () | |
Protected constructor; initialises the setter with kSetter role. | |
| Protected Member Functions inherited from vlink::NodeImpl | |
| NodeImpl (ImplType type) | |
| virtual | ~NodeImpl () |
Additional Inherited Members | |
| Public Types inherited from vlink::NodeImpl | |
| using | ConnectCallback = std::function<void(bool)> |
| Callback invoked when the peer connection state changes. | |
| using | StatusCallback = std::function<void(const Status::BasePtr& ptr)> |
| Callback invoked on DDS status events (e.g. deadline missed). | |
| using | SyncCallback = std::function<void()> |
Callback invoked when a SetterImpl sync completes. | |
| using | ReqRespCallback = std::function<void(uint64_t, const Bytes&, Bytes*)> |
Callback for ServerImpl request/response processing. | |
| using | MsgCallback = std::function<void(const Bytes&)> |
Callback delivering a raw serialised message to a SubscriberImpl or GetterImpl. | |
| using | IntraMsgCallback = std::function<void(const IntraData&)> |
Callback delivering an in-process IntraData message. | |
| Static Public Member Functions inherited from vlink::NodeImpl | |
| static void | global_init () |
| Initialises process-wide VLink singletons. | |
| Public Attributes inherited from vlink::NodeImpl | |
| std::atomic_bool | has_suspend {false} |
| Atomic suspend state flag (currently unused by default impls). | |
| std::string | url |
Full URL string of this node (e.g. "dds://my/topic"). | |
| std::string | ser_type |
Serialisation type string (e.g. "demo.proto.PointCloud"). | |
| ImplType | impl_type {kUnknownImplType} |
| Role of this implementation node. | |
| SchemaType | schema_type {SchemaType::kUnknown} |
| Coarse schema family reported to discovery and bag/proxy paths. | |
| TransportType | transport_type {TransportType::kUnknown} |
| Transport backend of this implementation node. | |
| bool | is_cdr_type {false} |
true when using DDS native CDR serialisation. | |
| bool | is_security_type {false} |
true when security-authenticated transport is enabled. | |
| bool | is_discovery_enabled {true} |
| Whether this node is reported to the discovery layer. | |
| std::unique_ptr< class CpuProfiler > | profiler |
| Optional per-node CPU profiler (only when global profiling is on). | |
Transport-agnostic base for setter (field writer) node implementations.
Concrete backends override write() to push the serialised value onto the transport and sync() to provide a completion notification after the value has been accepted by the underlying transport.
|
override |
Destructor.
|
protected |
Protected constructor; initialises the setter with kSetter role.
|
pure virtual |
Waits for the most recently written value to be propagated, then fires the completion callback.
Must be implemented by each concrete transport backend. The exact semantics depend on the transport: some backends fire the callback immediately after the write is queued; others wait until the value has been acknowledged by all connected getters.
| callback | Callable invoked once the synchronisation is complete. |
|
pure virtual |
Writes a new field value to all connected getter nodes.
Must be implemented by each concrete transport backend. msg_data contains the fully serialised latest value produced by Serializer::serialize(). The write overwrites any previously stored value on the topic.
| msg_data | Serialised field value bytes to transmit. |