OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DynamicLibrary.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGDB_DYNAMICLIBRARY
15 #define OSGDB_DYNAMICLIBRARY 1
16 
17 #include <osg/Referenced>
18 #include <osgDB/Export>
19 
20 #include <string>
21 
22 
23 namespace osgDB {
24 
29 {
30  public:
31 
32  typedef void* HANDLE;
33  typedef void* PROC_ADDRESS;
34 
38  static DynamicLibrary* loadLibrary(const std::string& libraryName);
39 
41  const std::string& getName() const { return _name; }
42 
44  const std::string& getFullName() const { return _fullName; }
45 
47  HANDLE getHandle() const { return _handle; }
48 
50  PROC_ADDRESS getProcAddress(const std::string& procName);
51 
52  protected:
53 
55  static HANDLE getLibraryHandle( const std::string& libraryName);
56 
58  DynamicLibrary():osg::Referenced() {}
60  DynamicLibrary(const DynamicLibrary&):osg::Referenced() {}
62  DynamicLibrary& operator = (const DynamicLibrary&) { return *this; }
63 
68  DynamicLibrary(const std::string& name,HANDLE handle);
69  ~DynamicLibrary();
70 
71  HANDLE _handle;
72  std::string _name;
73  std::string _fullName;
74 
75 };
76 
77 }
78 
79 #endif // __DYNAMIC_LIBRARY_H
HANDLE getHandle() const
DynamicLibrary(const DynamicLibrary &)
const std::string & getName() const
Definition: Archive.h:24
#define OSGDB_EXPORT
Definition: Export.h:39
const std::string & getFullName() const
Definition: AlphaFunc.h:19