7 #ifndef __FWRUNTIME_DL_NATIVE_HPP__ 8 #define __FWRUNTIME_DL_NATIVE_HPP__ 10 #include "fwRuntime/config.hpp" 11 #include "fwRuntime/RuntimeException.hpp" 13 #include <boost/filesystem/path.hpp> 14 #include <boost/regex.hpp> 33 friend struct ::fwRuntime::Bundle;
41 Native(
const boost::filesystem::path & modulePath) noexcept;
54 virtual bool isLoaded()
const noexcept = 0;
63 virtual void *
getSymbol(
const std::string& name )
const = 0;
68 virtual void load() = 0;
84 const boost::filesystem::path
getFullPath(
const bool _bMustBeFile =
false )
const;
93 const boost::filesystem::path
getPath()
const;
100 void setBundle( const ::fwRuntime::Bundle * bundle ) noexcept;
115 const ::boost::filesystem::path getBundleLocation()
const;
120 const boost::filesystem::path m_modulePath;
133 void operator=(
const Native & ) noexcept;
144 #endif // __FWRUNTIME_DL_NATIVE_HPP__ virtual ~Native() noexcept
Destructor : does nothing.
virtual bool isLoaded() const noexcept=0
Tells if the module is loaded.
virtual void * getSymbol(const std::string &name) const =0
Retrieves the address of a symbol specified by its name.
Native(const boost::filesystem::path &modulePath) noexcept
Constructor.
const boost::filesystem::path getFullPath(const bool _bMustBeFile=false) const
Retrieves the file path of the library including the owning bundle's path.
Defines the abstract class for native module implementors.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
virtual void load()=0
Loads the module.
const boost::filesystem::path getPath() const
Retrieves the file path of the native library.
const ::boost::regex getNativeName() const
Retrieves the pattern of the dynamic library file name given the host OS.
Defines the bundle class.
virtual void unload()=0
Undloads the module.
void setBundle(const ::fwRuntime::Bundle *bundle) noexcept
Set the bundle the library is attached to.