VLink  2.0.0
A high-performance communication middleware
vlink::AbstractNode Class Reference

Tiny mix-in that exposes the backend-native handle behind a node. More...

#include <node_impl.h>

Inheritance diagram for vlink::AbstractNode:
Collaboration diagram for vlink::AbstractNode:

Public Member Functions

virtual std::any get_native_handle () const
 Returns the backend-native handle wrapped in an std::any. More...
 

Protected Member Functions

 AbstractNode ()
 
virtual ~AbstractNode ()
 

Detailed Description

Tiny mix-in that exposes the backend-native handle behind a node.

Transport backends commonly inherit from both AbstractNode and the matching NodeImpl subclass. get_native_handle() returns an std::any wrapping the native object (for instance a DDS DataWriter pointer) so advanced users can interact with backend internals without leaking transport types through the rest of the VLink API.

Note
The base implementation returns an std::any holding nullptr; the caller must std::any_cast to the expected backend type.

Constructor & Destructor Documentation

◆ AbstractNode()

vlink::AbstractNode::AbstractNode ( )
protected

◆ ~AbstractNode()

virtual vlink::AbstractNode::~AbstractNode ( )
protectedvirtual

Member Function Documentation

◆ get_native_handle()

virtual std::any vlink::AbstractNode::get_native_handle ( ) const
virtual

Returns the backend-native handle wrapped in an std::any.

Backends override this method to expose, for example, a DDS DataWriter or DataReader pointer. Callers must std::any_cast the result.

Returns
Backend handle, or nullptr-bearing std::any in the base.

The documentation for this class was generated from the following file: