VLink  2.0.0
A high-performance communication middleware
vlink::Conf Struct Reference

Abstract base for every transport-specific configuration aggregate. 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 shared between confs and node implementations. More...
 

Public Member Functions

virtual ~Conf ()
 Virtual destructor. More...
 
virtual bool parse (ImplType impl_type) const
 Validates the conf for impl_type and caches it for subsequent factories. More...
 
virtual bool is_valid () const
 Indicates whether the conf currently holds usable data. More...
 
virtual ImplType get_impl_type () const
 Returns the ImplType cached by the most recent parse() call. More...
 
virtual TransportType get_transport_type () const
 Returns the transport backend this conf wraps. More...
 

Public Attributes

uint32_t hash_code {0}
 Channel / topic hash assigned by concrete backends. More...
 

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 for every transport-specific configuration aggregate.

Holds the cached ImplType selected by parse() and declares the protected factory hooks that the public node templates use to instantiate NodeImpl peers. Default implementations of the factory hooks return nullptr so subclasses only need to override the roles they actually support; combine with VLINK_ALLOW_IMPL_TYPE to make the compile-time guard explicit.

Note
Instances are never owned by application code; they are produced by Url and live as long as the node that references them.

Member Typedef Documentation

◆ PropertiesMap

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

Key/value property map shared between confs and node implementations.

Stores transport tuning entries (e.g. "dds.ip" = "127.0.0.1") that are read by backends during init() and by helpers such as SslOptions.

Constructor & Destructor Documentation

◆ ~Conf()

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

Virtual destructor.

◆ Conf()

vlink::Conf::Conf ( )
protected

Member Function Documentation

◆ create_client()

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

◆ create_getter()

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

◆ create_publisher()

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

◆ create_server()

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

◆ create_setter()

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

◆ create_subscriber()

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

◆ get_impl_type()

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

Returns the ImplType cached by the most recent parse() call.

Returns
Cached ImplType, or kUnknownImplType before parse() runs.

Reimplemented in vlink::Url.

◆ get_transport_type()

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

Returns the transport backend this conf wraps.

Default implementation returns TransportType::kUnknown; concrete confs (and dynamic plugins) override it to advertise their backend.

Returns
Matching TransportType identifier.

Reimplemented in vlink::Url.

◆ is_valid()

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

Indicates whether the conf currently holds usable data.

The base implementation returns false; concrete confs override it to verify that mandatory fields have been populated.

Returns
true once the conf is ready to drive create_*() factories.

Reimplemented in vlink::Url.

◆ parse()

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

Validates the conf for impl_type and caches it for subsequent factories.

The base implementation rejects kUnknownImplType (the underlying logger call is configured to abort the process) and stores any other value into impl_type_ so that follow-up create_*() calls know the requested role. Subclasses typically chain Conf::parse() and then run their own checks.

Parameters
impl_typeRole the caller intends to instantiate.
Returns
true on success; the unknown-type fatal path never returns.

Reimplemented in vlink::Url.

Here is the caller graph for this function:

◆ parse_protocol()

virtual bool vlink::Conf::parse_protocol ( struct Protocol protocol)
protectedvirtual

Friends And Related Function Documentation

◆ 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}

Channel / topic hash assigned by concrete backends.


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