A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__Dll.html below:

NCBI C++ ToolKit: DLL Support

enum   CDll::EFlags {
  CDll::fLoadNow = (1<<1) , CDll::fLoadLater = (1<<2) , CDll::fAutoUnload = (1<<3) , CDll::fNoAutoUnload = (1<<4) ,
  CDll::fBaseName = (1<<5) , CDll::fExactName = (1<<6) , CDll::fGlobal = (1<<7) , CDll::fLocal = (1<<8) ,
  CDll::fDefault = fLoadNow | fNoAutoUnload | fBaseName | fGlobal
}   General flags. More...
  enum   CDll::ELoad { CDll::eLoadNow = fLoadNow , CDll::eLoadLater = fLoadLater }   When to load DLL. More...
  enum   CDll::EAutoUnload { CDll::eAutoUnload = fAutoUnload , CDll::eNoAutoUnload = fNoAutoUnload }   Whether to unload DLL in the destructor. More...
  enum   CDll::EBasename { CDll::eBasename = fBaseName , CDll::eExactName = fExactName }   Whether to transform the DLL basename. More...
  enum   CDllResolver::EExtraDllPath {
  CDllResolver::fNoExtraDllPath = 0 , CDllResolver::fProgramPath = 1 << 0 , CDllResolver::fToolkitDllPath = 1 << 1 , CDllResolver::fSystemDllPath = 1 << 2 ,
  CDllResolver::fDefaultDllPath = fProgramPath | fToolkitDllPath | fSystemDllPath
}   Various (usually system-dependent) standard paths to look for DLLs in. More...
    CDll::CDll (const string &name, TFlags flags)   Constructor. More...
    CDll::CDll (const string &name, ELoad when_to_load=eLoadNow, EAutoUnload auto_unload=eNoAutoUnload, EBasename treate_as=eBasename)   Constructor (for backward compatibility). More...
    CDll::CDll (const string &path, const string &name, TFlags flags)   Constructor. More...
    CDll::CDll (const string &path, const string &name, ELoad when_to_load=eLoadNow, EAutoUnload auto_unload=eNoAutoUnload, EBasename treate_as=eBasename)   Constructor (for backward compatibility). More...
    CDll::~CDll (void)   Destructor. More...
  void  CDll::Load (void)   Load DLL. More...
  void  CDll::Unload (void)   Unload DLL. More...
  template<class TFunc > TFunc  CDll::GetEntryPoint_Func (const string &name, TFunc *func)   Get DLLs entry point (function). More...
  template<class TData > TData  CDll::GetEntryPoint_Data (const string &name, TData *data)   Get DLLs entry point (data). More...
  TEntryPoint  CDll::GetEntryPoint (const string &name)   Helper find method for getting a DLLs entry point. More...
  const stringCDll::GetName () const   Get the name of the DLL file. More...
  void  CDll::x_ThrowException (const string &what)   Helper method to throw exception with system-specific error message. More...
  void  CDll::x_Init (const string &path, const string &name, TFlags flags)   Helper method to initialize object. More...
    CDll::CDll (const CDll &)   Private copy constructor to prohibit copy. More...
  CDllCDll::operator= (const CDll &)   Private assignment operator to prohibit assignment. More...
    CDllResolver::SNamedEntryPoint::SNamedEntryPoint (const string &x_name, CDll::TEntryPoint x_entry_point)     CDllResolver::SResolvedEntry::SResolvedEntry (CDll *dll_ptr=0)     CDllResolver::CDllResolver (const string &entry_point_name, CDll::EAutoUnload unload=CDll::eAutoUnload)   Constructor. More...
    CDllResolver::CDllResolver (const vector< string > &entry_point_names, CDll::EAutoUnload unload=CDll::eAutoUnload)   Constructor. More...
    CDllResolver::~CDllResolver ()   Destructor. More...
  bool  CDllResolver::TryCandidate (const string &file_name, const string &driver_name=kEmptyStr)   Try to load DLL from the specified file and resolve the entry point. More...
  template<class TClass > void  CDllResolver::Try (const TClass &candidates, const string &driver_name=kEmptyStr)   Try to resolve file candidates. More...
  template<class TClass1 , class TClass2 > void  CDllResolver::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. More...
  const TEntriesCDllResolver::GetResolvedEntries () const   Get all resolved entry points. More...
  TEntriesCDllResolver::GetResolvedEntries ()   Get all resolved entry points. More...
  void  CDllResolver::Unload ()   Unload all resolved DLLs. More...
    CDllResolver::CDllResolver (const CDllResolver &)   CDllResolverCDllResolver::operator= (const CDllResolver &)   void  CDllResolver::x_AddExtraDllPath (vector< string > &paths, TExtraDllPath which)   Get the DLL search paths related to the given standard path group. More...
  ◆ NCBI_PLUGIN_MIN_SUFFIX #define NCBI_PLUGIN_MIN_SUFFIX   ".dll"

