|
VLink 2.0.0
A high-performance communication middleware
|
Transport-agnostic base for getter (field reader) node implementations. More...
#include <getter_impl.h>
Public Member Functions | |
| ~GetterImpl () override | |
| Destructor. | |
| virtual bool | listen (MsgCallback &&callback)=0 |
| Registers the value-change callback for field updates. | |
| virtual void | set_latency_and_lost_enabled (bool enable) |
| Enables or disables per-update latency and sample-loss tracking. | |
| virtual bool | is_latency_and_lost_enabled () const |
| Returns whether latency and sample-loss tracking is currently enabled. | |
| virtual int64_t | get_latency () const |
| Returns the most recently measured end-to-end field update latency in microseconds. | |
| virtual SampleLostInfo | get_lost () const |
| Returns cumulative sample delivery statistics for field updates. | |
| 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. | |
Public Attributes | |
| bool | is_listened {false} |
true after listen() has been successfully called. | |
| 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). | |
Protected Member Functions | |
| GetterImpl () | |
Protected constructor; initialises the getter with kGetter 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. | |
Transport-agnostic base for getter (field reader) node implementations.
Provides default (no-op) implementations for the optional latency/loss tracking interface. Concrete transport backends override listen(MsgCallback&&) to register their value-change callback.
|
override |
Destructor.
|
protected |
Protected constructor; initialises the getter with kGetter role.
|
nodiscardvirtual |
Returns the most recently measured end-to-end field update latency in microseconds.
Only meaningful when is_latency_and_lost_enabled() returns true. The default implementation returns 0.
0 if tracking is disabled or unsupported.
|
nodiscardvirtual |
Returns cumulative sample delivery statistics for field updates.
Returns the total number of expected updates and the number that were lost. Only meaningful when is_latency_and_lost_enabled() returns true. The default implementation returns a zero-initialised SampleLostInfo.
SampleLostInfo containing total and lost counts.
|
nodiscardvirtual |
Returns whether latency and sample-loss tracking is currently enabled.
The default implementation always returns false. Transports that support tracking override this to reflect the current enabled state.
true if tracking is active; false otherwise.
|
pure virtual |
Registers the value-change callback for field updates.
Must be implemented by each concrete transport backend. The callback is invoked with a Bytes buffer containing the serialised latest value each time the corresponding Setter writes a new value. After registration is_listened is set to true by the Getter<T> layer.
| callback | Callable void(const Bytes&) invoked on each value update. |
true if registration succeeded; false on error.
|
virtual |
Enables or disables per-update latency and sample-loss tracking.
When enabled, the transport backend tracks value timestamps (for latency) and sequence numbers (for loss detection). The default implementation is a no-op; transports that support tracking override this method.
| enable | true to enable tracking; false to disable. |
| bool vlink::GetterImpl::is_listened {false} |
true after listen() has been successfully called.