NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Enumerator | Functions | Variables
Plugin Creation and Usage Framework
+ Collaboration diagram for Plugin Creation and Usage Framework:

Classes

class  CPluginManagerException
 CPluginManagerException –. More...
 
class  CInterfaceVersion< TClass >
 CInterfaceVersion<> –. More...
 
class  CDefaultDriverVersion< TInterface >
 
struct  SDriverInfo
 
class  IClassFactory< TClass >
 IClassFactory<> –. More...
 
struct  CPluginManagerBase
 
class  CDllResolver_Getter< TClass >
 Template function to create dll resolver for interface. More...
 
class  CPluginManager< TClass >
 CPluginManager<> –. More...
 
struct  CPluginManager< TClass >::SDriverInfo
 Information about a driver, with maybe a pointer to an instantiated class factory that contains the driver. More...
 
class  CPluginManager_DllResolver
 Service class for DLLs resolution. More...
 
class  CInvalidDrvVer< TClass >
 
class  CSimpleClassFactoryImpl< IFace, TDriver >
 Template class helps to implement one driver class factory. More...
 
struct  CHostEntryPointImpl< TClassFactory >
 Template implements entry point. More...
 

Macros

#define NCBI_DECLARE_INTERFACE_VERSION(iface, iface_name, major, minor, patch_level)
 Macro to auto-setup the current interface name and version. More...
 
#define NCBI_INTERFACE_VERSION(iface)
 Macro to construct CVersionInfo class using interface name (relies on CInterfaceVersion class) More...
 

Typedefs

typedef CConfig::TParamTree TPluginManagerParamTree
 
typedef list< SDriverInfoTDriverList
 
typedef TClass IClassFactory< TClass >::TInterface
 
typedef ncbi::SDriverInfo IClassFactory< TClass >::SDriverInfo
 
typedef ncbi::TDriverList IClassFactory< TClass >::TDriverList
 
typedef CDefaultDriverVersion< TClass > IClassFactory< TClass >::TDefaultDriverVersion
 
typedef IClassFactory< TClass > CPluginManager< TClass >::TClassFactory
 
typedef CDefaultDriverVersion< TClass > CPluginManager< TClass >::TDefaultDriverVersion
 
typedef vector< stringCPluginManager< TClass >::TSearchPaths
 Container for the DLL search paths. More...
 
typedef list< SDriverInfoCPluginManager< TClass >::TDriverInfoList
 List of driver information. More...
 
typedef void(* CPluginManager< TClass >::FNCBI_EntryPoint) (TDriverInfoList &info_list, EEntryPointRequest method)
 Entry point to get drivers' info, and (if requested) their class factories. More...
 
typedef set< FNCBI_EntryPointCPluginManager< TClass >::TEntryPoints
 
typedef set< TClassFactory * > CPluginManager< TClass >::TFactories
 
typedef vector< CDllResolver::SResolvedEntryCPluginManager< TClass >::TResolvedEntries
 
typedef vector< CPluginManager_DllResolver * > CPluginManager< TClass >::TDllResolvers
 
typedef set< stringCPluginManager< TClass >::TStringSet
 
typedef map< string, stringCPluginManager< TClass >::TSubstituteMap
 
typedef vector< stringCPluginManager_DllResolver::TSearchPaths
 Container for the DLL search paths. More...
 
typedef CPluginManager< TClass >::SDriverInfo CInvalidDrvVer< TClass >::TValue
 
typedef TDriver CSimpleClassFactoryImpl< IFace, TDriver >::TImplementation
 
typedef IFace CSimpleClassFactoryImpl< IFace, TDriver >::TInterface
 
typedef IClassFactory< IFace > CSimpleClassFactoryImpl< IFace, TDriver >::TParent
 
typedef TParent::SDriverInfo CSimpleClassFactoryImpl< IFace, TDriver >::TDriverInfo
 
typedef TParent::TDriverList CSimpleClassFactoryImpl< IFace, TDriver >::TDriverList
 
typedef TClassFactory::TInterface CHostEntryPointImpl< TClassFactory >::TInterface
 
typedef CPluginManager< TInterfaceCHostEntryPointImpl< TClassFactory >::TPluginManager
 
typedef CPluginManager< TInterface >::SDriverInfo CHostEntryPointImpl< TClassFactory >::TDriverInfo
 
typedef CPluginManager< TInterface >::TDriverInfoList CHostEntryPointImpl< TClassFactory >::TDriverInfoList
 
typedef CPluginManager< TInterface >::EEntryPointRequest CHostEntryPointImpl< TClassFactory >::EEntryPointRequest
 
typedef TClassFactory::SDriverInfo CHostEntryPointImpl< TClassFactory >::TCFDriverInfo
 

Enumerations

enum  CPluginManagerException::EErrCode { CPluginManagerException::eResolveFailure , CPluginManagerException::eParameterMissing , CPluginManagerException::eNullInstance }
 
enum  { CDefaultDriverVersion< TInterface >::eMajor = ncbi::CInterfaceVersion<TInterface>::eMajor , CDefaultDriverVersion< TInterface >::eMinor = ncbi::CInterfaceVersion<TInterface>::eMinor , CDefaultDriverVersion< TInterface >::ePatchLevel = ncbi::CInterfaceVersion<TInterface>::ePatchLevel }
 
enum  CPluginManager< TClass >::EEntryPointRequest { CPluginManager< TClass >::eGetFactoryInfo , CPluginManager< TClass >::eInstantiateFactory }
 Actions performed by the entry point. More...
 
enum  CPluginManager_DllResolver::EVersionLocation { CPluginManager_DllResolver::eBeforeSuffix , CPluginManager_DllResolver::eAfterSuffix }
 

Functions

virtual const char * CPluginManagerException::GetErrCodeString (void) const override
 Translate from the error code value to its string representation. More...
 
 CPluginManagerException::NCBI_EXCEPTION_DEFAULT (CPluginManagerException, CCoreException)
 
 SDriverInfo::SDriverInfo (const string &driver_name, const CVersionInfo &driver_version)
 
static const CVersionInfoIClassFactory< TClass >::GetDefaultDrvVers (void)
 
virtual TClass * IClassFactory< TClass >::CreateInstance (const string &driver=kEmptyStr, CVersionInfo version=GetDefaultDrvVers(), const TPluginManagerParamTree *params=0) const =0
 Create driver's instance. More...
 
virtual void IClassFactory< TClass >::GetDriverVersions (TDriverList &driver_list) const =0
 Versions of the interface exported by the factory. More...
 
virtual IClassFactory< TClass >::~IClassFactory (void)
 
string IClassFactory< TClass >::GetParam (const string &driver_name, const TPluginManagerParamTree *params, const string &param_name, bool mandatory, const string &default_value) const
 Utility function to get an element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value) More...
 
const stringIClassFactory< TClass >::GetParam (const string &driver_name, const TPluginManagerParamTree *params, const string &param_name, bool mandatory) const
 This version always defaults to the empty string so that it can safely return a reference. More...
 
CPluginManager_DllResolverCDllResolver_Getter< TClass >::operator() (void)
 
static const CVersionInfoCPluginManager< TClass >::GetDefaultDrvVers (void)
 
TClass * CPluginManager< TClass >::CreateInstance (const string &driver=kEmptyStr, const CVersionInfo &version=GetDefaultDrvVers(), const TPluginManagerParamTree *params=0)
 Create class instance. More...
 
TClass * CPluginManager< TClass >::CreateInstanceFromList (const TPluginManagerParamTree *params, const string &driver_list, const CVersionInfo &version=GetDefaultDrvVers())
 Create first available driver from the list of drivers. More...
 
TClass * CPluginManager< TClass >::CreateInstanceFromKey (const TPluginManagerParamTree *params, const string &driver_key, const CVersionInfo &version=GetDefaultDrvVers())
 Detect driver from the parameters using the key to get list of drivers. More...
 
TClassFactoryCPluginManager< TClass >::GetFactory (const string &driver=kEmptyStr, const CVersionInfo &version=GetDefaultDrvVers())
 Get class factory. More...
 
 CPluginManager< TClass >::SDriverInfo::SDriverInfo (const string &driver_name, const CVersionInfo &driver_version)
 
bool CPluginManager< TClass >::RegisterFactory (TClassFactory &factory)
 Try to register factory in the manager. More...
 
bool CPluginManager< TClass >::WillExtendCapabilities (TClassFactory &factory) const
 Check if a given factory will extend capabilities of the Plugin Manager (add either new drivers or new driver versions to already available). More...
 
bool CPluginManager< TClass >::UnregisterFactory (TClassFactory &factory)
 Unregister and release (un-own) More...
 
template<typename TEntryPoint >
bool CPluginManager< TClass >::RegisterWithEntryPoint (TEntryPoint plugin_entry_point)
 Register all factories exported by the plugin entry point. More...
 
template<typename TEntryPoint >
bool CPluginManager< TClass >::RegisterWithEntryPoint (TEntryPoint plugin_entry_point, const string &driver_name, const CVersionInfo &driver_version=CVersionInfo::kLatest)
 Register all compatible factories for the driver with the particular version exported by the plugin entry point. More...
 
void CPluginManager< TClass >::AddResolver (CPluginManager_DllResolver *resolver)
 Attach DLL resolver to plugin manager. More...
 
CPluginManager_DllResolverCPluginManager< TClass >::DetachResolver (CPluginManager_DllResolver *resolver)
 Remove resolver from the list of active resolvers. More...
 
void CPluginManager< TClass >::AddDllSearchPath (const string &path)
 Add path for the DLL lookup (for all resolvers) More...
 
void CPluginManager< TClass >::ResetDllSearchPath (TSearchPaths *previous_paths=NULL)
 Delete all user-installed paths for the DLL lookup (for all resolvers) More...
 
CDllResolver::TExtraDllPath CPluginManager< TClass >::SetDllStdSearchPath (CDllResolver::TExtraDllPath standard_paths)
 Specify which standard locations should be used for the DLL lookup (for all resolvers). More...
 
CDllResolver::TExtraDllPath CPluginManager< TClass >::GetDllStdSearchPath (void) const
 Get standard locations which should be used for the DLL lookup. More...
 
void CPluginManager< TClass >::ResolveFile (const string &driver=kEmptyStr, const CVersionInfo &version=GetDefaultDrvVers())
 Scan DLLs for specified driver using attached resolvers. More...
 
void CPluginManager< TClass >::FreezeResolution (bool value=true)
 Disable/enable DLL resolution (search for class factories in DLLs) More...
 
void CPluginManager< TClass >::FreezeResolution (const string &driver, bool value=true)
 Disable/enable DLL resolution (search for class factories in DLLs) for the specified driver. More...
 
 CPluginManager< TClass >::CPluginManager (void)
 
virtual CPluginManager< TClass >::~CPluginManager (void)
 
TClassFactoryCPluginManager< TClass >::FindClassFactory (const string &driver, const CVersionInfo &version) const
 
 CPluginManager_DllResolver::CPluginManager_DllResolver (void)
 
 CPluginManager_DllResolver::CPluginManager_DllResolver (const string &interface_name, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny, CDll::EAutoUnload unload_dll=CDll::eNoAutoUnload)
 Construction. More...
 
virtual CPluginManager_DllResolver::~CPluginManager_DllResolver (void)
 
CDllResolverCPluginManager_DllResolver::ResolveFile (const TSearchPaths &paths, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny, CDllResolver::TExtraDllPath std_path=CDllResolver::fDefaultDllPath)
 Search for plugin DLLs, resolve entry points. More...
 
CDllResolverCPluginManager_DllResolver::Resolve (const string &path)
 Search for plugin DLLs, resolve entry points. More...
 
virtual string CPluginManager_DllResolver::GetDllName (const string &interface_name, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny) const
 Return dll file name. More...
 
virtual string CPluginManager_DllResolver::GetDllNameMask (const string &interface_name, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny, EVersionLocation ver_lct=eBeforeSuffix) const
 Return DLL name mask. More...
 
virtual string CPluginManager_DllResolver::GetEntryPointName (const string &interface_name=kEmptyStr, const string &driver_name=kEmptyStr) const
 Return DLL entry point name: More...
 
virtual string CPluginManager_DllResolver::GetEntryPointPrefix () const
 Return DLL entry point prefix ("NCBI_EntryPoint") More...
 
virtual string CPluginManager_DllResolver::GetDllNamePrefix () const
 Return DLL file name prefix ("ncbi_plugin") More...
 
virtual void CPluginManager_DllResolver::SetDllNamePrefix (const string &prefix)
 Set DLL file name prefix. More...
 
const stringCPluginManager_DllResolver::GetDriverName () const
 Return name of the driver. More...
 
static bool CPluginManager_DllResolver::IsEnabledGlobally ()
 Return whether to allow loading plugins from DLLs in general. More...
 
static bool CPluginManager_DllResolver::IsEnabledGloballyByDefault ()
 Return whether to allow loading plugins from DLLs in general by default. More...
 
static void CPluginManager_DllResolver::EnableGlobally (bool enable=true)
 Enable (or disable, if called with enable = false) loading plugins from DLLs in general. More...
 
static void CPluginManager_DllResolver::DisableGlobally ()
 Disable loading plugins from DLLs in general. More...
 
CDllResolverCPluginManager_DllResolver::GetCreateDllResolver ()
 
CDllResolverCPluginManager_DllResolver::CreateDllResolver () const
 
bool operator== (const SDriverInfo &i1, const SDriverInfo &i2)
 
bool operator< (const SDriverInfo &i1, const SDriverInfo &i2)
 
 CInvalidDrvVer< TClass >::CInvalidDrvVer (const string &driver_name, const CVersionInfo &vi)
 
bool CInvalidDrvVer< TClass >::operator() (const TValue &val)
 
 CSimpleClassFactoryImpl< IFace, TDriver >::CSimpleClassFactoryImpl (const string &driver_name, int patch_level=-1)
 Construction. More...
 
virtual TInterfaceCSimpleClassFactoryImpl< IFace, TDriver >::CreateInstance (const string &driver=kEmptyStr, CVersionInfo version=TParent::GetDefaultDrvVers(), const TPluginManagerParamTree *=0) const
 Create instance of TDriver. More...
 
void CSimpleClassFactoryImpl< IFace, TDriver >::GetDriverVersions (TDriverList &info_list) const
 Versions of the interface exported by the factory. More...
 
string CSimpleClassFactoryImpl< IFace, TDriver >::GetParam (const TPluginManagerParamTree *params, const string &param_name, bool mandatory, const string &default_value) const
 Utility function to get an element of parameter tree Throws an exception when mandatory parameter is missing (or returns the deafult value) More...
 
const stringCSimpleClassFactoryImpl< IFace, TDriver >::GetParam (const TPluginManagerParamTree *params, const string &param_name, bool mandatory) const
 This version always defaults to the empty string so that it can safely return a reference. More...
 
int CSimpleClassFactoryImpl< IFace, TDriver >::GetParamInt (const TPluginManagerParamTree *params, const string &param_name, bool, int default_value) const
 Utility function to get an integer of parameter tree Throws an exception when mandatory parameter is missing (or returns the deafult value) More...
 
Uint8 CSimpleClassFactoryImpl< IFace, TDriver >::GetParamDataSize (const TPluginManagerParamTree *params, const string &param_name, bool, unsigned int default_value) const
 Utility function to get an integer of parameter tree Throws an exception when mandatory parameter is missing (or returns the deafult value) More...
 
bool CSimpleClassFactoryImpl< IFace, TDriver >::GetParamBool (const TPluginManagerParamTree *params, const string &param_name, bool, bool default_value) const
 Utility function to get an bool of parameter tree Throws an exception when mandatory parameter is missing (or returns the deafult value) More...
 
double CSimpleClassFactoryImpl< IFace, TDriver >::GetParamDouble (const TPluginManagerParamTree *params, const string &param_name, bool, double default_value) const
 Utility function to get a double of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value) More...
 
static void CHostEntryPointImpl< TClassFactory >::NCBI_EntryPointImpl (TDriverInfoList &info_list, EEntryPointRequest method)
 Entry point implementation. More...
 

Variables

string SDriverInfo::name
 Driver name. More...
 
CVersionInfo SDriverInfo::version
 Driver version. More...
 
TClassFactoryCPluginManager< TClass >::SDriverInfo::factory
 Class factory (can be NULL) More...
 
CMutex CPluginManager< TClass >::m_Mutex
 Protective mutex to synchronize the access to the plugin manager from different threads. More...
 
TFactories CPluginManager< TClass >::m_Factories
 List of factories presently registered with (and owned by) the plugin manager. More...
 
TEntryPoints CPluginManager< TClass >::m_EntryPoints
 List of entry points registered in this plugin manager. More...
 
TDllResolvers CPluginManager< TClass >::m_Resolvers
 DLL resolvers. More...
 
TSearchPaths CPluginManager< TClass >::m_DllSearchPaths
 Paths used for DLL search. More...
 
TResolvedEntries CPluginManager< TClass >::m_RegisteredEntries
 DLL entries resolved and registered with dll resolver(s) More...
 
bool CPluginManager< TClass >::m_BlockResolution
 Flag, prohibits DLL resolution. More...
 
TStringSet CPluginManager< TClass >::m_FreezeResolutionDrivers
 Set of drivers prohibited from DLL resolution. More...
 
CDllResolver::TExtraDllPath CPluginManager< TClass >::m_StdDllPath
 Standard locations that should be used for the DLL lookup. More...
 
TSubstituteMap CPluginManager< TClass >::m_SubstituteMap
 Driver name substitution map. More...
 
string CPluginManager_DllResolver::m_DllNamePrefix
 
string CPluginManager_DllResolver::m_EntryPointPrefix
 
string CPluginManager_DllResolver::m_InterfaceName
 
string CPluginManager_DllResolver::m_DriverName
 
CVersionInfo CPluginManager_DllResolver::m_Version
 
CDllResolverCPluginManager_DllResolver::m_DllResolver
 
CDll::EAutoUnload CPluginManager_DllResolver::m_AutoUnloadDll
 
const string CInvalidDrvVer< TClass >::m_DriverName
 
const CVersionInfo CInvalidDrvVer< TClass >::m_VersionInfo
 
CVersionInfo CSimpleClassFactoryImpl< IFace, TDriver >::m_DriverVersionInfo
 
string CSimpleClassFactoryImpl< IFace, TDriver >::m_DriverName
 

Detailed Description

Macro Definition Documentation

◆ NCBI_DECLARE_INTERFACE_VERSION

#define NCBI_DECLARE_INTERFACE_VERSION (   iface,
  iface_name,
  major,
  minor,
  patch_level 
)
Value:
template<> \
{ \
public: \
enum { \
eMajor = major, \
eMinor = minor, \
ePatchLevel = patch_level \
}; \
static const char* GetName() { return iface_name; } \
}
CInterfaceVersion<> –.

Macro to auto-setup the current interface name and version.

This macro must be "called" once per interface, usually in the very header that describes that interface.

Example: NCBI_INTERFACE_VERSION(IFooBar, "IFooBar", 1, 3, 8);

See also
CInterfaceVersion

Definition at line 134 of file plugin_manager.hpp.

◆ NCBI_INTERFACE_VERSION

#define NCBI_INTERFACE_VERSION (   iface)
Value:
CVersionInfo(ncbi::CInterfaceVersion<iface>::eMajor, \
ncbi::CInterfaceVersion<iface>::eMinor, \
ncbi::CInterfaceVersion<iface>::ePatchLevel)
CVersionInfo –.

Macro to construct CVersionInfo class using interface name (relies on CInterfaceVersion class)

See also
CVersionInfo

Definition at line 150 of file plugin_manager.hpp.

Typedef Documentation

◆ EEntryPointRequest

template<class TClassFactory >
typedef CPluginManager<TInterface>::EEntryPointRequest CHostEntryPointImpl< TClassFactory >::EEntryPointRequest

Definition at line 222 of file plugin_manager_impl.hpp.

◆ FNCBI_EntryPoint

template<class TClass >
typedef void(* CPluginManager< TClass >::FNCBI_EntryPoint) (TDriverInfoList &info_list, EEntryPointRequest method)

Entry point to get drivers' info, and (if requested) their class factories.

This function is usually (but not necessarily) called by RegisterWithEntryPoint().

Usually, it's called twice – the first time to get the info about the drivers exported by the entry point, and then to instantiate selected factories.

Caller is responsible for the proper destruction (deallocation) of the instantiated factories.

Definition at line 437 of file plugin_manager.hpp.

◆ SDriverInfo

template<class TClass >
typedef ncbi::SDriverInfo IClassFactory< TClass >::SDriverInfo

Definition at line 196 of file plugin_manager.hpp.

◆ TCFDriverInfo

template<class TClassFactory >
typedef TClassFactory::SDriverInfo CHostEntryPointImpl< TClassFactory >::TCFDriverInfo

Definition at line 223 of file plugin_manager_impl.hpp.

◆ TClassFactory

template<class TClass >
typedef IClassFactory<TClass> CPluginManager< TClass >::TClassFactory

Definition at line 295 of file plugin_manager.hpp.

◆ TDefaultDriverVersion [1/2]

template<class TClass >
typedef CDefaultDriverVersion<TClass> IClassFactory< TClass >::TDefaultDriverVersion

Definition at line 198 of file plugin_manager.hpp.

◆ TDefaultDriverVersion [2/2]

template<class TClass >
typedef CDefaultDriverVersion<TClass> CPluginManager< TClass >::TDefaultDriverVersion

Definition at line 296 of file plugin_manager.hpp.

◆ TDllResolvers

template<class TClass >
typedef vector<CPluginManager_DllResolver*> CPluginManager< TClass >::TDllResolvers
protected

Definition at line 533 of file plugin_manager.hpp.

◆ TDriverInfo [1/2]

template<class IFace , class TDriver >
typedef TParent::SDriverInfo CSimpleClassFactoryImpl< IFace, TDriver >::TDriverInfo

Definition at line 67 of file plugin_manager_impl.hpp.

◆ TDriverInfo [2/2]

template<class TClassFactory >
typedef CPluginManager<TInterface>::SDriverInfo CHostEntryPointImpl< TClassFactory >::TDriverInfo

Definition at line 217 of file plugin_manager_impl.hpp.

◆ TDriverInfoList [1/2]

template<class TClass >
typedef list<SDriverInfo> CPluginManager< TClass >::TDriverInfoList

List of driver information.

It is used to communicate using the entry points mechanism.

See also
FNCBI_EntryPoint

Definition at line 386 of file plugin_manager.hpp.

◆ TDriverInfoList [2/2]

template<class TClassFactory >
typedef CPluginManager<TInterface>::TDriverInfoList CHostEntryPointImpl< TClassFactory >::TDriverInfoList

Definition at line 220 of file plugin_manager_impl.hpp.

◆ TDriverList [1/3]

typedef list<SDriverInfo> TDriverList

Definition at line 182 of file plugin_manager.hpp.

◆ TDriverList [2/3]

template<class TClass >
typedef ncbi::TDriverList IClassFactory< TClass >::TDriverList

Definition at line 197 of file plugin_manager.hpp.

◆ TDriverList [3/3]

template<class IFace , class TDriver >
typedef TParent::TDriverList CSimpleClassFactoryImpl< IFace, TDriver >::TDriverList

Definition at line 68 of file plugin_manager_impl.hpp.

◆ TEntryPoints

template<class TClass >
typedef set<FNCBI_EntryPoint> CPluginManager< TClass >::TEntryPoints
protected

Definition at line 530 of file plugin_manager.hpp.

◆ TFactories

template<class TClass >
typedef set<TClassFactory*> CPluginManager< TClass >::TFactories
protected

Definition at line 531 of file plugin_manager.hpp.

◆ TImplementation

template<class IFace , class TDriver >
typedef TDriver CSimpleClassFactoryImpl< IFace, TDriver >::TImplementation

Definition at line 64 of file plugin_manager_impl.hpp.

◆ TInterface [1/3]

template<class TClass >
typedef TClass IClassFactory< TClass >::TInterface

Definition at line 195 of file plugin_manager.hpp.

◆ TInterface [2/3]

template<class IFace , class TDriver >
typedef IFace CSimpleClassFactoryImpl< IFace, TDriver >::TInterface

Definition at line 65 of file plugin_manager_impl.hpp.

◆ TInterface [3/3]

template<class TClassFactory >
typedef TClassFactory::TInterface CHostEntryPointImpl< TClassFactory >::TInterface

Definition at line 215 of file plugin_manager_impl.hpp.

◆ TParent

template<class IFace , class TDriver >
typedef IClassFactory<IFace> CSimpleClassFactoryImpl< IFace, TDriver >::TParent

Definition at line 66 of file plugin_manager_impl.hpp.

◆ TPluginManager

template<class TClassFactory >
typedef CPluginManager<TInterface> CHostEntryPointImpl< TClassFactory >::TPluginManager

Definition at line 216 of file plugin_manager_impl.hpp.

◆ TPluginManagerParamTree

Definition at line 167 of file plugin_manager.hpp.

◆ TResolvedEntries

template<class TClass >
typedef vector<CDllResolver::SResolvedEntry> CPluginManager< TClass >::TResolvedEntries
protected

Definition at line 532 of file plugin_manager.hpp.

◆ TSearchPaths [1/2]

template<class TClass >
typedef vector<string> CPluginManager< TClass >::TSearchPaths

Container for the DLL search paths.

See also
ResetDllSearchPath

Definition at line 300 of file plugin_manager.hpp.

◆ TSearchPaths [2/2]

Container for the DLL search paths.

Definition at line 571 of file plugin_manager.hpp.

◆ TStringSet

template<class TClass >
typedef set<string> CPluginManager< TClass >::TStringSet
protected

Definition at line 534 of file plugin_manager.hpp.

◆ TSubstituteMap

template<class TClass >
typedef map<string, string> CPluginManager< TClass >::TSubstituteMap
protected

Definition at line 535 of file plugin_manager.hpp.

◆ TValue

template<class TClass >
typedef CPluginManager<TClass>::SDriverInfo CInvalidDrvVer< TClass >::TValue

Definition at line 1005 of file plugin_manager.hpp.

Enumeration Type Documentation

◆ anonymous enum

template<class TInterface >
anonymous enum
Enumerator
eMajor 
eMinor 
ePatchLevel 

Definition at line 160 of file plugin_manager.hpp.

◆ EEntryPointRequest

template<class TClass >
enum CPluginManager::EEntryPointRequest

Actions performed by the entry point.

See also
FNCBI_EntryPoint
Enumerator
eGetFactoryInfo 

Add info about all drivers exported through the entry point to the end of list.

"SFactoryInfo::factory" in the added info should be assigned NULL.

eInstantiateFactory 

Scan the driver info list passed to the entry point for the [name,version] pairs exported by the given entry point.

For each pair found, if its "SDriverInfo::factory" is NULL, instantiate its class factory and assign it to the "SDriverInfo::factory".

Definition at line 409 of file plugin_manager.hpp.

◆ EErrCode

Enumerator
eResolveFailure 

Cannot resolve interface driver.

eParameterMissing 

Missing mandatory parameter.

eNullInstance 

Factory returned NULL instance.

Definition at line 97 of file plugin_manager.hpp.

◆ EVersionLocation

Enumerator
eBeforeSuffix 
eAfterSuffix 

Definition at line 638 of file plugin_manager.hpp.

Function Documentation

◆ AddDllSearchPath()

template<class TClass >
void CPluginManager< TClass >::AddDllSearchPath ( const string path)

Add path for the DLL lookup (for all resolvers)

Parameters
pathAdditional path for the DLL lookup
See also
ResetDllSearchPath

Definition at line 1101 of file plugin_manager.hpp.

◆ AddResolver()

template<class TClass >
void CPluginManager< TClass >::AddResolver ( CPluginManager_DllResolver resolver)

Attach DLL resolver to plugin manager.

Plugin manager uses all attached resolvers to search for DLLs exporting drivers of this interface.

Parameters
resolverDLL resolver. Plugin manager takes ownership of the resolver.
See also
DetachResolver

Definition at line 1079 of file plugin_manager.hpp.

References _ASSERT.

Referenced by CPluginManager< TClass >::CPluginManager().

◆ CInvalidDrvVer()

template<class TClass >
CInvalidDrvVer< TClass >::CInvalidDrvVer ( const string driver_name,
const CVersionInfo vi 
)
inline

Definition at line 1007 of file plugin_manager.hpp.

◆ CPluginManager()

template<class TClass >
CPluginManager< TClass >::CPluginManager ( void  )

◆ CPluginManager_DllResolver() [1/2]

CPluginManager_DllResolver::CPluginManager_DllResolver ( const string interface_name,
const string driver_name = kEmptyStr,
const CVersionInfo version = CVersionInfo::kAny,
CDll::EAutoUnload  unload_dll = CDll::eNoAutoUnload 
)

Construction.

Parameters
interface_nameTarget interface name
plugin_namePlugin family name (dbapi, xloader, etc)
driver_nameName of the driver (dblib, id1, etc)
versionInterface version
unload_dllWhether to unload drivers DLL in the destructor

Definition at line 52 of file plugin_manager.cpp.

◆ CPluginManager_DllResolver() [2/2]

CPluginManager_DllResolver::CPluginManager_DllResolver ( void  )

