(file) Return to ProviderName.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2

  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:
 29           //
 30           //%/////////////////////////////////////////////////////////////////////////////
 31           
 32           #include "ProviderName.h"
 33           
 34           #include <Pegasus/Common/CIMValue.h>
 35           
 36 chip  1.1 PEGASUS_NAMESPACE_BEGIN
 37           
 38           ProviderName::ProviderName(void) : _capabilities(0)
 39           {
 40           }
 41           
 42           /*
 43           ProviderName::ProviderName(const String & providerName)
 44               : _capabilities(0)
 45           {
 46               // NOTE: format ::= <physical_name>::<logical_name>::<object_name>::<capabilities>
 47           
 48               String s = providerName;
 49           
 50               Uint32 beg = 0;
 51               Uint32 end = 0;
 52           
 53               // get physical name
 54               beg = 0;
 55               end = s.find("::");
 56           
 57 chip  1.1     String temp = s.subString(beg, end - beg);
 58               _physicalName = temp;
 59           
 60               s.remove(beg, end + 2); // skip past the "::"
 61               beg = end;
 62           
 63               // get logical name
 64               beg = 0;
 65               end = s.find("::");
 66           
 67               temp = s.subString(beg, end - beg);
 68               _logicalName = temp;
 69           
 70               s.remove(beg, end + 2); // skip past the "::"
 71               beg = end;
 72           
 73               // get object name
 74               beg = 0;
 75               end = s.find("::");
 76           
 77               temp = s.subString(beg, end - beg);
 78 chip  1.1     _objectName = temp;
 79           
 80               //s.remove(beg, end + 2); // skip past the "::"
 81               //beg = end;
 82           
 83               _objectName = temp;
 84           
 85               // get capabilities mask
 86               beg = 0;
 87               end = s.find("::");
 88           
 89               _physicalName = String(s.subString(beg, end - beg));
 90           }
 91           */
 92           
 93           ProviderName::ProviderName(
 94               const String & objectName,
 95               const String & logicalName,
 96               const String & physicalName,
 97               const String & interfaceName,
 98               const Uint32 capabilities)
 99 chip  1.1     : _capabilities(0)
100           {
101               // ATTN: validate arguments ???
102               _objectName = objectName;
103           
104               _logicalName = logicalName;
105           
106               _physicalName = physicalName;
107           
108               _interfaceName = interfaceName;
109           }
110           
111           ProviderName::~ProviderName(void)
112           {
113           }
114           
115           /*
116           String ProviderName::toString(void) const
117           {
118               String s;
119           
120 chip  1.1     s.append(_physicalName);
121               s.append("::");
122               s.append(_logicalName);
123               s.append("::");
124               s.append(_objectName);
125               //s.append("::");
126               //s.append(CIMValue(_capabilities).toString());
127           
128               return(s);
129           }
130           */
131           
132           String ProviderName::getPhysicalName(void) const
133           {
134               return(_physicalName);
135           }
136           
137           void ProviderName::setPhysicalName(const String & physicalName)
138           {
139               _physicalName = physicalName;
140           }
141 chip  1.1 
142           String ProviderName::getLogicalName(void) const
143           {
144               return(_logicalName);
145           }
146           
147           void ProviderName::setLogicalName(const String & logicalName)
148           {
149               _logicalName = logicalName;
150           }
151           
152           String ProviderName::getObjectName(void) const
153           {
154               return(_objectName);
155           }
156           
157           void ProviderName::setObjectName(const String & logicalName)
158           {
159               _logicalName = logicalName;
160           }
161           
162 chip  1.2 String ProviderName::getInterfaceName(void) const
163           {
164               return(_interfaceName);
165           }
166           
167           void ProviderName::setInterfaceName(const String & interfaceName)
168           {
169               _interfaceName = interfaceName;
170           }
171           
172 chip  1.1 Uint32 ProviderName::getCapabilitiesMask(void) const
173           {
174               return(_capabilities);
175           }
176           
177           void ProviderName::setCapabilitiesMask(const Uint32 capabilities)
178           {
179               _capabilities = capabilities;
180           }
181           
182           PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2