openscenegraph
DynamicLibrary
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
23namespace 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);
70
72 std::string _name;
73 std::string _fullName;
74
75};
76
77}
78
79#endif // __DYNAMIC_LIBRARY_H
Definition DynamicLibrary:29
const std::string & getName() const
Definition DynamicLibrary:41
HANDLE _handle
Definition DynamicLibrary:71
HANDLE getHandle() const
Definition DynamicLibrary:47
static HANDLE getLibraryHandle(const std::string &libraryName)
static DynamicLibrary * loadLibrary(const std::string &libraryName)
void * PROC_ADDRESS
Definition DynamicLibrary:33
void * HANDLE
Definition DynamicLibrary:32
DynamicLibrary()
Definition DynamicLibrary:58
PROC_ADDRESS getProcAddress(const std::string &procName)
const std::string & getFullName() const
Definition DynamicLibrary:44
DynamicLibrary(const std::string &name, HANDLE handle)
std::string _name
Definition DynamicLibrary:72
std::string _fullName
Definition DynamicLibrary:73
DynamicLibrary(const DynamicLibrary &)
Definition DynamicLibrary:60
Definition Referenced:44
Definition Archive:24
author: Julien Valentin 2017 (mp3butcher@hotmail.com)
Definition AlphaFunc:19
#define OSGDB_EXPORT
Definition osgDB/Export:39