Definition at line 44 of file plugin_manager.cpp.

◆ CreateDllResolver()

CDllResolver * CPluginManager_DllResolver::CreateDllResolver ( ) const
protected

◆ CreateInstance() [1/3]

template<class TClass >
TClass* CPluginManager< TClass >::CreateInstance ( const string driver = kEmptyStr,
const CVersionInfo version = GetDefaultDrvVers(),
const TPluginManagerParamTree params = 0 
)
inline

Create class instance.

Returns
Never returns NULL – always throw exception on error.
See also
GetFactory()

Definition at line 314 of file plugin_manager.hpp.

Referenced by CNetScheduleClientFactory::CreateInstance(), and CObjectManager::RegisterDataLoader().

◆ CreateInstance() [2/3]

template<class TClass >
virtual TClass* IClassFactory< TClass >::CreateInstance ( const string driver = kEmptyStr,
CVersionInfo  version = GetDefaultDrvVers(),
const TPluginManagerParamTree params = 0 
) const
pure virtual

Create driver's instance.

Function creates driver by its name and version. The requirements is the drivers version should match the interface up to the patch level.

Parameters
driverRequested driver's name (not the name of the supported interface)
versionRequested interface version (as understood by the caller). By default it will be passed the version which is current from the calling code's point of view.

Implemented in CICacheCF< TDriver >, CICacheCF< CBDB_Cache >, CICacheCF< CNetICacheClient >, CSimpleClassFactoryImpl< IFace, TDriver >, CSimpleClassFactoryImpl< IBlobStorage, CBlobStorage_NetCache >, CSimpleClassFactoryImpl< I_DriverContext, CMySQLContext >, CSimpleClassFactoryImpl< objects::CReader, objects::CId2Reader >, CSimpleClassFactoryImpl< objects::CReader, objects::CId1Reader >, CSimpleClassFactoryImpl< ICache, CSQLITE3_Cache >, CSimpleClassFactoryImpl< ICache, CBDB_Cache >, CSimpleClassFactoryImpl< ICache, CNetICacheClient >, CSimpleClassFactoryImpl< ICache, TDriver >, CSimpleClassFactoryImpl< objects::CReader, objects::CPubseqReader >, CSimpleClassFactoryImpl< objects::CReader, objects::CGICacheReader >, CSimpleClassFactoryImpl< I_DriverContext, CODBCContext >, CSimpleClassFactoryImpl< I_DriverContext, CTLibContext >, CSimpleClassFactoryImpl< CWriter, CCacheWriter >, CSimpleClassFactoryImpl< objects::CReader, objects::CPubseq2Reader >, CSimpleClassFactoryImpl< objects::CID2Processor, objects::CID2SNPProcessor >, CSimpleClassFactoryImpl< CReader, CCacheReader >, CPubseq2ReaderCF, CPubseqReaderCF, CId2ReaderCF, CId1ReaderCF, CGICacheReaderCF, CID2SNPProcessorCF, CNetScheduleAPICF, CNetCacheAPICF, CSQLITE3_BlobCacheCF, CBlobStorageNetCacheCF, CDbapiOdbcCFBase, CDbapiCtlibCFBase, CCacheWriterCF, CCacheReaderCF, and CDataLoaderFactory.

Referenced by CPluginManager< SNetScheduleAPIImpl >::CreateInstance().

◆ CreateInstance() [3/3]

template<class IFace , class TDriver >
virtual TInterface* CSimpleClassFactoryImpl< IFace, TDriver >::CreateInstance ( const string driver = kEmptyStr,
CVersionInfo  version = TParent::GetDefaultDrvVers(),
const TPluginManagerParamTree = 0 
) const
inlinevirtual

◆ CreateInstanceFromKey()

template<class TClass >
TClass * CPluginManager< TClass >::CreateInstanceFromKey ( const TPluginManagerParamTree params,
const string driver_key,
const CVersionInfo version = GetDefaultDrvVers() 
)

Detect driver from the parameters using the key to get list of drivers.

Definition at line 760 of file plugin_manager.hpp.

References _TRACE, CTreeNode< TValue, TKeyGetterP >::FindNode(), CTreeNode< TValue, TKeyGetterP >::GetValue(), and version.

◆ CreateInstanceFromList()

template<class TClass >
TClass * CPluginManager< TClass >::CreateInstanceFromList ( const TPluginManagerParamTree params,
const string driver_list,
const CVersionInfo version = GetDefaultDrvVers() 
)

Create first available driver from the list of drivers.

Several driver names may be separated with ":".

Definition at line 728 of file plugin_manager.hpp.

References _TRACE, ERR_POST_XX, CTreeNode< TValue, TKeyGetterP >::FindNode(), NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, ITERATE, NStr::Split(), and version.

◆ CSimpleClassFactoryImpl()

template<class IFace , class TDriver >
CSimpleClassFactoryImpl< IFace, TDriver >::CSimpleClassFactoryImpl ( const string driver_name,
int  patch_level = -1 
)
inline

Construction.

Parameters
driver_nameDriver name string
patch_levelPatch level implemented by the driver. By default corresponds to interface patch level.

Definition at line 77 of file plugin_manager_impl.hpp.

◆ DetachResolver()

template<class TClass >
CPluginManager_DllResolver * CPluginManager< TClass >::DetachResolver ( CPluginManager_DllResolver resolver)

Remove resolver from the list of active resolvers.

Method is used when we need to freeze some of the resolution variants Resolver is not deleted, and can be reattached again by AddResolver

Parameters
resolverDLL resolver. Ownership is returned to the caller and resolver should be deleted by the caller
Returns
Pointer on the detached resolver (same as resolver parameter) or NULL if resolver not found

Definition at line 1088 of file plugin_manager.hpp.

References NON_CONST_ITERATE.

◆ DisableGlobally()

static void CPluginManager_DllResolver::DisableGlobally ( )
inlinestatic

Disable loading plugins from DLLs in general.

Definition at line 691 of file plugin_manager.hpp.

References CPluginManager_DllResolver::EnableGlobally().

◆ EnableGlobally()

void CPluginManager_DllResolver::EnableGlobally ( bool  enable = true)
static

Enable (or disable, if called with enable = false) loading plugins from DLLs in general.

Definition at line 338 of file plugin_manager.cpp.

Referenced by CDbapiSampleApp::CDbapiSampleApp(), CPluginManager_DllResolver::DisableGlobally(), CXcompareAnnotsApplication::Init(), main(), and NCBITEST_AUTO_INIT().

◆ FindClassFactory()

template<class TClass >
CPluginManager< TClass >::TClassFactory * CPluginManager< TClass >::FindClassFactory ( const string driver,
const CVersionInfo version 
) const
protected

◆ FreezeResolution() [1/2]

template<class TClass >
void CPluginManager< TClass >::FreezeResolution ( bool  value = true)
inline

Disable/enable DLL resolution (search for class factories in DLLs)

Definition at line 511 of file plugin_manager.hpp.

◆ FreezeResolution() [2/2]

template<class TClass >
void CPluginManager< TClass >::FreezeResolution ( const string driver,
bool  value = true 
)

Disable/enable DLL resolution (search for class factories in DLLs) for the specified driver.

Definition at line 1139 of file plugin_manager.hpp.

References rapidjson::value.

◆ GetCreateDllResolver()

CDllResolver * CPluginManager_DllResolver::GetCreateDllResolver ( )
protected

◆ GetDefaultDrvVers() [1/2]

