X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fbases%2FDynLibLoaderGNU.hxx;fp=src%2Fbases%2FDynLibLoaderGNU.hxx;h=893972143d7e8b9309e0afcf72335c4353b1393d;hb=a84e60a749da66dffb73297fa5082b70b9d62f7d;hp=0000000000000000000000000000000000000000;hpb=24ab175e1695bf31f5b1f47b43ec8b45322dc6d3;p=modules%2Fyacs.git diff --git a/src/bases/DynLibLoaderGNU.hxx b/src/bases/DynLibLoaderGNU.hxx new file mode 100644 index 000000000..893972143 --- /dev/null +++ b/src/bases/DynLibLoaderGNU.hxx @@ -0,0 +1,36 @@ +#ifndef __DYNLIBLOADERGNU_HXX__ +#define __DYNLIBLOADERGNU_HXX__ + +#include + +namespace YACS +{ + namespace BASES + { + class DynLibLoaderGNU + { + private: + void *_handleOnLoadedLib; + std::string _libName; + static const char _extForDynLib[]; + public: + DynLibLoaderGNU(const std::string& libNameWithoutExtension); + ~DynLibLoaderGNU(); + bool isLibFileFindable() const; + std::string getLibNameWithoutExt() const; + int appendDirInSearchPath(const std::string& dirName); + int removeDirInSearchPath(const std::string& dirName); + void *getHandleOnSymbolWithName(const std::string& symbName, bool stopOnError=true); + static const char *getExtensionForDynLib(); + bool load(); + bool reload(); + bool unload(); + + private: + void loadLib() { load(); }//! load lib without regarding that _libName is reachable + void *resolveSymb(const std::string& symbName, bool stopOnError); + }; + } +} + +#endif