Public Member Functions | Static Public Attributes | Private Attributes | List of all members
cet::BasicPluginFactory Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/cetlib/v3_06_01/source/cetlib/BasicPluginFactory.h"

Inheritance diagram for cet::BasicPluginFactory:
cet::PluginFactory

Public Member Functions

 BasicPluginFactory (cet::search_path const &search_path, std::string const &suffix="plugin", std::string const &makerName="makePlugin", std::string const &pluginTypeFuncName="pluginType")
 
 BasicPluginFactory (std::string const &suffix="plugin", std::string const &makerName="makePlugin", std::string const &pluginTypeFuncName="pluginType")
 
template<typename RESULT_TYPE , typename... ARGS>
std::enable_if_t<!std::is_function< RESULT_TYPE >::value, RESULT_TYPE > makePlugin (std::string const &libspec, ARGS &&...args)
 
template<typename FUNCTION_TYPE >
std::enable_if_t< std::is_function< FUNCTION_TYPE >::value, std::function< FUNCTION_TYPE > > makePlugin (std::string const &libspec)
 
std::string pluginType (std::string const &libspec)
 
void setDiagReleaseVersion (std::string const &rv)
 
void setDiagReleaseVersion (std::function< std::string()> rvf)
 
template<typename RESULT_TYPE , typename... ARGS>
RESULT_TYPE call (std::string const &libspec, std::string const &funcname, ARGS &&...args) const
 
template<typename RESULT_TYPE , typename... ARGS>
auto find (std::string const &funcname, std::string const &libspec) const -> RESULT_TYPE(*)(ARGS...)
 
template<typename RESULT_TYPE , typename... ARGS>
auto find (std::string const &funcname, std::string const &libspec, LibraryManager::nothrow_t) const -> RESULT_TYPE(*)(ARGS...)
 
template<typename FUNCTION_TYPE >
std::enable_if_t< std::is_function< FUNCTION_TYPE >::value, FUNCTION_TYPE * > find (std::string const &funcname, std::string const &libspec) const
 

Static Public Attributes

static LibraryManager::nothrow_t nothrow
 

Private Attributes

std::string const makerName_
 
std::string const pluginTypeFuncName_
 

Detailed Description

Definition at line 26 of file BasicPluginFactory.h.

Constructor & Destructor Documentation

cet::BasicPluginFactory::BasicPluginFactory ( cet::search_path const &  search_path,
std::string const &  suffix = "plugin",
std::string const &  makerName = "makePlugin",
std::string const &  pluginTypeFuncName = "pluginType" 
)
explicit
cet::BasicPluginFactory::BasicPluginFactory ( std::string const &  suffix = "plugin",
std::string const &  makerName = "makePlugin",
std::string const &  pluginTypeFuncName = "pluginType" 
)
explicit

Member Function Documentation

template<typename RESULT_TYPE , typename... ARGS>
RESULT_TYPE cet::PluginFactory::call ( std::string const &  libspec,
std::string const &  funcname,
ARGS &&...  args 
) const
inlineinherited

Definition at line 106 of file PluginFactory.h.

References make_syst_table_plots::args.

109 {
110  return (*find<RESULT_TYPE, ARGS...>(libspec, funcname))(
111  std::forward<ARGS>(args)...);
112 }
template<typename RESULT_TYPE , typename... ARGS>
auto cet::PluginFactory::find ( std::string const &  funcname,
std::string const &  libspec 
) const -> RESULT_TYPE (*)(ARGS...)
inlineinherited

Definition at line 126 of file PluginFactory.h.

References cet::PluginFactory::resolveSymbolOrThrow_().

129 {
130  RESULT_TYPE (*symbol)(ARGS...) = nullptr;
131  resolveSymbolOrThrow_(libspec, funcname, symbol);
132  return symbol;
133 }
void resolveSymbolOrThrow_(std::string const &libspec, std::string const &funcname, T &symbol) const
template<typename RESULT_TYPE , typename... ARGS>
auto cet::PluginFactory::find ( std::string const &  funcname,
std::string const &  libspec,
LibraryManager::nothrow_t  nothrow 
) const -> RESULT_TYPE (*)(ARGS...)
inlineinherited

