1 chip 1.1 //%/////////////////////-*-c++-*-///////////////////////////////////////////////
2 //
3 // Copyright (c) 2000 - 2003 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 chip 1.1 //==============================================================================
23 //
24 // Author: Chip Vincent (cvincent@us.ibm.com)
25 //
26 // Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com)
27 // Mike Day, IBM (mdday@us.ibm.com)
28 // Adrian Schuur, IBM (schuur@de.ibm.com)
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_ProviderModule_h
33 #define Pegasus_ProviderModule_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/String.h>
37 #include <Pegasus/Common/System.h>
38 #include <Pegasus/Common/IPC.h>
39
40 #include <Pegasus/Provider/CIMProvider.h>
41
|
42 chip 1.2 #include <Pegasus/Config/ConfigManager.h>
43
|
44 chip 1.1 #include <Pegasus/Server/Linkage.h>
45
46 PEGASUS_NAMESPACE_BEGIN
47
48 // The ProviderModule class represents the physical module, as defined by the
49 // operating, that contains a provider. This class effectively encapsulates the
50 // "physical" portion of a provider.
51 class PEGASUS_SERVER_LINKAGE ProviderModule
52 {
53 public:
54 ProviderModule(const String & fileName);
55 virtual ~ProviderModule(void);
56
57 const String & getFileName(void) const;
58
|
59 chip 1.2 CIMProvider *load(const String & providerName);
|
60 chip 1.1 void unloadModule(void);
61
|
62 chip 1.2 Boolean operator == (const void *key) const;
63 Boolean operator == (const ProviderModule & pmod) const;
|
64 chip 1.1
65 protected:
66 String _fileName;
67 AtomicInt _ref_count;
68 DynamicLibraryHandle _library;
69
70 private:
71 ProviderModule(const String & fileName, const Uint32 & refCount);
72 ProviderModule(const String & fileName, const String & providerName);
73 ProviderModule(const String & fileName, const String & providerName,
74 const String & interfaceName, const Uint32 & refCount);
|
75 chip 1.2 // do not use !! not safe !! << Wed Apr 9 12:07:02 2003 mdd >>
|
76 chip 1.1 ProviderModule(const ProviderModule & pm);
77
78 const String & getProviderName(void) const;
79 const String & getInterfaceName(void) const ;
80
81 const Uint32 & getRefCount(void) const;
|
82 chip 1.2
|
83 chip 1.1 virtual CIMProvider * getProvider(void) const;
84
|
85 chip 1.2 private:
86 friend class LocalProviderManager;
87 friend class Provider;
88
|
89 chip 1.1 String _providerName;
90 String _interfaceName;
91 String _interfaceFileName; // for later use with interface registration
92
93 CIMProvider * _provider;
94
95 Uint32 _refCount;
96
97 };
98
99 inline const String & ProviderModule::getFileName(void) const
100 {
|
101 chip 1.2 return(_fileName);
|
102 chip 1.1 }
103
104 inline const String & ProviderModule::getInterfaceName(void) const
105 {
|
106 chip 1.2 return(_interfaceName);
|
107 chip 1.1 }
108
109 inline const String & ProviderModule::getProviderName(void) const
110 {
|
111 chip 1.2 return(_providerName);
|
112 chip 1.1 }
113
114 inline CIMProvider * ProviderModule::getProvider(void) const
115 {
|
116 chip 1.2 return(_provider);
|
117 chip 1.1 }
118
119 inline const Uint32 & ProviderModule::getRefCount(void) const
120 {
|
121 chip 1.2 return(_refCount);
|
122 chip 1.1 }
123
124 PEGASUS_NAMESPACE_END
125
126 #endif
|