template<class TClass >
static const CVersionInfo& IClassFactory< TClass >::GetDefaultDrvVers ( void  )
inlinestatic

Definition at line 200 of file plugin_manager.hpp.

◆ GetDefaultDrvVers() [2/2]

template<class TClass >
static const CVersionInfo& CPluginManager< TClass >::GetDefaultDrvVers ( void  )
inlinestatic

Definition at line 302 of file plugin_manager.hpp.

◆ GetDllName()

string CPluginManager_DllResolver::GetDllName ( const string interface_name,
const string driver_name = kEmptyStr,
const CVersionInfo version = CVersionInfo::kAny 
) const
virtual

Return dll file name.

Name does not include path.

Example: "ncbi_plugin_dbapi_ftds_3_1_7". "ncbi_pulgin_dbapi_ftds.so.3.1.7" In this case, the DLL will be searched for in the standard DLL search paths, with automatic addition of any platform-specific prefixes and suffixes.

Parameters
driver_nameDriver name ("id1", "lds", etc)
versionRequested version of the driver

Reimplemented in CGB_Writer_PluginManager_DllResolver.

Definition at line 113 of file plugin_manager.cpp.

References delimiter, CPluginManager_DllResolver::GetDllNamePrefix(), NStr::IntToString(), NCBI_PLUGIN_SUFFIX, and version.

Referenced by CGB_Writer_PluginManager_DllResolver::GetDllName().

◆ GetDllNameMask()

string CPluginManager_DllResolver::GetDllNameMask ( const string interface_name,
const string driver_name = kEmptyStr,
const CVersionInfo version = CVersionInfo::kAny,
EVersionLocation  ver_lct = eBeforeSuffix 
) const
virtual

Return DLL name mask.

DLL name mask is used for DLL file search.

Example: "ncbi_plugin_objmgr_*.dll" "ncbi_plugin_dbapi_ftds.so.*"

Reimplemented in CGB_Writer_PluginManager_DllResolver.

Definition at line 149 of file plugin_manager.cpp.

References delimiter, CPluginManager_DllResolver::eAfterSuffix, CPluginManager_DllResolver::GetDllNamePrefix(), NStr::IntToString(), NCBI_PLUGIN_SUFFIX, and version.

Referenced by CGB_Writer_PluginManager_DllResolver::GetDllNameMask(), and CPluginManager_DllResolver::ResolveFile().

◆ GetDllNamePrefix()

string CPluginManager_DllResolver::GetDllNamePrefix ( ) const
virtual

Return DLL file name prefix ("ncbi_plugin")

Definition at line 240 of file plugin_manager.cpp.

References CPluginManager_DllResolver::m_DllNamePrefix, and NCBI_PLUGIN_PREFIX.

Referenced by CPluginManager_DllResolver::GetDllName(), and CPluginManager_DllResolver::GetDllNameMask().

◆ GetDllStdSearchPath()

template<class TClass >
CDllResolver::TExtraDllPath CPluginManager< TClass >::GetDllStdSearchPath ( void  ) const

Get standard locations which should be used for the DLL lookup.

See also
SetDllStdSearchPath

Definition at line 1132 of file plugin_manager.hpp.

◆ GetDriverName()

const string& CPluginManager_DllResolver::GetDriverName ( ) const
inline

Return name of the driver.

Definition at line 678 of file plugin_manager.hpp.

References CPluginManager_DllResolver::m_DriverName.

◆ GetDriverVersions() [1/2]

template<class TClass >
virtual void IClassFactory< TClass >::GetDriverVersions ( TDriverList driver_list) const
pure virtual

◆ GetDriverVersions() [2/2]

template<class IFace , class TDriver >
void CSimpleClassFactoryImpl< IFace, TDriver >::GetDriverVersions ( TDriverList driver_list) const
inlinevirtual

Versions of the interface exported by the factory.

Implements IClassFactory< IFace >.

Definition at line 104 of file plugin_manager_impl.hpp.

◆ GetEntryPointName()

string CPluginManager_DllResolver::GetEntryPointName ( const string interface_name = kEmptyStr,
const string driver_name = kEmptyStr 
) const
virtual

Return DLL entry point name:

Default name pattern is:

  • "NCBI_EntryPoint_interface_driver" Alternative variants:
  • "NCBI_EntryPoint"
  • "NCBI_EntryPoint_interface"
  • "NCBI_EntryPoint_driver"
See also
GetEntryPointPrefix

Definition at line 216 of file plugin_manager.cpp.

References CPluginManager_DllResolver::GetEntryPointPrefix().

Referenced by CPluginManager_DllResolver::CreateDllResolver().

◆ GetEntryPointPrefix()

string CPluginManager_DllResolver::GetEntryPointPrefix ( ) const
virtual

Return DLL entry point prefix ("NCBI_EntryPoint")

Definition at line 234 of file plugin_manager.cpp.

References CPluginManager_DllResolver::m_EntryPointPrefix.

Referenced by CPluginManager_DllResolver::CreateDllResolver(), and CPluginManager_DllResolver::GetEntryPointName().

◆ GetErrCodeString()

const char * CPluginManagerException::GetErrCodeString ( void  ) const
overridevirtual

Translate from the error code value to its string representation.

Reimplemented from CCoreException.

Definition at line 343 of file plugin_manager.cpp.

References CPluginManagerException::eParameterMissing, CPluginManagerException::eResolveFailure, CCoreException::GetErrCode(), and CException::GetErrCodeString().

◆ GetFactory()

template<class TClass >
CPluginManager< TClass >::TClassFactory * CPluginManager< TClass >::GetFactory ( const string driver = kEmptyStr,
const CVersionInfo version = GetDefaultDrvVers() 
)

Get class factory.

If more than one (of registered) class factory contain eligible driver candidates, then pick the class factory containing driver of the latest version.

Parameters
driverName of the driver. If passed empty, then – any.
versionRequested version. The returned driver can have a different (newer) version (provided that the new implementation is backward-compatible with the requested version.
Returns
Never return NULL – always throw exception on error.

Definition at line 784 of file plugin_manager.hpp.

References _TRACE, NCBI_THROW, and version.

Referenced by CPluginManager< SNetScheduleAPIImpl >::CreateInstance().

◆ GetParam() [1/4]

template<class TClass >
const string & IClassFactory< TClass >::GetParam ( const string driver_name,
const TPluginManagerParamTree params,
const string param_name,
bool  mandatory 
) const
protected

This version always defaults to the empty string so that it can safely return a reference.

(default_value may be temporary in some cases.)

Definition at line 1279 of file plugin_manager.hpp.

References CConfig::eErr_NoThrow, CConfig::eErr_Throw, and CConfig::GetString().

◆ GetParam() [2/4]

template<class TClass >
string IClassFactory< TClass >::GetParam ( const string driver_name,
const TPluginManagerParamTree params,
const string param_name,
bool  mandatory,
const string default_value 
) const
protected

Utility function to get an element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value)

Definition at line 1261 of file plugin_manager.hpp.

References CConfig::eErr_NoThrow, CConfig::eErr_Throw, and CConfig::GetString().

◆ GetParam() [3/4]

template<class IFace , class TDriver >
const string& CSimpleClassFactoryImpl< IFace, TDriver >::GetParam ( const TPluginManagerParamTree params,
const string param_name,
bool  mandatory 
) const
inlineprotected

This version always defaults to the empty string so that it can safely return a reference.

(default_value may be temporary in some cases.)

Definition at line 126 of file plugin_manager_impl.hpp.

