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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2