Definition at line 137 of file PluginFactory.h.

References cet::LibraryManager::getSymbolByLibspec(), cet::PluginFactory::lm_, and cet::PluginFactory::nothrow.

141 {
142  return lm_.getSymbolByLibspec<RESULT_TYPE (*)(ARGS...)>(
143  libspec, funcname, nothrow);
144 }
static LibraryManager::nothrow_t nothrow
Definition: PluginFactory.h:53
LibraryManager lm_
Definition: PluginFactory.h:87
T getSymbolByLibspec(std::string const &libspec, std::string const &sym_name) const
template<typename FUNCTION_TYPE >
std::enable_if_t< std::is_function< FUNCTION_TYPE >::value, FUNCTION_TYPE * > cet::PluginFactory::find ( std::string const &  funcname,
std::string const &  libspec 
) const
inlineinherited

Definition at line 116 of file PluginFactory.h.

References cet::PluginFactory::resolveSymbolOrThrow_().

118 {
119  FUNCTION_TYPE** symbol{nullptr};
120  resolveSymbolOrThrow_(libspec, funcname, symbol);
121  return *symbol;
122 }
void resolveSymbolOrThrow_(std::string const &libspec, std::string const &funcname, T &symbol) const
template<typename RESULT_TYPE , typename... ARGS>
std::enable_if_t<!std::is_function< RESULT_TYPE >::value, RESULT_TYPE > cet::BasicPluginFactory::makePlugin ( std::string const &  libspec,
ARGS &&...  args 
)
inline
template<typename FUNCTION_TYPE >
std::enable_if_t< std::is_function< FUNCTION_TYPE >::value, std::function< FUNCTION_TYPE > > cet::BasicPluginFactory::makePlugin ( std::string const &  libspec)
inline

Definition at line 73 of file BasicPluginFactory.h.

References makerName_.

74 {
75  return find<FUNCTION_TYPE>(libspec, makerName_);
76 }
std::string const makerName_
std::string cet::BasicPluginFactory::pluginType ( std::string const &  libspec)
inline

Definition at line 58 of file BasicPluginFactory.h.

References pluginTypeFuncName_.

Referenced by art::detail::tool_type< T, std::enable_if_t< std::is_function< T >::value > >::make_plugin(), and art::EmptyEvent::makePlugin_().

59 {
60  return call<std::string>(libspec, pluginTypeFuncName_);
61 }
std::string const pluginTypeFuncName_
void cet::PluginFactory::setDiagReleaseVersion ( std::string const &  rv)
inlineinherited

Definition at line 99 of file PluginFactory.h.

References cet::PluginFactory::releaseVersionString_.

100 {
102 }
std::string releaseVersionString_
Definition: PluginFactory.h:88
void cet::PluginFactory::setDiagReleaseVersion ( std::function< std::string()>  rvf)
inlineinherited

Definition at line 93 of file PluginFactory.h.

References cet::PluginFactory::releaseVersionFunc_.

94 {
95  releaseVersionFunc_ = rvf;
96 }
std::function< std::string()> releaseVersionFunc_
Definition: PluginFactory.h:89

Member Data Documentation

std::string const cet::BasicPluginFactory::makerName_
private

Definition at line 53 of file BasicPluginFactory.h.

Referenced by makePlugin().

LibraryManager::nothrow_t cet::PluginFactory::nothrow
staticinherited

Definition at line 53 of file PluginFactory.h.

Referenced by cet::PluginFactory::find().

std::string const cet::BasicPluginFactory::pluginTypeFuncName_
private

Definition at line 54 of file BasicPluginFactory.h.

Referenced by pluginType().


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