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

Convenience alias of Publisher with per-message security enabled. More...

#include <publisher.h>

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

Public Types

using UniquePtr = std::unique_ptr< SecurityPublisher< MsgT > >
 Owning unique-pointer alias. More...
 
using SharedPtr = std::shared_ptr< SecurityPublisher< 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>>>
 SecurityPublisher (const ConfT &conf, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
 Constructs a SecurityPublisher from a typed configuration object. More...
 
template<typename SecurityConfigT = Security::Config>
 SecurityPublisher (const std::string &url_str, SecurityConfigT &&sec_cfg={}, InitType type=InitType::kWithInit)
 Constructs a SecurityPublisher from a URL string. 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 SecurityPublisher 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 SecurityPublisher and wraps it in a std::shared_ptr. More...
 

Additional Inherited Members

Detailed Description

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

Convenience alias of Publisher with per-message security enabled.

Equivalent to Publisher<MsgT, SecurityType::kWithSecurity>. Every outgoing payload is encrypted with the configured Security::Config before transmission; an empty config falls back to the built-in default symmetric slot.

Note
Security is not supported on intra:// or on dds:// CDR payloads – using a SecurityPublisher in those configurations is a constructor-time fatal.
Template Parameters
MsgTC++ message type to publish.

Member Typedef Documentation

◆ SharedPtr

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

Owning shared-pointer alias.

◆ UniquePtr

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

Owning unique-pointer alias.

Constructor & Destructor Documentation

◆ SecurityPublisher() [1/2]

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

Constructs a SecurityPublisher from a typed configuration object.

Constructs the base Publisher in kWithoutInit mode, installs sec_cfg via enable_security(), then runs init() unless deferred. If enable_security() fails to populate a usable security object the subsequent init() will fail.

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.

◆ SecurityPublisher() [2/2]

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

Constructs a SecurityPublisher from a URL string.

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 >
SecurityPublisher< MsgT >::SharedPtr vlink::SecurityPublisher< MsgT >::create_shared ( const std::string &  url_str,
SecurityConfigT &&  sec_cfg = {},
InitType  type = InitType::kWithInit 
)
inlinestatic

Heap-allocates a SecurityPublisher 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 publisher.

◆ create_unique()

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

Heap-allocates a SecurityPublisher 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 publisher.

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