VLink  2.0.0
A high-performance communication middleware
vlink::SecurityServer< ReqT, RespT > Class Template Reference

Convenience alias of Server with per-message encryption enabled. More...

#include <server.h>

Inheritance diagram for vlink::SecurityServer< ReqT, RespT >:
Collaboration diagram for vlink::SecurityServer< ReqT, RespT >:

Public Types

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

Additional Inherited Members

Detailed Description

template<typename ReqT, typename RespT = Traits::EmptyType>
class vlink::SecurityServer< ReqT, RespT >

Convenience alias of Server with per-message encryption enabled.

Equivalent to Server<ReqT, RespT, SecurityType::kWithSecurity>. Each incoming request is decrypted before dispatch to the handler, and each outgoing response is encrypted before transmission.

Template Parameters
ReqTRequest message type.
RespTResponse message type. Defaults to Traits::EmptyType.

Member Typedef Documentation

◆ SharedPtr

template<typename ReqT , typename RespT = Traits::EmptyType>
using vlink::SecurityServer< ReqT, RespT >::SharedPtr = std::shared_ptr<SecurityServer<ReqT, RespT> >

Owning shared-pointer alias.

◆ UniquePtr

template<typename ReqT , typename RespT = Traits::EmptyType>
using vlink::SecurityServer< ReqT, RespT >::UniquePtr = std::unique_ptr<SecurityServer<ReqT, RespT> >

Owning unique-pointer alias.

Constructor & Destructor Documentation

◆ SecurityServer() [1/2]

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

Constructs a SecurityServer 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.
Here is the call graph for this function:

◆ SecurityServer() [2/2]

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

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

Builds the base Server 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_strService URL string.
sec_cfgSecurity configuration; empty uses the default symmetric slot.
typeWhether to call init() inline; default is InitType::kWithInit.
Here is the call graph for this function:

Member Function Documentation

◆ create_shared()

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

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

Template Parameters
SecurityConfigTForwardable Security::Config compatible type.
Parameters
url_strService 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 server.

◆ create_unique()

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

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

Template Parameters
SecurityConfigTForwardable Security::Config compatible type.
Parameters
url_strService 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 server.

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