(file) Return to ProviderModule.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / Default

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2