1 mike 1.18 //%/////////////////////////////////////////////////////////////////////////////
2 //
|
3 kumpf 1.44 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
|
5 mike 1.18 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 chip 1.21 // 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 mike 1.18 // 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 kumpf 1.44 //
|
13 chip 1.21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
14 mike 1.18 // 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 chip 1.21 // 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 mike 1.18 // 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 //==============================================================================
23 //
24 // Author: Mike Brasher (mbrasher@bmc.com)
25 //
|
26 kumpf 1.35 // Modified By: Karl Schopmeyer(k.schopmeyer@attglobal.net)
27 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
28 kumpf 1.46 // Carol Ann Krug Graves, Hewlett-Packard Company
29 // (carolann_graves@hp.com)
|
30 mike 1.18 //
31 //%/////////////////////////////////////////////////////////////////////////////
32
|
33 kumpf 1.34 #include "CIMClassRep.h"
|
34 mike 1.18 #include "DeclContext.h"
|
35 kumpf 1.47 #include "Resolver.h"
|
36 mike 1.18 #include "Indentor.h"
37 #include "CIMName.h"
38 #include "CIMQualifierNames.h"
|
39 kumpf 1.37 #include "CIMScope.h"
|
40 mike 1.18 #include "XmlWriter.h"
|
41 kumpf 1.42 #include "MofWriter.h"
|
42 karl 1.30 #include <Pegasus/Common/Tracer.h>
|
43 mike 1.18
44 PEGASUS_NAMESPACE_BEGIN
|
45 karl 1.29 PEGASUS_USING_STD;
|
46 mike 1.18
47 CIMClassRep::CIMClassRep(
|
48 mday 1.56.2.1 const CIMObjectPath& reference,
49 const String& superClassName)
|
50 mike 1.20 :
|
51 mday 1.56.2.1 CIMObjectRep(reference),
|
52 mike 1.20 _superClassName(superClassName)
|
53 mike 1.18 {
|
54 mday 1.56.2.1 if (superClassName.size() && !CIMName::legal(superClassName))
55 throw IllegalName();
|
56 mike 1.18 }
57
58 CIMClassRep::~CIMClassRep()
59 {
|
60 mday 1.56.2.1
|
61 mike 1.18 }
62
63 Boolean CIMClassRep::isAssociation() const
64 {
|
65 mday 1.56.2.1 Uint32 pos = findQualifier(CIMQualifierNames::ASSOCIATION);
|
66 mike 1.18
|
67 mday 1.56.2.1 if (pos == PEG_NOT_FOUND)
|
68 mike 1.18 return false;
69
70 Boolean flag;
71
|
72 mday 1.56.2.1 const CIMValue& value = getQualifier(pos).getValue();
|
73 mike 1.18
|
74 kumpf 1.48 if (value.getType() != CIMTYPE_BOOLEAN)
|
75 mike 1.18 return false;
76
77 value.get(flag);
78 return flag;
79 }
80
81 Boolean CIMClassRep::isAbstract() const
82 {
|
83 mday 1.56.2.1 Uint32 pos = findQualifier(CIMQualifierNames::ABSTRACT);
|
84 mike 1.18
|
85 mday 1.56.2.1 if (pos == PEG_NOT_FOUND)
|
86 mike 1.18 return false;
87
88 Boolean flag;
|
89 mday 1.56.2.1 const CIMValue& value = getQualifier(pos).getValue();
|
90 mike 1.18
|
91 kumpf 1.48 if (value.getType() != CIMTYPE_BOOLEAN)
|
92 mike 1.18 return false;
93
94 value.get(flag);
95 return flag;
96 }
97
|
98 mday 1.56.2.1 Boolean CIMClassRep::isTrueQualifier(const String& name) const
|
99 mike 1.18 {
|
100 mday 1.56.2.1 Uint32 pos = findQualifier(name);
101
102 if (pos == PEG_NOT_FOUND)
103 return false;
104
105 Boolean flag;
106 const CIMValue& value = getQualifier(pos).getValue();
107
108 if (value.getType() != CIMTYPE_BOOLEAN)
109 return false;
110
111 value.get(flag);
112 return flag;
113 }
114
115 void CIMClassRep::setSuperClassName(const String& superClassName)
116 {
117 if (!CIMName::legal(superClassName))
118 throw IllegalName();
119
|
120 mike 1.18 _superClassName = superClassName;
121 }
122
123 void CIMClassRep::addProperty(const CIMProperty& x)
124 {
|
125 mday 1.56.2.1 if (x.isNull())
126 throw UninitializedHandle();
|
127 mike 1.18
128 // Reject addition of duplicate property name:
129
130 if (findProperty(x.getName()) != PEG_NOT_FOUND)
|
131 mday 1.56.2.1 throw AlreadyExists();
132
133 // Reject addition of references to non-associations:
134
135 if (!isAssociation() && x.getValue().getType() == CIMTYPE_REFERENCE)
136 throw AddedReferenceToClass(_reference.getClassName());
|
137 mike 1.18
138 // Set the class origin:
139 // ATTN: put this check in other places:
140
|
141 mday 1.56.2.1 if (x.getClassOrigin().size() == 0)
|
142 chip 1.23 CIMProperty(x).setClassOrigin(_reference.getClassName());
|
143 mike 1.18
144 // Add the property:
145
146 _properties.append(x);
147 }
148
149 void CIMClassRep::addMethod(const CIMMethod& x)
150 {
|
151 mday 1.56.2.1 if (x.isNull())
152 throw UninitializedHandle();
|
153 mike 1.18
154 // Reject duplicate method names:
155
156 if (findMethod(x.getName()) != PEG_NOT_FOUND)
|
157 mday 1.56.2.1 throw AlreadyExists();
|
158 mike 1.18
159 // Add the method:
160
161 _methods.append(x);
162 }
163
|
164 mday 1.56.2.1 Uint32 CIMClassRep::findMethod(const String& name) const
|
165 mike 1.18 {
166 for (Uint32 i = 0, n = _methods.size(); i < n; i++)
167 {
|
168 mday 1.56.2.1 if (CIMName::equal(_methods[i].getName(), name))
|
169 mike 1.18 return i;
170 }
171
172 return PEG_NOT_FOUND;
173 }
|
174 mike 1.20
|
175 mday 1.56.2.1 CIMMethod CIMClassRep::getMethod(Uint32 pos)
|
176 mike 1.18 {
|
177 mday 1.56.2.1 if (pos >= _methods.size())
178 throw OutOfBounds();
|
179 mike 1.18
|
180 mday 1.56.2.1 return _methods[pos];
|
181 mike 1.18 }
182
183 Uint32 CIMClassRep::getMethodCount() const
184 {
185 return _methods.size();
186 }
|
187 mike 1.20
|
188 mday 1.56.2.1 void CIMClassRep::removeMethod(Uint32 pos)
|
189 mike 1.18 {
|
190 mday 1.56.2.1 if (pos >= _methods.size())
191 throw OutOfBounds();
|
192 mike 1.18
|
193 mday 1.56.2.1 _methods.remove(pos);
|
194 mike 1.18 }
195
196 void CIMClassRep::resolve(
197 DeclContext* context,
|
198 mday 1.56.2.1 const String& nameSpace)
|
199 mike 1.18 {
|
200 karl 1.30 PEG_METHOD_ENTER(TRC_OBJECTRESOLUTION, "CIMClassRep::resolve()");
|
201 mike 1.18 #if 0
202 if (_resolved)
|
203 chip 1.23 throw ClassAlreadyResolved(_reference.getClassName());
|
204 mike 1.18 #endif
205 if (!context)
206 throw NullPointer();
207
|
208 kumpf 1.32 PEG_TRACE_STRING(TRC_OBJECTRESOLUTION, Tracer::LEVEL3,
209 String("CIMClassRep::resolve class = ") +
|
210 mday 1.56.2.1 _reference.getClassName() + ", superclass = " +
211 _superClassName);
|
212 karl 1.30
|
213 mday 1.56.2.1 if (_superClassName.size())
|
214 karl 1.29 {
215 //cout << "KSTEST Class Resolve with Super class " << getClassName()
216 //<< " superClass " << _superClassName << endl;
217 //----------------------------------------------------------------------
218 // First check to see if the super-class really exists and the subclassing legal:
219 //----------------------------------------------------------------------
220 CIMConstClass superClass
221 = context->lookupClass(nameSpace, _superClassName);
222
|
223 mday 1.56.2.1 if (superClass.isNull())
224 throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_SUPERCLASS,_superClassName);
|
225 karl 1.29
|
226 mike 1.18 #if 0
|
227 karl 1.29 if (!superClass._rep->_resolved)
228 throw ClassNotResolved(_superClassName);
|
229 mike 1.18 #endif
|
230 karl 1.29 // If subclass is abstract but superclass not, throw CIM Exception
231
232 /* ATTN:KS-24 Mar 2002 P1 - Test this and confirm that rule is correct
233 if isAbstract() && !superclass.isAbstract()
234 throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_SUPERCLASS,_superClassName);
235 */
|
236 karl 1.31 /*if(superclass.isTrueQualifier(CIMQualifierNames::TERMINAL)
237 throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_SUPERCLASS,_superClassName);
238 */
|
239 karl 1.29 //----------------------------------------------------------------------
240 // Iterate all the properties of *this* class. Resolve each one and
241 // set the class-origin:
242 //----------------------------------------------------------------------
243
244 for (Uint32 i = 0, n = _properties.size(); i < n; i++)
245 {
246 CIMProperty& property = _properties[i];
|
247 mday 1.56.2.1 Uint32 pos = superClass.findProperty(property.getName());
|
248 karl 1.29
|
249 mday 1.56.2.1 if (pos == PEG_NOT_FOUND)
|
250 karl 1.29 {
|
251 kumpf 1.47 Resolver::resolveProperty (property, context,
252 nameSpace, false, true);
|
253 karl 1.29 }
254 else
|
255 karl 1.28 {
|
256 karl 1.29 CIMConstProperty superClassProperty =
|
257 mday 1.56.2.1 superClass.getProperty(pos);
|
258 kumpf 1.47 Resolver::resolveProperty (property, context,
259 nameSpace, false, superClassProperty, true);
|
260 karl 1.28 }
|
261 karl 1.29 }
262
263 //----------------------------------------------------------------------
264 // Now prepend all properties inherited from the super-class (that
265 // are not overriden by this sub-class).
266 //----------------------------------------------------------------------
267
268 // Iterate super-class properties:
269
270 for (Uint32 i = 0, m = 0, n = superClass.getPropertyCount(); i < n; i++)
|
271 karl 1.28 {
|
272 karl 1.29 CIMConstProperty superClassProperty = superClass.getProperty(i);
273
274 // Find the property in *this* class; if not found, then clone and
275 // insert it (setting the propagated flag). Otherwise, change
276 // the class-origin and propagated flag accordingly.
277
|
278 mday 1.56.2.1 Uint32 pos = PEG_NOT_FOUND;
|
279 karl 1.29 /* ATTN: KS move to simpler version of the find
280 for (Uint32 j = m, n = _properties.size(); j < n; j++)
|
281 karl 1.28 {
|
282 karl 1.29 if (CIMName::equal(_properties[j].getName(),
283 superClassProperty.getName()))
|
284 karl 1.28 {
|
285 mday 1.56.2.1 pos = j;
|
286 karl 1.29 break;
287 }
288 }
289 */
|
290 mday 1.56.2.1 pos = findProperty(superClassProperty.getName());
|
291 karl 1.29
292 // If property exists in super class but not in this one, then
293 // clone and insert it. Otherwise, the properties class
294 // origin was set above.
295
|
296 mday 1.56.2.1 CIMProperty superproperty = superClassProperty.clone(true);
|
297 karl 1.29
|
298 mday 1.56.2.1 if (pos == PEG_NOT_FOUND)
|
299 karl 1.29 {
300 superproperty.setPropagated(true);
301 _properties.insert(m++, superproperty);
302 }
303 else
304 {
305 // Property Qualifiers must propagate if allowed
306 // If property exists in the superclass and in the subclass,
307 // then, enumerate the qualifiers of the superclass's property.
308 // If a qualifier is defined on the superclass's property
309 // but not on the subclass's, then add it to the subclass's
310 // property's qualifier list.
|
311 mday 1.56.2.1 CIMProperty subproperty = _properties[pos];
|
312 karl 1.29 for (Uint32 i = 0, n = superproperty.getQualifierCount();
313 i < n; i++)
314 {
|
315 mday 1.56.2.1 Uint32 pos = PEG_NOT_FOUND;
|
316 karl 1.29 CIMQualifier superClassQualifier =
317 superproperty.getQualifier(i);
|
318 mday 1.56.2.1 const String name = superClassQualifier.getName();
|
319 karl 1.29 /* ATTN KS This is replacement find function.
320 if((Uint32 j = subproperty.findQualifier(q.getName()) == PEG_NOT_FOUND)
|
321 karl 1.28 {
|
322 karl 1.29 subproperty.addQualifier(superClassQualifier);
323
|
324 karl 1.28 }
|
325 karl 1.29 */
326 for (Uint32 j = 0, m = subproperty.getQualifierCount();
327 j < m;
328 j++)
329 {
330 CIMConstQualifier q = subproperty.getQualifier(j);
|
331 mday 1.56.2.1 if (CIMName::equal(name,
332 q.getName()))
|
333 karl 1.29 {
|
334 mday 1.56.2.1 pos = j;
|
335 karl 1.29 break;
336 }
337 } // end comparison of subclass property's qualifiers
|
338 mday 1.56.2.1 if (pos == PEG_NOT_FOUND)
|
339 karl 1.29 {
340 subproperty.addQualifier(superClassQualifier);
341 }
342 /*
|
343 mday 1.56.2.1 if ((pos = subproperty.findQualifier(name)) == PEG_NOT_FOUND)
|
344 karl 1.29 {
345 subproperty.addQualifier(superClassQualifier);
346 }
347 */
348 } // end iteration over superclass property's qualifiers
349 }
350 }
351
352 //----------------------------------------------------------------------
353 // Iterate all the methods of *this* class. Resolve each one and
354 // set the class-origin:
355 //----------------------------------------------------------------------
356
357 for (Uint32 i = 0, n = _methods.size(); i < n; i++)
358 {
359 CIMMethod& method = _methods[i];
|
360 mday 1.56.2.1 Uint32 pos = superClass.findMethod(method.getName());
|
361 karl 1.29
|
362 mday 1.56.2.1 if (pos == PEG_NOT_FOUND)
|
363 karl 1.29 {
|
364 kumpf 1.47 Resolver::resolveMethod (method, context,
365 nameSpace);
|
366 karl 1.29 }
367 else
368 {
|
369 mday 1.56.2.1 CIMConstMethod superClassMethod = superClass.getMethod(pos);
|
370 kumpf 1.47 Resolver::resolveMethod (method, context,
371 nameSpace, superClassMethod);
|
372 karl 1.29 }
373 }
374
375 //----------------------------------------------------------------------
376 // Now prepend all methods inherited from the super-class (that
377 // are not overriden by this sub-class).
378 //----------------------------------------------------------------------
379
380 for (Uint32 i = 0, m = 0, n = superClass.getMethodCount(); i < n; i++)
381 {
382 CIMConstMethod superClassMethod = superClass.getMethod(i);
383
384 // Find the method in *this* class; if not found, then clone and
385 // insert it (setting the propagated flag). Otherwise, change
386 // the class-origin and propagated flag accordingly.
387
|
388 mday 1.56.2.1 Uint32 pos = PEG_NOT_FOUND;
|
389 karl 1.29 /********************** KS move to simpler version
390 for (Uint32 j = m, n = _methods.size(); j < n; j++)
391 {
392 if (CIMName::equal(_methods[j].getName(),
393 superClassMethod.getName()))
|
394 karl 1.28 {
|
395 mday 1.56.2.1 pos = j;
|
396 karl 1.29 break;
|
397 karl 1.28 }
|
398 karl 1.29 }
399
400 // If method exists in super class but not in this one, then
401 // clone and insert it. Otherwise, the method's class origin
402 // has already been set above.
403
|
404 mday 1.56.2.1 if (pos == PEG_NOT_FOUND)
|
405 karl 1.29 {
406 CIMMethod method = superClassMethod.clone();
407 method.setPropagated(true);
408 _methods.insert(m++, method);
409 }
410 */
|
411 mday 1.56.2.1 if((pos = findMethod(superClassMethod.getName())) == PEG_NOT_FOUND)
|
412 karl 1.28 {
|
413 karl 1.29 CIMMethod method = superClassMethod.clone();
414 method.setPropagated(true);
415 _methods.insert(m++, method);
|
416 karl 1.28 }
417 }
|
418 karl 1.29
419 //----------------------------------------------------------------------
420 // Validate the qualifiers of this class:
421 //----------------------------------------------------------------------
422 //cout << "KSTEST Class Qualifiers resolve for class" << getClassName() << endl;
423 _qualifiers.resolve(
424 context,
425 nameSpace,
426 isAssociation() ? CIMScope::ASSOCIATION : CIMScope::CLASS,
427 false,
428 superClass._rep->_qualifiers,
429 true);
|
430 mike 1.18 }
|
431 karl 1.29 else // No SuperClass exsts
|
432 mike 1.18 {
|
433 karl 1.28 //----------------------------------------------------------------------
434 // Resolve each property:
435 //----------------------------------------------------------------------
|
436 karl 1.29 //cout << "KSTEST Class Resolve, No Super class " << getClassName() << endl;
437
|
438 karl 1.28 for (Uint32 i = 0, n = _properties.size(); i < n; i++)
|
439 kumpf 1.47 Resolver::resolveProperty (_properties[i], context,
440 nameSpace, false, true);
|
441 karl 1.28
442 //----------------------------------------------------------------------
443 // Resolve each method:
444 //----------------------------------------------------------------------
445
446 for (Uint32 i = 0, n = _methods.size(); i < n; i++)
|
447 kumpf 1.47 Resolver::resolveMethod (_methods[i], context, nameSpace);
|
448 karl 1.28
449 //----------------------------------------------------------------------
450 // Resolve the qualifiers:
451 //----------------------------------------------------------------------
452
453 CIMQualifierList dummy;
454
455 _qualifiers.resolve(
456 context,
457 nameSpace,
458 isAssociation() ? CIMScope::ASSOCIATION : CIMScope::CLASS,
459 false,
460 dummy,
461 true);
|
462 mike 1.18 }
463
464 // _resolved = true;
465 }
466
467 void CIMClassRep::toXml(Array<Sint8>& out) const
468 {
469 // Class opening element:
470
471 out << "<CLASS ";
|
472 chip 1.23 out << " NAME=\"" << _reference.getClassName() << "\" ";
|
473 mike 1.18
|
474 mday 1.56.2.1 if (_superClassName.size())
|
475 mike 1.18 out << " SUPERCLASS=\"" << _superClassName << "\" ";
476
477 out << ">\n";
478
479 // Qualifiers:
480
481 _qualifiers.toXml(out);
482
483 // Parameters:
484
485 for (Uint32 i = 0, n = _properties.size(); i < n; i++)
|
486 kumpf 1.41 XmlWriter::appendPropertyElement(out, _properties[i]);
|
487 mike 1.18
488 // Methods:
489
490 for (Uint32 i = 0, n = _methods.size(); i < n; i++)
|
491 kumpf 1.41 XmlWriter::appendMethodElement(out, _methods[i]);
|
492 mike 1.18
493 // Class closing element:
494
495 out << "</CLASS>\n";
496 }
|
497 mike 1.19 /** toMof prepares an 8-bit string with the MOF for the class.
498 The BNF for this is:
499 <pre>
500 classDeclaration = [ qualifierList ]
501 CLASS className [ alias ] [ superClass ]
502 "{" *classFeature "}" ";"
|
503 chip 1.21
|
504 mike 1.19 superClass = :" className
505
506 classFeature = propertyDeclaration | methodDeclaration
507
508 */
509
510 void CIMClassRep::toMof(Array<Sint8>& out) const
511 {
512 // Get and format the class qualifiers
|
513 chip 1.23 out << "\n// Class " << _reference.getClassName();
|
514 mike 1.19 if (_qualifiers.getCount())
515 out << "\n";
|
516 karl 1.26 out << "\n";
|
517 mike 1.19 _qualifiers.toMof(out);
518
519 // Separate qualifiers from Class Name
520 out << "\n";
521
522 // output class statement
|
523 chip 1.23 out << "class " << _reference.getClassName();
|
524 mike 1.19
|
525 mday 1.56.2.1 if (_superClassName.size())
|
526 mike 1.19 out << " : " << _superClassName;
|
527 chip 1.21
|
528 mike 1.19 out << "\n{";
529
530 // format the Properties:
531 for (Uint32 i = 0, n = _properties.size(); i < n; i++)
532 {
|
533 mday 1.56.2.1 // Generate MOF if this property not propogated
|
534 mike 1.19 // Note that the test is required only because
535 // there is an error in getclass that does not
536 // test the localOnly flag.
537 if (!_properties[i].getPropagated())
|
538 kumpf 1.42 MofWriter::appendPropertyElement(out, _properties[i]);
|
539 mike 1.19 }
540
541 // Format the Methods: for non-propagated methods
542 for (Uint32 i = 0, n = _methods.size(); i < n; i++)
543 {
544 if (!_methods[i].getPropagated())
|
545 kumpf 1.42 MofWriter::appendMethodElement(out, _methods[i]);
|
546 mike 1.19 }
547
548 // Class closing element:
549 out << "\n};\n";
550 }
551
|
552 mike 1.18
553 CIMClassRep::CIMClassRep()
554 {
555 }
556
557 CIMClassRep::CIMClassRep(const CIMClassRep& x) :
|
558 mike 1.20 CIMObjectRep(x),
559 _superClassName(x._superClassName)
|
560 mike 1.18 {
|
561 kumpf 1.45 _methods.reserveCapacity(x._methods.size());
|
562 mike 1.18
563 for (Uint32 i = 0, n = x._methods.size(); i < n; i++)
564 _methods.append(x._methods[i].clone());
565 }
566
|
567 kumpf 1.36 Boolean CIMClassRep::identical(const CIMObjectRep* x) const
|
568 mike 1.18 {
|
569 mike 1.20 if (!CIMObjectRep::identical(x))
|
570 mike 1.18 return false;
571
|
572 kumpf 1.36 const CIMClassRep* tmprep = dynamic_cast<const CIMClassRep*>(x);
573 if (!tmprep)
574 return false;
575
|
576 mday 1.56.2.1 if (_superClassName != tmprep->_superClassName)
|
577 mike 1.18 return false;
578
|
579 mike 1.20 //
580 // Check methods:
581 //
|
582 mike 1.18
583 {
584 const Array<CIMMethod>& tmp1 = _methods;
|
585 kumpf 1.36 const Array<CIMMethod>& tmp2 = tmprep->_methods;
|
586 mike 1.18
587 if (tmp1.size() != tmp2.size())
588 return false;
589
590 for (Uint32 i = 0, n = tmp1.size(); i < n; i++)
591 {
592 if (!tmp1[i].identical(tmp2[i]))
593 return false;
594
|
595 mday 1.56.2.1 if (tmp1[i].getClassOrigin() != tmp2[i].getClassOrigin())
|
596 mike 1.18 return false;
597
598 if (tmp1[i].getPropagated() != tmp2[i].getPropagated())
599 return false;
600 }
601 }
602
|
603 kumpf 1.36 if (_resolved != tmprep->_resolved)
|
604 mike 1.18 return false;
605
606 return true;
607 }
608
|
609 mday 1.56.2.1 void CIMClassRep::getKeyNames(Array<String>& keyNames) const
|
610 mike 1.18 {
611 keyNames.clear();
612
613 for (Uint32 i = 0, n = getPropertyCount(); i < n; i++)
614 {
615 CIMConstProperty property = getProperty(i);
616
|
617 mday 1.56.2.1 if (property.isKey())
618 keyNames.append(property.getName());
|
619 mike 1.18 }
620 }
621
622 Boolean CIMClassRep::hasKeys() const
623 {
624 for (Uint32 i = 0, n = getPropertyCount(); i < n; i++)
625 {
626 CIMConstProperty property = getProperty(i);
627
|
628 mday 1.56.2.1 if (getProperty(i).isKey())
629 return true;
|
630 mike 1.18 }
631
632 return false;
633 }
634
635 PEGASUS_NAMESPACE_END
636
|