◆ GetParam() [4/4]

template<class IFace , class TDriver >
string CSimpleClassFactoryImpl< IFace, TDriver >::GetParam ( const TPluginManagerParamTree params,
const string param_name,
bool  mandatory,
const string default_value 
) const
inlineprotected

Utility function to get an element of parameter tree Throws an exception when mandatory parameter is missing (or returns the deafult value)

Definition at line 113 of file plugin_manager_impl.hpp.

◆ GetParamBool()

template<class IFace , class TDriver >
bool CSimpleClassFactoryImpl< IFace, TDriver >::GetParamBool ( const TPluginManagerParamTree params,
const string param_name,
bool  ,
bool  default_value 
) const
inlineprotected

Utility function to get an bool of parameter tree Throws an exception when mandatory parameter is missing (or returns the deafult value)

Definition at line 169 of file plugin_manager_impl.hpp.

◆ GetParamDataSize()

template<class IFace , class TDriver >
Uint8 CSimpleClassFactoryImpl< IFace, TDriver >::GetParamDataSize ( const TPluginManagerParamTree params,
const string param_name,
bool  ,
unsigned int  default_value 
) const
inlineprotected

Utility function to get an integer of parameter tree Throws an exception when mandatory parameter is missing (or returns the deafult value)

Definition at line 153 of file plugin_manager_impl.hpp.

◆ GetParamDouble()

template<class IFace , class TDriver >
double CSimpleClassFactoryImpl< IFace, TDriver >::GetParamDouble ( const TPluginManagerParamTree params,
const string param_name,
bool  ,
double  default_value 
) const
inlineprotected

Utility function to get a double of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value)

Definition at line 186 of file plugin_manager_impl.hpp.

◆ GetParamInt()

template<class IFace , class TDriver >
int CSimpleClassFactoryImpl< IFace, TDriver >::GetParamInt ( const TPluginManagerParamTree params,
const string param_name,
bool  ,
int  default_value 
) const
inlineprotected

Utility function to get an integer of parameter tree Throws an exception when mandatory parameter is missing (or returns the deafult value)

Definition at line 137 of file plugin_manager_impl.hpp.

◆ IsEnabledGlobally()

bool CPluginManager_DllResolver::IsEnabledGlobally ( )
static

Return whether to allow loading plugins from DLLs in general.

Definition at line 328 of file plugin_manager.cpp.

◆ IsEnabledGloballyByDefault()

bool CPluginManager_DllResolver::IsEnabledGloballyByDefault ( )
static

Return whether to allow loading plugins from DLLs in general by default.

Definition at line 333 of file plugin_manager.cpp.

References LOAD_PLUGINS_FROM_DLLS_BY_DEFAULT.

◆ NCBI_EntryPointImpl()

template<class TClassFactory >
static void CHostEntryPointImpl< TClassFactory >::NCBI_EntryPointImpl ( TDriverInfoList info_list,
EEntryPointRequest  method 
)
inlinestatic

◆ NCBI_EXCEPTION_DEFAULT()

CPluginManagerException::NCBI_EXCEPTION_DEFAULT ( CPluginManagerException  ,
CCoreException   
)

◆ operator()() [1/2]

template<class TClass >
bool CInvalidDrvVer< TClass >::operator() ( const TValue val)
inline

◆ operator()() [2/2]

template<class TClass >
CPluginManager_DllResolver* CDllResolver_Getter< TClass >::operator() ( void  )
inline

Definition at line 271 of file plugin_manager.hpp.

◆ operator<()

bool operator< ( const SDriverInfo i1,
const SDriverInfo i2 
)
inline

Definition at line 721 of file plugin_manager.hpp.

References SDriverInfo::name, and SDriverInfo::version.

◆ operator==()

bool operator== ( const SDriverInfo i1,
const SDriverInfo i2 
)
inline

Definition at line 715 of file plugin_manager.hpp.

References SDriverInfo::name, and SDriverInfo::version.

◆ RegisterFactory()

template<class TClass >
bool CPluginManager< TClass >::RegisterFactory ( TClassFactory factory)

Try to register factory in the manager.

The registered factory will be owned by the manager.

Returns
true if a factory was registered.
See also
UnregisterFactory()

Definition at line 874 of file plugin_manager.hpp.

◆ RegisterWithEntryPoint() [1/2]

template<class TClass >
template<typename TEntryPoint >
bool CPluginManager< TClass >::RegisterWithEntryPoint ( TEntryPoint  plugin_entry_point)

Register all factories exported by the plugin entry point.

Returns
true if at least one factory was registered.
See also
RegisterFactory()

Definition at line 969 of file plugin_manager.hpp.

References _TRACE, and ITERATE.

Referenced by CNetScheduleClientFactory::CNetScheduleClientFactory().

◆ RegisterWithEntryPoint() [2/2]

template<class TClass >
template<typename TEntryPoint >
bool CPluginManager< TClass >::RegisterWithEntryPoint ( TEntryPoint  plugin_entry_point,
const string driver_name,
const CVersionInfo driver_version = CVersionInfo::kLatest 
)

Register all compatible factories for the driver with the particular version exported by the plugin entry point.

Returns
true if at least one factory was registered.
See also
RegisterFactory()

Definition at line 1025 of file plugin_manager.hpp.

References _TRACE, and ITERATE.

◆ ResetDllSearchPath()

template<class TClass >
void CPluginManager< TClass >::ResetDllSearchPath ( TSearchPaths previous_paths = NULL)

Delete all user-installed paths for the DLL lookup (for all resolvers)

Parameters
previous_pathsIf non-NULL, store the previously set search paths in this container
See also
AddDllSearchPath

Definition at line 1108 of file plugin_manager.hpp.

◆ Resolve()

CDllResolver & CPluginManager_DllResolver::Resolve ( const string path)

Search for plugin DLLs, resolve entry points.

Parameters
pathsPath to scan for DLLs
Returns
Reference on DLL resolver holding all entry points

Definition at line 103 of file plugin_manager.cpp.

References _ASSERT, and CPluginManager_DllResolver::ResolveFile().

◆ ResolveFile() [1/2]

template<class TClass >
void CPluginManager< TClass >::ResolveFile ( const string driver = kEmptyStr,
const CVersionInfo version = GetDefaultDrvVers() 
)

◆ ResolveFile() [2/2]

CDllResolver & CPluginManager_DllResolver::ResolveFile ( const TSearchPaths paths,
const string driver_name = kEmptyStr,
const CVersionInfo version = CVersionInfo::kAny,
CDllResolver::TExtraDllPath  std_path = CDllResolver::fDefaultDllPath 
)

Search for plugin DLLs, resolve entry points.

Parameters
pathsList of directories to scan for DLLs
driver_nameName of the driver (dblib, id1, etc)
versionInterface version
Returns
Reference on DLL resolver holding all entry points

Definition at line 73 of file plugin_manager.cpp.

References _ASSERT, CPluginManager_DllResolver::eAfterSuffix, CDllResolver::FindCandidates(), CPluginManager_DllResolver::GetCreateDllResolver(), CPluginManager_DllResolver::GetDllNameMask(), CVersionInfo::kAny, CVersionInfo::kLatest, CPluginManager_DllResolver::m_DriverName, CPluginManager_DllResolver::m_InterfaceName, CPluginManager_DllResolver::m_Version, mask, and version.

Referenced by CPluginManager_DllResolver::Resolve().

◆ SDriverInfo() [1/2]

