VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
vlink::Conf Struct Reference

Abstract base class for VLink transport configuration objects. More...

#include <conf.h>

Inheritance diagram for vlink::Conf:
Collaboration diagram for vlink::Conf:

Public Types

using PropertiesMap = std::map<std::string, std::string>
 Key/value property map type.

Public Member Functions

virtual ~Conf ()
 Virtual destructor.
virtual bool parse (ImplType impl_type) const
 Validates the conf for the given node role and caches the type.
virtual bool is_valid () const
 Returns true when the configuration holds valid, usable data.
virtual ImplType get_impl_type () const
 Returns the most recently parsed ImplType.
virtual TransportType get_transport_type () const
 Returns the transport backend this configuration represents.

Public Attributes

uint32_t hash_code {0}
 Hash of the URL string; used for fast URL lookup in caches.

Protected Member Functions

 Conf ()
virtual bool parse_protocol (struct Protocol *protocol)
virtual std::unique_ptr< class ServerImplcreate_server () const
virtual std::unique_ptr< class ClientImplcreate_client () const
virtual std::unique_ptr< class PublisherImplcreate_publisher () const
virtual std::unique_ptr< class SubscriberImplcreate_subscriber () const
virtual std::unique_ptr< class SetterImplcreate_setter () const
virtual std::unique_ptr< class GetterImplcreate_getter () const

Friends

struct Url
template<typename, typename, SecurityType>
class Server
template<typename, typename, SecurityType>
class Client
template<typename, SecurityType>
class Publisher
template<typename, SecurityType>
class Subscriber
template<typename, SecurityType>
class Setter
template<typename, SecurityType>
class Getter

Detailed Description

Abstract base class for VLink transport configuration objects.

Each supported transport backend has a corresponding Conf subclass that implements the virtual factory methods (create_publisher, create_server, etc.) to produce transport-specific NodeImpl instances. The base class provides default implementations that return nullptr / false, so subclasses only need to override the methods they support.

Conf objects are held exclusively by Url and the six Node<> template classes; they are not intended for direct use by application code.

Note
The parse() method caches the ImplType so that subsequent factory calls know which node role is being requested.

Member Typedef Documentation

◆ PropertiesMap

using vlink::Conf::PropertiesMap = std::map<std::string, std::string>

Key/value property map type.

Used by transport conf subclasses and NodeImpl to store DDS QoS strings, IP addresses, buffer sizes, and other per-channel tuning parameters (e.g. "dds.ip" = "127.0.0.1").

Constructor & Destructor Documentation

◆ ~Conf()

virtual vlink::Conf::~Conf ( )
virtual

Virtual destructor.

◆ Conf()

vlink::Conf::Conf ( )
protected
Here is the caller graph for this function:

Member Function Documentation

◆ create_client()

virtual std::unique_ptr< class ClientImpl > vlink::Conf::create_client ( ) const
nodiscardprotectedvirtual

◆ create_getter()

virtual std::unique_ptr< class GetterImpl > vlink::Conf::create_getter ( ) const
nodiscardprotectedvirtual

◆ create_publisher()

virtual std::unique_ptr< class PublisherImpl > vlink::Conf::create_publisher ( ) const
nodiscardprotectedvirtual

◆ create_server()

virtual std::unique_ptr< class ServerImpl > vlink::Conf::create_server ( ) const
nodiscardprotectedvirtual

◆ create_setter()

virtual std::unique_ptr< class SetterImpl > vlink::Conf::create_setter ( ) const
nodiscardprotectedvirtual

◆ create_subscriber()

virtual std::unique_ptr< class SubscriberImpl > vlink::Conf::create_subscriber ( ) const
nodiscardprotectedvirtual

◆ get_impl_type()

virtual ImplType vlink::Conf::get_impl_type ( ) const
nodiscardvirtual

Returns the most recently parsed ImplType.

Returns
ImplType cached by the last call to parse(); kUnknownImplType before parse() is called.

Reimplemented in vlink::Url.

◆ get_transport_type()

virtual TransportType vlink::Conf::get_transport_type ( ) const
nodiscardvirtual

Returns the transport backend this configuration represents.

The base implementation returns TransportType::kUnknown. Each subclass overrides this to return its own TransportType value.

Returns
TransportType identifier for this conf.

Reimplemented in vlink::Url.

◆ is_valid()

virtual bool vlink::Conf::is_valid ( ) const
nodiscardvirtual

Returns true when the configuration holds valid, usable data.

The base implementation always returns false. Subclasses override this to perform transport-specific validation.

Returns
true if the configuration is ready to create NodeImpl objects.

Reimplemented in vlink::Url.

◆ parse()

virtual bool vlink::Conf::parse ( ImplType impl_type) const
nodiscardvirtual

Validates the conf for the given node role and caches the type.

Called by the Node<> template before invoking any create_*() factory. The base implementation logs a fatal message and returns false for kUnknownImplType; otherwise it caches impl_type and returns true. Concrete subclasses typically call this base and then validate their own fields.

Parameters
impl_typeThe role being requested (e.g. kPublisher).
Returns
true on success; false if the type is unknown.

Reimplemented in vlink::Url.

Here is the caller graph for this function:

◆ parse_protocol()

virtual bool vlink::Conf::parse_protocol ( struct Protocol * protocol)
nodiscardprotectedvirtual
Here is the caller graph for this function:

◆ Client

template<typename, typename, SecurityType>
friend class Client
friend

◆ Getter

template<typename, SecurityType>
friend class Getter
friend

◆ Publisher

template<typename, SecurityType>
friend class Publisher
friend

◆ Server

template<typename, typename, SecurityType>
friend class Server
friend

◆ Setter

template<typename, SecurityType>
friend class Setter
friend

◆ Subscriber

template<typename, SecurityType>
friend class Subscriber
friend

◆ Url

friend struct Url
friend

Member Data Documentation

◆ hash_code

uint32_t vlink::Conf::hash_code {0}

Hash of the URL string; used for fast URL lookup in caches.


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