fw4spl
fwRuntime::dl::Native Struct Referenceabstract

Defines the abstract class for native module implementors. More...

#include <Native.hpp>

Public Member Functions

 Native (const boost::filesystem::path &modulePath) noexcept
 Constructor. More...
 
virtual ~Native () noexcept
 Destructor : does nothing.
 
virtual bool isLoaded () const noexcept=0
 Tells if the module is loaded. More...
 
virtual void * getSymbol (const std::string &name) const =0
 Retrieves the address of a symbol specified by its name. More...
 
virtual void load ()=0
 Loads the module.
 
virtual void unload ()=0
 Undloads the module.
 
const boost::filesystem::path getFullPath (const bool _bMustBeFile=false) const
 Retrieves the file path of the library including the owning bundle's path. More...
 
const boost::filesystem::path getPath () const
 Retrieves the file path of the native library. More...
 
void setBundle (const ::fwRuntime::Bundle *bundle) noexcept
 Set the bundle the library is attached to. More...
 
const ::boost::regex getNativeName () const
 Retrieves the pattern of the dynamic library file name given the host OS. More...
 

Friends

struct ::fwRuntime::Bundle
 

Detailed Description

Defines the abstract class for native module implementors.

Definition at line 31 of file Native.hpp.

Constructor & Destructor Documentation

fwRuntime::dl::Native::Native ( const boost::filesystem::path &  modulePath)
noexcept

Constructor.

Parameters
[in]modulePatha path to the module to manage

Definition at line 27 of file Native.cpp.

Member Function Documentation

const ::boost::filesystem::path fwRuntime::dl::Native::getFullPath ( const bool  _bMustBeFile = false) const

Retrieves the file path of the library including the owning bundle's path.

Parameters
[in]_bMustBeFileif true : bundle is a dynamic library and we want return an exception if is not a file
Returns
a file path
See also
getPath

Definition at line 52 of file Native.cpp.

References getPath(), and SLM_ASSERT.

+ Here is the call graph for this function:

const ::boost::regex fwRuntime::dl::Native::getNativeName ( ) const

Retrieves the pattern of the dynamic library file name given the host OS.

Returns
the boost::regex

Definition at line 79 of file Native.cpp.

References fwRuntime::Bundle::getVersion(), and fwRuntime::Version::string().

Referenced by getPath().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const ::boost::filesystem::path fwRuntime::dl::Native::getPath ( ) const

Retrieves the file path of the native library.

Note
This path is relative to the owning bundle's path.
Returns
a string containing the native module file path

Definition at line 103 of file Native.cpp.

References getNativeName(), and SLM_ASSERT.

Referenced by getFullPath().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void* fwRuntime::dl::Native::getSymbol ( const std::string &  name) const
pure virtual

Retrieves the address of a symbol specified by its name.

Parameters
[in]namea string containing the symbol name.
Returns
a pointer to the found symbol or null if none has been found
virtual bool fwRuntime::dl::Native::isLoaded ( ) const
pure virtualnoexcept

Tells if the module is loaded.

Returns
true or false
void fwRuntime::dl::Native::setBundle ( const ::fwRuntime::Bundle bundle)
noexcept

Set the bundle the library is attached to.

Parameters
[in]bundlea pointer to a bundle instance

Definition at line 131 of file Native.cpp.

References SLM_ASSERT.


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