OpenWalnut  1.4.0
Public Member Functions | Public Attributes
WSharedLib::data Struct Reference

Simple class holding an opened library. More...

List of all members.

Public Member Functions

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

Public Attributes

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

Detailed Description

Simple class holding an opened library.

Definition at line 171 of file WSharedLib.cpp.


Constructor & Destructor Documentation

Destructor.

Closes the previously opened library handle.

Definition at line 186 of file WSharedLib.cpp.

References m_dl.

WSharedLib::data::data ( const std::string &  path) [inline, explicit]

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

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().

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().

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().


Member Data Documentation

Handle describing the loaded lib.

Definition at line 181 of file WSharedLib.cpp.

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

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: