(file) Return to DynamicLibrary.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

 1 karl  1.18 //%2006////////////////////////////////////////////////////////////////////////
 2 chip  1.1  //
 3 karl  1.12 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 4            // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
 6 karl  1.10 // IBM Corp.; EMC Corporation, The Open Group.
 7 karl  1.12 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
 8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 9 karl  1.13 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
11 karl  1.18 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12            // EMC Corporation; Symantec Corporation; The Open Group.
13 chip  1.1  //
14            // Permission is hereby granted, free of charge, to any person obtaining a copy
15            // of this software and associated documentation files (the "Software"), to
16            // deal in the Software without restriction, including without limitation the
17            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18            // sell copies of the Software, and to permit persons to whom the Software is
19            // furnished to do so, subject to the following conditions:
20 karl  1.10 // 
21 chip  1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29            //
30            //==============================================================================
31            //
32            //%/////////////////////////////////////////////////////////////////////////////
33            
34            #ifndef Pegasus_DynamicLibrary_h
35            #define Pegasus_DynamicLibrary_h
36            
37            #include <Pegasus/Common/Config.h>
38 chip  1.7  #include <Pegasus/Common/Exception.h>
39 chip  1.1  #include <Pegasus/Common/String.h>
40 kumpf 1.22 #include <Pegasus/Common/Mutex.h>
41 chip  1.1  
42            #include <Pegasus/Common/Linkage.h>
43            
44 david.dillard 1.17 #if defined(PEGASUS_OS_TYPE_WINDOWS)
45 kumpf         1.25 # include <Pegasus/Common/Network.h>
46                    # include <windows.h>
47 chip          1.1  #endif
48                    
49                    PEGASUS_NAMESPACE_BEGIN
50                    
51                    class PEGASUS_COMMON_LINKAGE DynamicLibrary
52                    {
53                    public:
54 kumpf         1.25 #if defined(PEGASUS_OS_TYPE_WINDOWS)
55                        typedef HMODULE DynamicLibraryHandle;
56                        typedef FARPROC DynamicSymbolHandle;
57                    #else
58                        typedef void * DynamicLibraryHandle;
59                        typedef void * DynamicSymbolHandle;
60                    #endif
61 chip          1.1  
62                    public:
63 kumpf         1.21     DynamicLibrary();
64 chip          1.1      DynamicLibrary(const DynamicLibrary & library);
65                        explicit DynamicLibrary(const String & fileName);
66 kumpf         1.21     virtual ~DynamicLibrary();
67 chip          1.1  
68                        DynamicLibrary & operator=(const DynamicLibrary & library);
69                    
70 kumpf         1.22     Boolean load();
71                        const String& getLoadErrorMessage() const;
72                        void unload();
73 chip          1.1  
74 kumpf         1.22     Boolean isLoaded() const;
75 chip          1.7  
76 kumpf         1.21     const String& getFileName() const;
77 kumpf         1.23     DynamicSymbolHandle getSymbol(const String & symbolName);
78 chip          1.1  
79                    private:
80 kumpf         1.22     Boolean _load();
81                        void _unload();
82                    
83 chip          1.1      String _fileName;
84 kumpf         1.23     DynamicLibraryHandle _handle;
85 kumpf         1.21     String _loadErrorMessage;
86 kumpf         1.22     Uint32 _referenceCount;
87                        Mutex _loadMutex;
88 chip          1.1  };
89                    
90                    PEGASUS_NAMESPACE_END
91                    
92                    #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2