fw4spl
Posix.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWRUNTIME_DL_POSIX_HPP__
8 #define __FWRUNTIME_DL_POSIX_HPP__
9 
10 
11 #if defined(linux) || defined(__linux) || defined (__MACOSX__)
12 
13 
14 #include "fwRuntime/dl/Native.hpp"
15 
16 #include <dlfcn.h>
17 
18 namespace fwRuntime
19 {
20 
21 namespace dl
22 {
23 
24 
29 struct Posix : public Native
30 {
31 
37  Posix( const boost::filesystem::path & modulePath ) noexcept;
38 
42  ~Posix() noexcept;
43 
44 
48  bool isLoaded() const noexcept;
49 
57  void* getSymbol( const std::string & name ) const;
58 
62  void load();
63 
67  void unload();
68 
69 
70  private:
71 
75  void * m_handle;
76 
77 };
78 
79 
80 } // namespace dl
81 
82 } // namespace fwRuntime
83 
84 
85 #endif // #ifdef linux
86 
87 
88 #endif // __FWRUNTIME_DL_POSIX_HPP__
STL namespace.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...