SDriverInfo::SDriverInfo ( const string driver_name,
const CVersionInfo driver_version 
)
inline

Definition at line 175 of file plugin_manager.hpp.

◆ SDriverInfo() [2/2]

template<class TClass >
CPluginManager< TClass >::SDriverInfo::SDriverInfo ( const string driver_name,
const CVersionInfo driver_version 
)
inline

Definition at line 374 of file plugin_manager.hpp.

◆ SetDllNamePrefix()

void CPluginManager_DllResolver::SetDllNamePrefix ( const string prefix)
virtual

◆ SetDllStdSearchPath()

template<class TClass >
CDllResolver::TExtraDllPath CPluginManager< TClass >::SetDllStdSearchPath ( CDllResolver::TExtraDllPath  standard_paths)

Specify which standard locations should be used for the DLL lookup (for all resolvers).

If standard locations are not set explicitly using this method CDllResolver::fDefaultDllPath will be used by default.

See also
CDllResolver

Definition at line 1121 of file plugin_manager.hpp.

◆ UnregisterFactory()

template<class TClass >
bool CPluginManager< TClass >::UnregisterFactory ( TClassFactory factory)

Unregister and release (un-own)

See also
RegisterFactory()

Definition at line 953 of file plugin_manager.hpp.

References _TRACE.

◆ WillExtendCapabilities()

template<class TClass >
bool CPluginManager< TClass >::WillExtendCapabilities ( TClassFactory factory) const

Check if a given factory will extend capabilities of the Plugin Manager (add either new drivers or new driver versions to already available).

See also
RegisterFactory()

Definition at line 889 of file plugin_manager.hpp.

References _TRACE, CVersionInfo::eFullyCompatible, ERR_POST_XX, IClassFactory< TClass >::GetDriverVersions(), ITERATE, and Warning().

◆ ~CPluginManager()

template<class TClass >
CPluginManager< TClass >::~CPluginManager ( void  )
virtual

Definition at line 1248 of file plugin_manager.hpp.

References ITERATE.

◆ ~CPluginManager_DllResolver()

CPluginManager_DllResolver::~CPluginManager_DllResolver ( void  )
virtual

Definition at line 67 of file plugin_manager.cpp.

References CPluginManager_DllResolver::m_DllResolver.

◆ ~IClassFactory()

template<class TClass >
virtual IClassFactory< TClass >::~IClassFactory ( void  )
inlinevirtual

Definition at line 231 of file plugin_manager.hpp.

Variable Documentation

◆ factory

template<class TClass >
TClassFactory* CPluginManager< TClass >::SDriverInfo::factory

Class factory (can be NULL)

Definition at line 372 of file plugin_manager.hpp.

◆ m_AutoUnloadDll

CDll::EAutoUnload CPluginManager_DllResolver::m_AutoUnloadDll
protected

Definition at line 704 of file plugin_manager.hpp.

Referenced by CPluginManager_DllResolver::CreateDllResolver().

◆ m_BlockResolution

template<class TClass >
bool CPluginManager< TClass >::m_BlockResolution
private

Flag, prohibits DLL resolution.

Definition at line 550 of file plugin_manager.hpp.

Referenced by CPluginManager< SNetScheduleAPIImpl >::FreezeResolution().

◆ m_DllNamePrefix

string CPluginManager_DllResolver::m_DllNamePrefix
protected

◆ m_DllResolver

CDllResolver* CPluginManager_DllResolver::m_DllResolver
protected

◆ m_DllSearchPaths

template<class TClass >
TSearchPaths CPluginManager< TClass >::m_DllSearchPaths
private

Paths used for DLL search.

Definition at line 546 of file plugin_manager.hpp.

◆ m_DriverName [1/3]

string CPluginManager_DllResolver::m_DriverName
protected

◆ m_DriverName [2/3]

template<class TClass >
const string CInvalidDrvVer< TClass >::m_DriverName
private

Definition at line 1018 of file plugin_manager.hpp.

Referenced by CInvalidDrvVer< TClass >::operator()().

◆ m_DriverName [3/3]

template<class IFace , class TDriver >
string CSimpleClassFactoryImpl< IFace, TDriver >::m_DriverName
protected

◆ m_DriverVersionInfo

template<class IFace , class TDriver >
CVersionInfo CSimpleClassFactoryImpl< IFace, TDriver >::m_DriverVersionInfo
protected

◆ m_EntryPointPrefix

string CPluginManager_DllResolver::m_EntryPointPrefix
protected

Definition at line 699 of file plugin_manager.hpp.

Referenced by CPluginManager_DllResolver::GetEntryPointPrefix().

◆ m_EntryPoints

template<class TClass >
TEntryPoints CPluginManager< TClass >::m_EntryPoints
private

List of entry points registered in this plugin manager.

Definition at line 542 of file plugin_manager.hpp.

◆ m_Factories

template<class TClass >
TFactories CPluginManager< TClass >::m_Factories
private

List of factories presently registered with (and owned by) the plugin manager.

Definition at line 540 of file plugin_manager.hpp.

◆ m_FreezeResolutionDrivers

template<class TClass >
TStringSet CPluginManager< TClass >::m_FreezeResolutionDrivers
private

Set of drivers prohibited from DLL resolution.

Definition at line 552 of file plugin_manager.hpp.

◆ m_InterfaceName

string CPluginManager_DllResolver::m_InterfaceName
protected

◆ m_Mutex

template<class TClass >
CMutex CPluginManager< TClass >::m_Mutex
protected

Protective mutex to synchronize the access to the plugin manager from different threads.

Definition at line 528 of file plugin_manager.hpp.

◆ m_RegisteredEntries

template<class TClass >
TResolvedEntries CPluginManager< TClass >::m_RegisteredEntries
private

DLL entries resolved and registered with dll resolver(s)

Definition at line 548 of file plugin_manager.hpp.

◆ m_Resolvers

template<class TClass >
TDllResolvers CPluginManager< TClass >::m_Resolvers
private

DLL resolvers.

Definition at line 544 of file plugin_manager.hpp.

◆ m_StdDllPath

template<class TClass >
CDllResolver::TExtraDllPath CPluginManager< TClass >::m_StdDllPath
private

Standard locations that should be used for the DLL lookup.

Definition at line 554 of file plugin_manager.hpp.

◆ m_SubstituteMap

template<class TClass >
TSubstituteMap CPluginManager< TClass >::m_SubstituteMap
private

Driver name substitution map.

Definition at line 556 of file plugin_manager.hpp.

Referenced by CPluginManager< TClass >::CPluginManager(), and CPluginManager< SNetScheduleAPIImpl >::CreateInstance().

◆ m_Version

CVersionInfo CPluginManager_DllResolver::m_Version
protected

Definition at line 702 of file plugin_manager.hpp.

Referenced by CPluginManager_DllResolver::ResolveFile().

◆ m_VersionInfo

template<class TClass >
const CVersionInfo CInvalidDrvVer< TClass >::m_VersionInfo
private

Definition at line 1019 of file plugin_manager.hpp.

Referenced by CInvalidDrvVer< TClass >::operator()().

◆ name

string SDriverInfo::name

Driver name.

Definition at line 172 of file plugin_manager.hpp.

Referenced by operator<(), and operator==().

◆ version

CVersionInfo SDriverInfo::version

Driver version.

Definition at line 173 of file plugin_manager.hpp.

Referenced by operator<(), and operator==().

Modified on Sat Apr 13 11:43:56 2024 by modify_doxy.py rev. 669887