VLink  2.0.0
A high-performance communication middleware
vlink::SecuritySubscriber< MsgT > Class Template Reference

Convenience alias of Subscriber with per-message decryption enabled. More...

#include <subscriber.h>

Inheritance diagram for vlink::SecuritySubscriber< MsgT >:
Collaboration diagram for vlink::SecuritySubscriber< MsgT >:

Public Types

using UniquePtr = std::unique_ptr< SecuritySubscriber< MsgT > >
 Owning unique-pointer alias. More...
 
using SharedPtr = std::shared_ptr< SecuritySubscriber< MsgT > >
 Owning shared-pointer alias. More...
 

Public Member Functions

template<typename ConfT , typename SecurityConfigT = Security::Config, typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>>
 SecuritySubscriber (const ConfT &conf, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
 Constructs a SecuritySubscriber from a typed configuration object. More...
 
template<typename SecurityConfigT = Security::Config>
 SecuritySubscriber (const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
 Constructs a SecuritySubscriber from a URL string and installs the security configuration. More...
 

Static Public Member Functions

template<typename SecurityConfigT = Security::Config>
static UniquePtr create_unique (const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
 Heap-allocates a SecuritySubscriber and wraps it in a std::unique_ptr. More...
 
template<typename SecurityConfigT = Security::Config>
static SharedPtr create_shared (const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
 Heap-allocates a SecuritySubscriber and wraps it in a std::shared_ptr. More...
 

Additional Inherited Members

Detailed Description

template<typename MsgT>
class vlink::SecuritySubscriber< MsgT >

Convenience alias of Subscriber with per-message decryption enabled.

Equivalent to Subscriber<MsgT, SecurityType::kWithSecurity>. Every inbound payload is decrypted with the configured Security::Config before the codec dispatcher is invoked.

Note
Security is not supported on intra:// or on dds:// CDR payloads.
Template Parameters
MsgTC++ message type to subscribe.

Member Typedef Documentation

◆ SharedPtr

template<typename MsgT >
using vlink::SecuritySubscriber< MsgT >::SharedPtr = std::shared_ptr<SecuritySubscriber<MsgT> >

Owning shared-pointer alias.

◆ UniquePtr

template<typename MsgT >
using vlink::SecuritySubscriber< MsgT >::UniquePtr = std::unique_ptr<SecuritySubscriber<MsgT> >

Owning unique-pointer alias.

Constructor & Destructor Documentation

◆ SecuritySubscriber() [1/2]

template<typename MsgT >
template<typename ConfT , typename SecurityConfigT , typename >
vlink::SecuritySubscriber< MsgT >::SecuritySubscriber ( const ConfT &  conf,
SecurityConfigT &&  sec_cfg = {},
InitType  type = InitType::kWithInit 
)
inlineexplicit

Constructs a SecuritySubscriber from a typed configuration object.

Template Parameters
ConfTConfiguration type derived from Conf.
SecurityConfigTForwardable Security::Config compatible type.
Parameters
confPopulated configuration aggregate.
sec_cfgSecurity configuration; empty uses the default symmetric slot.
typeWhether to call init() inline; default is InitType::kWithInit.

◆ SecuritySubscriber() [2/2]

template<typename MsgT >
template<typename SecurityConfigT >
vlink::SecuritySubscriber< MsgT >::SecuritySubscriber ( const std::string &  url_str,
SecurityConfigT &&  sec_cfg = {},
InitType  type = InitType::kWithInit 
)
inlineexplicit

Constructs a SecuritySubscriber from a URL string and installs the security configuration.

Builds the base Subscriber in kWithoutInit mode, installs sec_cfg via enable_security(), then calls init() unless deferred. When enable_security() fails to produce a usable NodeImpl::security the subsequent init() will fail.

Template Parameters
SecurityConfigTForwardable Security::Config compatible type.
Parameters
url_strTopic URL string.
sec_cfgSecurity configuration; empty uses the default symmetric slot.
typeWhether to call init() inline; default is InitType::kWithInit.

Member Function Documentation

◆ create_shared()

template<typename MsgT >
template<typename SecurityConfigT >
SecuritySubscriber< MsgT >::SharedPtr vlink::SecuritySubscriber< MsgT >::create_shared ( const std::string &  url_str,
SecurityConfigT &&  sec_cfg = {},
InitType  type = InitType::kWithInit 
)
inlinestatic

Heap-allocates a SecuritySubscriber and wraps it in a std::shared_ptr.

Template Parameters
SecurityConfigTForwardable Security::Config compatible type.
Parameters
url_strTopic URL string.
sec_cfgSecurity configuration; empty uses the default symmetric slot.
typeWhether to call init() inline; default is InitType::kWithInit.
Returns
Owning SharedPtr to the new secure subscriber.

◆ create_unique()

template<typename MsgT >
template<typename SecurityConfigT >
SecuritySubscriber< MsgT >::UniquePtr vlink::SecuritySubscriber< MsgT >::create_unique ( const std::string &  url_str,
SecurityConfigT &&  sec_cfg = {},
InitType  type = InitType::kWithInit 
)
inlinestatic

Heap-allocates a SecuritySubscriber and wraps it in a std::unique_ptr.

Template Parameters
SecurityConfigTForwardable Security::Config compatible type.
Parameters
url_strTopic URL string.
sec_cfgSecurity configuration; empty uses the default symmetric slot.
typeWhether to call init() inline; default is InitType::kWithInit.
Returns
Owning UniquePtr to the new secure subscriber.

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