33 #ifndef DART_COMMON_SHAREDLIBRARY_HPP_
34 #define DART_COMMON_SHAREDLIBRARY_HPP_
39 #include <boost/filesystem.hpp>
46 # define DYNLIB_HANDLE void*
50 # define DYNLIB_HANDLE void*
61 using hInstance = HINSTANCE__*;
62 # define DYNLIB_HANDLE hInstance
67 static constexpr
const char* DART_SHARED_LIB_EXTENSION =
"so";
69 static constexpr
const char* DART_SHARED_LIB_EXTENSION =
"dylib";
71 static constexpr
const char* DART_SHARED_LIB_EXTENSION =
"dll";
73 # error Unhandled platform
77 static constexpr
const char* DART_SHARED_LIB_PREFIX =
"lib";
79 static constexpr
const char* DART_SHARED_LIB_PREFIX =
"lib";
81 static constexpr
const char* DART_SHARED_LIB_PREFIX =
"";
83 # error Unhandled platform
90 class SharedLibraryManager;
118 const boost::filesystem::
path&
path);
170 const
std::
string&
path() const;
183 friend class detail::SharedLibraryManager;
#define DART_DEPRECATED(version)
Definition: Deprecated.hpp:51
SharedLibrary is a RAII object wrapping a shared library.
Definition: SharedLibrary.hpp:95
boost::filesystem::path mCanonicalPath
Canonical path to the shared library where a canonical path is an absolute path that has no elements ...
Definition: SharedLibrary.hpp:188
ProtectedConstructionTag
Definition: SharedLibrary.hpp:98
@ ProtectedConstruction
Definition: SharedLibrary.hpp:99
bool isValid() const
Returns true if the shared library loading was successful.
Definition: SharedLibrary.cpp:119
const boost::filesystem::path & getCanonicalPath() const
Returns the path to the shared library file.
Definition: SharedLibrary.cpp:107
const std::string & path() const
Returns the path to the shared library file.
Definition: SharedLibrary.cpp:113
std::string mPath
Canonical path to the shared library where a canonical path is an absolute path that has no elements ...
Definition: SharedLibrary.hpp:194
static std::shared_ptr< SharedLibrary > create(const boost::filesystem::path &path)
Creates a SharedLibrary from a path to the shared library.
Definition: SharedLibrary.cpp:59
void * getSymbol(const std::string &symbolName) const
Returns a symbol from the shared library if it exists.
Definition: SharedLibrary.cpp:125
std::string getLastError() const
Returns the last loading error.
Definition: SharedLibrary.cpp:143
DYNLIB_HANDLE mInstance
Handle to the loaded library.
Definition: SharedLibrary.hpp:197
Definition: BulletCollisionDetector.cpp:65
Definition: SharedLibraryManager.hpp:46