Torque3D Documentation / _generateds / platformDlibrary.h

platformDlibrary.h

Engine/source/platform/platformDlibrary.h

More...

Classes:

class

Dynamic Library Interface for library objects loaded using the loadLibrary() function.

Public Defines

define
DLL_CALL() __stdcall
define
define
DLL_EXPORT_CALL() __declspec(dllexport)
define
DLL_IMPORT_CALL() __declspec(dllimport)

Public Typedefs

DLibraryRef 

Public Functions

OsLoadLibrary(const char * file)

Load a library Returns 0 if the library fails to load.

Detailed Description

Public Defines

DLL_CALL() __stdcall
DLL_DECL() 
DLL_EXPORT_CALL() __declspec(dllexport)
DLL_IMPORT_CALL() __declspec(dllimport)

Public Typedefs

typedef StrongRefPtr< DLibrary > DLibraryRef 

Public Functions

OsLoadLibrary(const char * file)

Load a library Returns 0 if the library fails to load.

Symbols are resolved through the DLibrary interface.

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2012 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#ifndef OS_DLIBRARY_H
25#define OS_DLIBRARY_H
26
27#include "core/util/refBase.h"
28
29// DLLs use the standard calling convention
30#define DLL_CALL __stdcall
31#define DLL_EXPORT_CALL __declspec(dllexport)
32#define DLL_IMPORT_CALL __declspec(dllimport)
33
34// Export functions from the DLL
35#if defined(DLL_CODE)
36   #define DLL_DECL DLL_EXPORT_CALL
37#else
38   #define DLL_DECL DLL_IMPORT_CALL
39#endif
40
41
42//-----------------------------------------------------------------------------
43
44///@defgroup KernelDLL Loadable Libraries
45/// Basic DLL handling and symbol resolving. When a library is first loaded
46/// it's "open" function will be called, and it's "close" function is called
47/// right before the library is unloaded.
48///@ingroup OsModule
49///@{
50
51/// Dynamic Library
52/// Interface for library objects loaded using the loadLibrary() function.
53class DLibrary: public StrongRefBase
54{
55public:
56   virtual ~DLibrary() {}
57   virtual void *bind( const char *name ) = 0;
58};
59typedef StrongRefPtr<DLibrary> DLibraryRef;
60
61/// Load a library
62/// Returns 0 if the library fails to load. Symbols are
63/// resolved through the DLibrary interface.
64DLibraryRef OsLoadLibrary( const char *file );
65
66///@}
67
68//-----------------------------------------------------------------------------
69
70
71
72#endif
73
74