Definition at line 58 of file ncbidll.hpp.

◆ NCBI_PLUGIN_PREFIX #define NCBI_PLUGIN_PREFIX   ""

Definition at line 57 of file ncbidll.hpp.

◆ NCBI_PLUGIN_SUFFIX ◆ FEntryPoint typedef void(* CDll::FEntryPoint) (char ****Do_Not_Call_This)

Fake, uncallable function pointer.

Definition at line 301 of file ncbidll.hpp.

◆ TEntries

Container, keeps list of all resolved entry points.

Definition at line 402 of file ncbidll.hpp.

◆ TExtraDllPath ◆ TFlags ◆ EAutoUnload

Whether to unload DLL in the destructor.

Enumerator eAutoUnload  eNoAutoUnload 

Definition at line 143 of file ncbidll.hpp.

◆ EBasename

Whether to transform the DLL basename.

Transformation is done according to the following: <name> —> NCBI_PLUGIN_PREFIX + <name> + NCBI_PLUGIN_SUFFIX

Enumerator eBasename  eExactName 

Definition at line 152 of file ncbidll.hpp.

◆ EExtraDllPath

Various (usually system-dependent) standard paths to look for DLLs in.

The fProgramPath flag works only inside CNcbiApplication framework.

See also
x_AddExtraDllPath, FindCandidates
Enumerator fNoExtraDllPath  fProgramPath  fToolkitDllPath  fSystemDllPath  fDefaultDllPath 

Definition at line 465 of file ncbidll.hpp.

◆ EFlags

General flags.

Default flag in each group have priority above non-default, if they are used together.

Enumerator fLoadNow 

When to load DLL.

Load DLL immediately in the constructor

fLoadLater 

Load DLL later, using method Load()

fAutoUnload 

Whether to unload DLL in the destructor.

Unload DLL in the destructor

fNoAutoUnload 

Unload DLL later, using method Unload()

fBaseName 

Whether to transform the DLL basename.

Treat the name as DLL basename

fExactName 

Use the name "as is".

fGlobal 

Specify how to load symbols from DLL.

UNIX specific (see 'man dlopen'), ignored on all other platforms. Load as RTLD_GLOBAL

fLocal 

Load as RTLD_LOCAL.

fDefault 

Default flags.

Definition at line 113 of file ncbidll.hpp.

◆ ELoad

When to load DLL.

Enumerator eLoadNow  eLoadLater 

Definition at line 137 of file ncbidll.hpp.

◆ CDll() [1/5]

Private copy constructor to prohibit copy.

◆ CDll() [2/5]

Constructor (for backward compatibility).

Parameters
name Can be either DLL basename or an absolute file path. when_to_load Choice to load now or later using Load(). auto_unload Choice to unload DLL in destructor. treat_as Choice to transform the DLL base name.
See also
Basename discussion in CDll header, ELoad, EAutoUnload, EBasename definition.

Definition at line 95 of file ncbidll.cpp.

References kEmptyStr, and CDll::x_Init().

◆ CDll() [3/5]

Constructor.

Parameters
name Can be either DLL basename or an absolute file path. flags Define how to load/unload DLL and interpret passed name.
See also
Basename discussion in CDll header, EFlags

