SNode.C
Loading...
Searching...
No Matches
web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT > Class Template Referenceabstract

#include <SocketContextUpgradeFactorySelector.h>

Collaboration diagram for web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >:

Classes

struct  SocketContextPlugin

Public Types

using SocketContextUpgradeFactory = SocketContextUpgradeFactoryT
using Request = typename SocketContextUpgradeFactory::Request
using Response = typename SocketContextUpgradeFactory::Response

Public Member Functions

virtual SocketContextUpgradeFactoryselect (Request &req, Response &res)=0
bool add (SocketContextUpgradeFactory *socketContextUpgradeFactory)
void link (const std::string &socketContextUpgradeName, SocketContextUpgradeFactory *(*linkedPlugin)())
void allowDlOpen ()
void unload (SocketContextUpgradeFactory *socketContextUpgradeFactory)

Protected Member Functions

 SocketContextUpgradeFactorySelector ()=default
virtual ~SocketContextUpgradeFactorySelector ()=default
SocketContextUpgradeFactoryselect (const std::string &socketContextUpgradeName)
virtual SocketContextUpgradeFactoryload (const std::string &socketContextUpgradeName)=0
SocketContextUpgradeFactoryload (const std::string &socketContextUpgradeName, const std::string &socketContextUpgradeFactoryLibraryFile, const std::string &socketContextUpgradeFactoryFunctionName)
bool add (SocketContextUpgradeFactory *socketContextUpgradeFactory, void *handler)

Private Attributes

std::map< std::string, SocketContextPluginsocketContextUpgradePlugins
std::map< std::string, SocketContextUpgradeFactory *(*)()> linkedSocketContextUpgradePlugins
bool onlyLinked = false

Detailed Description

template<typename SocketContextUpgradeFactoryT>
class web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >

Definition at line 57 of file SocketContextUpgradeFactorySelector.h.

Member Typedef Documentation

◆ Request

template<typename SocketContextUpgradeFactoryT>
using web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::Request = typename SocketContextUpgradeFactory::Request

Definition at line 60 of file SocketContextUpgradeFactorySelector.h.

◆ Response

template<typename SocketContextUpgradeFactoryT>
using web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::Response = typename SocketContextUpgradeFactory::Response

Definition at line 61 of file SocketContextUpgradeFactorySelector.h.

◆ SocketContextUpgradeFactory

template<typename SocketContextUpgradeFactoryT>
using web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::SocketContextUpgradeFactory = SocketContextUpgradeFactoryT

Definition at line 59 of file SocketContextUpgradeFactorySelector.h.

Constructor & Destructor Documentation

◆ SocketContextUpgradeFactorySelector()

template<typename SocketContextUpgradeFactoryT>
web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::SocketContextUpgradeFactorySelector ( )
protecteddefault

◆ ~SocketContextUpgradeFactorySelector()

template<typename SocketContextUpgradeFactoryT>
virtual web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::~SocketContextUpgradeFactorySelector ( )
protectedvirtualdefault

Member Function Documentation

◆ add() [1/2]

◆ add() [2/2]

◆ allowDlOpen()

◆ link()

template<typename SocketContextUpgradeFactory>
void web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactory >::link ( const std::string & socketContextUpgradeName,
SocketContextUpgradeFactory *(* linkedPlugin )() )

Definition at line 139 of file SocketContextUpgradeFactorySelector.hpp.

140 {
143 }
144
145 onlyLinked = true;
146 }
std::map< std::string, SocketContextUpgradeFactory *(*)()> linkedSocketContextUpgradePlugins

References linkedSocketContextUpgradePlugins, and onlyLinked.

Referenced by web::http::client::SocketContextUpgradeFactory::link(), and web::http::server::SocketContextUpgradeFactory::link().

Here is the caller graph for this function:

◆ load() [1/2]

template<typename SocketContextUpgradeFactoryT>
virtual SocketContextUpgradeFactory * web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::load ( const std::string & socketContextUpgradeName)
protectedpure virtual

◆ load() [2/2]

template<typename SocketContextUpgradeFactory>
SocketContextUpgradeFactory * web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactory >::load ( const std::string & socketContextUpgradeName,
const std::string & socketContextUpgradeFactoryLibraryFile,
const std::string & socketContextUpgradeFactoryFunctionName )
protected

Definition at line 84 of file SocketContextUpgradeFactorySelector.hpp.

86 {
88
90
91 if (handle != nullptr) {
92 SocketContextUpgradeFactory* (*getSocketContextUpgradeFactory)() = reinterpret_cast<SocketContextUpgradeFactory* (*) ()>(
94
95 if (getSocketContextUpgradeFactory != nullptr) {
97
98 if (socketContextUpgradeFactory != nullptr) {
100 LOG(TRACE) << "HTTP: SocketContextUpgradeFactory create success: " << socketContextUpgradeName;
101 } else {
102 LOG(TRACE) << "HTTP: SocketContextUpgradeFactory already existing: " << socketContextUpgradeName;
106 }
107 } else {
108 LOG(ERROR) << "HTTP: SocketContextUpgradeFactory create failed: " << socketContextUpgradeName;
110 }
111 } else {
112 LOG(ERROR) << "HTTP: Optaining function \"" << socketContextUpgradeFactoryFunctionName
113 << "\" in plugin failed: " << core::DynamicLoader::dlError();
115 }
116 }
117
119 }
static char * dlError()
static int dlClose(void *handle)

References core::DynamicLoader::dlClose(), core::DynamicLoader::dlError(), core::DynamicLoader::dlRegisterHandle(), and core::DynamicLoader::dlSym().

Here is the call graph for this function:

◆ select() [1/2]

template<typename SocketContextUpgradeFactory>
SocketContextUpgradeFactory * web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactory >::select ( const std::string & socketContextUpgradeName)
protected

◆ select() [2/2]

template<typename SocketContextUpgradeFactoryT>
virtual SocketContextUpgradeFactory * web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::select ( Request & req,
Response & res )
pure virtual

◆ unload()

Definition at line 150 of file SocketContextUpgradeFactorySelector.hpp.

References core::DynamicLoader::dlCloseDelayed(), and socketContextUpgradePlugins.

Referenced by web::http::client::SocketContextUpgradeFactory::checkRefCount(), and web::http::server::SocketContextUpgradeFactory::checkRefCount().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ linkedSocketContextUpgradePlugins

template<typename SocketContextUpgradeFactoryT>
std::map<std::string, SocketContextUpgradeFactory* (*) ()> web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::linkedSocketContextUpgradePlugins
private

Definition at line 97 of file SocketContextUpgradeFactorySelector.h.

Referenced by link(), and select().

◆ onlyLinked

template<typename SocketContextUpgradeFactoryT>
bool web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::onlyLinked = false
private

Definition at line 99 of file SocketContextUpgradeFactorySelector.h.

Referenced by allowDlOpen(), link(), and select().

◆ socketContextUpgradePlugins

template<typename SocketContextUpgradeFactoryT>
std::map<std::string, SocketContextPlugin> web::http::SocketContextUpgradeFactorySelector< SocketContextUpgradeFactoryT >::socketContextUpgradePlugins
private

Definition at line 96 of file SocketContextUpgradeFactorySelector.h.

Referenced by add(), select(), and unload().


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