OpenWalnut  1.5.0dev
Public Member Functions | Public Attributes | List of all members
WSharedLib::data Struct Reference

Simple class holding an opened library. More...

+ Collaboration diagram for WSharedLib::data:

Public Member Functions

 ~data ()
 Destructor. More...
 
 data (const std::string &path)
 Constructor. More...
 
func_ptr_type findFunction (const std::string &name)
 Searches the lib for the specified function symbol and returns it. More...
 
void * findVariable (const std::string &name, bool suppressThrow=false)
 Searches the lib for the specified symbol and returns it. More...
 
bool existsFunction (const std::string &name)
 Check for existence of a given function pointer symbol. More...
 

Public Attributes

const std::string m_path
 Path of lib. More...
 
void * m_dl
 Handle describing the loaded lib. More...
 

Detailed Description

Simple class holding an opened library.

Definition at line 171 of file WSharedLib.cpp.

Constructor & Destructor Documentation

◆ ~data()

WSharedLib::data::~data ( )
inline

Destructor.

Closes the previously opened library handle.

Definition at line 186 of file WSharedLib.cpp.

References m_dl.

◆ data()

WSharedLib::data::data ( const std::string &  path)
inlineexplicit

Constructor.

Opens and loads the library.

See also
WSharedLib::WSharedLib for details.
Parameters
paththe lib to open

Definition at line 198 of file WSharedLib.cpp.

References m_dl, and m_path.

Member Function Documentation

◆ existsFunction()

bool WSharedLib::data::existsFunction ( const std::string &  name)
inline

Check for existence of a given function pointer symbol.

Parameters
namethe symbol
Returns
true if it exists.

Definition at line 260 of file WSharedLib.cpp.

References findVariable().

Referenced by WSharedLib::existsFunction().

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

◆ findFunction()

func_ptr_type WSharedLib::data::findFunction ( const std::string &  name)
inline

Searches the lib for the specified function symbol and returns it.

Parameters
namethe name of the function
Returns
the pointer to the requested function
Exceptions
WLibraryFetchFailedthrown if the symbol could not be found.

Definition at line 218 of file WSharedLib.cpp.

References findVariable().

Referenced by WSharedLib::findFunction().

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

◆ findVariable()

void* WSharedLib::data::findVariable ( const std::string &  name,
bool  suppressThrow = false 
)
inline

Searches the lib for the specified symbol and returns it.

Parameters
namethe name of the symbol to search.
suppressThrowset to true to suppress the exception. NULL is returned if the symbol does not exists
Returns
pointer to the symbol.
Exceptions
WLibraryFetchFailedthrown if the symbol could not be found.

Definition at line 240 of file WSharedLib.cpp.

References m_dl.

Referenced by existsFunction(), findFunction(), and WSharedLib::findVariable().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_dl

void* WSharedLib::data::m_dl

Handle describing the loaded lib.

Definition at line 181 of file WSharedLib.cpp.

Referenced by data(), findVariable(), and ~data().

◆ m_path

const std::string WSharedLib::data::m_path

Path of lib.

Definition at line 176 of file WSharedLib.cpp.

Referenced by data().


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