Definition at line 85 of file ncbidll.cpp.

References flags, kEmptyStr, and CDll::x_Init().

◆ CDll() [4/5]

Constructor (for backward compatibility).

The absolute file path to the DLL will be formed using the "path" and "name" parameters in the following way:

Parameters
path Path to DLL. name Name of DLL. when_to_load Choice to load now or later using Load(). auto_load Choice to unload DLL in destructor. treat_as Choice to transform the DLL base name.
See also
Basename discussion in CDll header, ELoad, EAutoUnload, EBasename definition.

Definition at line 102 of file ncbidll.cpp.

References CDll::x_Init().

◆ CDll() [5/5]

Constructor.

The absolute file path to the DLL will be formed using the "path" and "name" parameters in the following way:

Parameters
path Path to DLL. name Name of DLL. flags Define how to load/unload DLL and interpret passed name.
See also
Basename discussion in CDll header, EFlags

Definition at line 90 of file ncbidll.cpp.

References flags, and CDll::x_Init().

◆ CDllResolver() [1/3] ◆ CDllResolver() [2/3] ◆ CDllResolver() [3/3]

Constructor.

Parameters
entry_point_names List of alternative DLL entry points. unload Whether to unload loaded DLLs in the destructor

Definition at line 278 of file ncbidll.cpp.

References CDllResolver::m_EntryPoinNames.

◆ FindCandidates()

template<class TClass1 , class TClass2 >

Try to resolve all files matching the specified masks in the specified directories.

Parameters
paths Container with directory names. masks Container with file candidate masks. extra_path Extra "standard" paths to search the DLLs in
See also
GetResolvedEntries, x_AddExtraDllPath

Definition at line 487 of file ncbidll.hpp.

References NStr::Compare(), CDirEntry::DeleteTrailingPathSeparator(), NStr::eCase, NStr::eNocase, fFF_File, FindFiles(), i, ITERATE, CDllResolver::Try(), and CDllResolver::x_AddExtraDllPath().

Referenced by CPluginManager_DllResolver::ResolveFile().

◆ GetEntryPoint()

Helper find method for getting a DLLs entry point.

Get the entry point (e.g. a function) with name "name" in the DLL.

Parameters
name Name of DLL. pointer_size Size of pointer.
Returns
The entry point's address on success, or return NULL on error.
See also
GetEntryPoint_Func, GetEntryPoint_Data

Definition at line 212 of file ncbidll.cpp.

References _TRACE, CDll::TEntryPoint::data, CDll::TEntryPoint::func, SDllHandle::handle, CDll::Load(), CDll::m_Handle, and NULL.

Referenced by CDll::GetEntryPoint_Data(), CDll::GetEntryPoint_Func(), and CDllResolver::TryCandidate().

◆ GetEntryPoint_Data()

template<class TData >

TData CDll::GetEntryPoint_Data ( const stringname, TData *  data  ) inline ◆ GetEntryPoint_Func() ◆ GetName() ◆ GetResolvedEntries() [1/2] TEntries& CDllResolver::GetResolvedEntries ( ) inline ◆ GetResolvedEntries() [2/2] ◆ Load()

Load DLL.

Load the DLL using the name specified in the constructor's DLL "name". If Load() is called more than once without calling Unload() in between, then it will do nothing.

Note
If the DLL links against the core "xncbi" library, loading it may result in reinvoking static initializers, with potential consequences ranging from having to retune diagnostic settings to crashing at exit. This problem could theoretically also affect other libraries linked from both sides, but they haven't been an issue in practice. It can help for both the program and the DLL to link "xncbi" dynamically, but in some configurations that change still isn't entirely sufficient. As such, on affected platforms, the C++ Toolkit's build system arranges to filter "xncbi" out of the relevant makefile settings unless specifically directed otherwise via KEEP_CORELIB = yes (which can be useful when building plugins for third-party applications such as scripting languages).

Definition at line 158 of file ncbidll.cpp.

References _T_XCSTRING, _TRACE, F_ISSET, flags, CDll::fLocal, SDllHandle::handle, CDll::m_Handle, CDll::m_Name, and CDll::x_ThrowException().

