NCBI_PLUGIN_MIN_SUFFIX
182 CDll(
const string& name,
228 CDll(
const string& path,
const string& name,
272 template<
classTFunc>
290 template<
classTData>
295*
data=
static_cast<TData
>(ptr.
data);
297 return static_cast<TData
>(ptr.
data);
441 const string& driver_name =
kEmptyStr);
451 template<
classTClass>
452 void Try(
constTClass& candidates,
const string& driver_name =
kEmptyStr)
454 typenameTClass::const_iterator it = candidates.begin();
455 typenameTClass::const_iterator it_end = candidates.end();
456 for(; it != it_end; ++it) {
486 template<
classTClass1,
classTClass2>
492vector<string> x_path(paths);
496vector<string> x_path_unique;
497x_path_unique.reserve(x_path.size());
498 #if defined(NCBI_OS_MSWIN) 503 ITERATE(vector<string>, it, x_path) {
505 ITERATE(vector<string>,
i, x_path_unique) {
517vector<string> candidates;
519x_path_unique.begin(), x_path_unique.end(),
520masks.begin(), masks.end(),
523 Try(candidates, driver_name);
CAliasTypeInfoFunctions TFunc
Class for entry point resolution when there are several DLL candidates.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
const string & GetName() const
Get the name of the DLL file.
SDllHandle * m_Handle
DLL handle.
FEntryPoint func
Do not call this func without type cast!
const TEntries & GetResolvedEntries() const
Get all resolved entry points.
void(* FEntryPoint)(char ****Do_Not_Call_This)
Fake, uncallable function pointer.
EBasename
Whether to transform the DLL basename.
void Load(void)
Load DLL.
void x_Init(const string &path, const string &name, TFlags flags)
Helper method to initialize object.
bool TryCandidate(const string &file_name, const string &driver_name=kEmptyStr)
Try to load DLL from the specified file and resolve the entry point.
vector< SResolvedEntry > TEntries
Container, keeps list of all resolved entry points.
vector< SNamedEntryPoint > entry_points
list of DLL entry points
CDllResolver(const string &entry_point_name, CDll::EAutoUnload unload=CDll::eAutoUnload)
Constructor.
EAutoUnload
Whether to unload DLL in the destructor.
CDll::EAutoUnload m_AutoUnloadDll
SResolvedEntry(CDll *dll_ptr=0)
void Try(const TClass &candidates, const string &driver_name=kEmptyStr)
Try to resolve file candidates.
void Unload()
Unload all resolved DLLs.
CDllResolver & operator=(const CDllResolver &)
TFunc GetEntryPoint_Func(const string &name, TFunc *func)
Get DLLs entry point (function).
CDll(const CDll &)
Private copy constructor to prohibit copy.
unsigned int TFlags
Binary OR of "EFlags".
TEntryPoint GetEntryPoint(const string &name)
Helper find method for getting a DLLs entry point.
void Unload(void)
Unload DLL.
SNamedEntryPoint(const string &x_name, CDll::TEntryPoint x_entry_point)
~CDllResolver()
Destructor.
TEntries & GetResolvedEntries()
Get all resolved entry points.
vector< string > m_EntryPoinNames
Candidate entry points.
CDll(const string &name, TFlags flags)
Constructor.
CDll::TEntryPoint entry_point
DLL entry point.
void x_ThrowException(const string &what)
Helper method to throw exception with system-specific error message.
TData GetEntryPoint_Data(const string &name, TData *data)
Get DLLs entry point (data).
EExtraDllPath
Various (usually system-dependent) standard paths to look for DLLs in.
TEntries m_ResolvedEntries
void FindCandidates(const TClass1 &paths, const TClass2 &masks, TExtraDllPath extra_path=fDefaultDllPath, const string &driver_name=kEmptyStr)
Try to resolve all files matching the specified masks in the specified directories.
CDll & operator=(const CDll &)
Private assignment operator to prohibit assignment.
CDll * dll
Loaded DLL instance.
string name
Entry point name.
void x_AddExtraDllPath(vector< string > &paths, TExtraDllPath which)
Get the DLL search paths related to the given standard path group.
CDllResolver(const CDllResolver &)
@ fLoadNow
When to load DLL.
@ fAutoUnload
Whether to unload DLL in the destructor.
@ fBaseName
Whether to transform the DLL basename.
@ fLocal
Load as RTLD_LOCAL.
@ fLoadLater
Load DLL later, using method Load()
@ fExactName
Use the name "as is".
@ fGlobal
Specify how to load symbols from DLL.
@ fDefault
Default flags.
@ fNoAutoUnload
Unload DLL later, using method Unload()
static string DeleteTrailingPathSeparator(const string &path)
Delete trailing path separator, if any.
void FindFiles(TPathIterator path_begin, TPathIterator path_end, const vector< string > &masks, TFindFunc &find_func, TFindFiles flags=fFF_Default)
Generic algorithm for file search.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int Compare(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Compare of a substring with another string.
ECase
Which type of string comparison.
@ eNocase
Case insensitive compare.
@ eCase
Case sensitive compare.
#define NCBI_XNCBI_EXPORT
Defines access to miscellaneous global configuration settings.
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
DLL entry point name -> function pair.
DLL resolution descriptor.
Entry point â pointer to either a function or a data.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4