Referenced by CDll::GetEntryPoint(), and CDll::x_Init().

◆ operator=() [1/2]

Private assignment operator to prohibit assignment.

◆ operator=() [2/2] ◆ SNamedEntryPoint() ◆ SResolvedEntry() CDllResolver::SResolvedEntry::SResolvedEntry ( CDlldll_ptr = 0 ) inline

Definition at line 396 of file ncbidll.hpp.

◆ Try() ◆ TryCandidate()

Try to load DLL from the specified file and resolve the entry point.

If DLL resolution successfully loaded entry point is registered in the internal list of resolved entries.

Parameters
file_name Name of the DLL file. Can be full name with path of the base name. driver_name Name of the driver (substitute for ${driver} macro)
Returns
TRUE if DLL is successfully loaded and entry point resolved.
See also
GetResolvedEntries

Definition at line 290 of file ncbidll.cpp.

References CDll::TEntryPoint::data, CCoreException::eDll, CDllResolver::SResolvedEntry::entry_points, file_name, CDll::fLoadNow, CDll::fNoAutoUnload, CDll::GetEntryPoint(), CCoreException::GetErrCode(), CDll::GetName(), ITERATE, CDllResolver::m_EntryPoinNames, CDllResolver::m_ResolvedEntries, NCBI_LSAN_DISABLE_GUARD, NCBI_REPORT_EXCEPTION_X, NStr::Replace(), CDirEntry::SplitPath(), and CDll::Unload().

Referenced by CDllResolver::Try().

◆ Unload() [1/2] void CDllResolver::Unload ( void  ) ◆ Unload() [2/2] void CDll::Unload ( void  ) ◆ x_AddExtraDllPath()

Get the DLL search paths related to the given standard path group.

Parameters
paths Container to add the requested DLL search paths to. which Which "standard" paths to add.
See also
FindCandidates

Definition at line 360 of file ncbidll.cpp.

References _T_STDSTRING, _TX, buf, env, CDllResolver::fNoExtraDllPath, CDllResolver::fProgramPath, CDllResolver::fSystemDllPath, CDllResolver::fToolkitDllPath, i, ITERATE, len, NCBI_GetRunpath(), NcbiSys_getenv, NPOS, NStr::Replace(), s_GetProgramPath(), and NStr::Split().

Referenced by CDllResolver::FindCandidates().

◆ x_Init()

Helper method to initialize object.

Called from constructor.

Parameters
path Path to DLL. name Name of DLL. when_to_load Choice to load now or later using Load(). auto_load Choice to unload DLL in destructor. treat_as Choice to transform the DLL base name.
See also
EFlags

Definition at line 124 of file ncbidll.cpp.

References CDirEntry::ConcatPath(), F_CLEAN_REDUNDANT, F_ISSET, CDll::fAutoUnload, CDll::fBaseName, CDll::fExactName, CDll::fGlobal, flags, CDll::fLoadLater, CDll::fLoadNow, CDll::fLocal, CDll::fNoAutoUnload, CDll::Load(), CDll::m_Flags, CDll::m_Handle, CDll::m_Name, CDirEntry::MatchesMask(), NCBI_PLUGIN_MIN_SUFFIX, NCBI_PLUGIN_PREFIX, NCBI_PLUGIN_SUFFIX, NPOS, and NStr::ToLower().

Referenced by CDll::CDll().

◆ x_ThrowException() ◆ ~CDll() ◆ ~CDllResolver() CDllResolver::~CDllResolver ( ) ◆ data void* CDll::TEntryPoint::data ◆ dll CDll* CDllResolver::SResolvedEntry::dll ◆ entry_point ◆ entry_points ◆ func ◆ m_AutoUnloadDll ◆ m_EntryPoinNames vector<string> CDllResolver::m_EntryPoinNames protected ◆ m_Flags ◆ m_Handle ◆ m_Name ◆ m_ResolvedEntries TEntries CDllResolver::m_ResolvedEntries protected ◆ name string CDllResolver::SNamedEntryPoint::name

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