version 1.199, 2008/10/24 18:27:56
|
version 1.200, 2008/10/28 17:31:38
|
|
|
// not the qualifiers. | // not the qualifiers. |
// | // |
| |
CIMInstance cimInstance(newInstance); |
CIMInstance cimInstance(newInstance.clone()); |
CIMConstClass cimClass; | CIMConstClass cimClass; |
Resolver::resolveInstance (cimInstance, _rep->_context, nameSpace, cimClass, | Resolver::resolveInstance (cimInstance, _rep->_context, nameSpace, cimClass, |
false); | false); |
|
|
// Replace the entire instance with the given instance | // Replace the entire instance with the given instance |
// (this is the default behavior) | // (this is the default behavior) |
// | // |
cimInstance = modifiedInstance; |
cimInstance = modifiedInstance.clone(); |
} | } |
else | else |
{ | { |
|
|
CIMInstance newInstance( | CIMInstance newInstance( |
modifiedInstance.getPath ().getClassName()); | modifiedInstance.getPath ().getClassName()); |
| |
CIMInstance givenInstance = modifiedInstance; |
CIMConstInstance givenInstance = modifiedInstance; |
| |
// | // |
// Copy over the original instance qualifiers | // Copy over the original instance qualifiers |
|
|
for (Uint32 i=0; i<givenInstance.getPropertyCount(); i++) | for (Uint32 i=0; i<givenInstance.getPropertyCount(); i++) |
{ | { |
// Copy the given property value (not qualifiers) | // Copy the given property value (not qualifiers) |
CIMProperty givenProperty = givenInstance.getProperty(i); |
CIMConstProperty givenProperty = givenInstance.getProperty(i); |
CIMProperty newProperty( | CIMProperty newProperty( |
givenProperty.getName(), | givenProperty.getName(), |
givenProperty.getValue(), | givenProperty.getValue(), |
|
|
CIMPropertyList(), | CIMPropertyList(), |
false); | false); |
| |
CIMInstance givenInstance = modifiedInstance; |
CIMConstInstance givenInstance = modifiedInstance; |
| |
// NOTE: Instance qualifiers are not changed when a property list | // NOTE: Instance qualifiers are not changed when a property list |
// is specified. Property qualifiers are replaced with the | // is specified. Property qualifiers are replaced with the |
|
|
if (givenPropPos != PEG_NOT_FOUND) | if (givenPropPos != PEG_NOT_FOUND) |
{ | { |
// Case: Property set in original and given | // Case: Property set in original and given |
CIMProperty givenProperty = |
CIMConstProperty givenProperty = |
givenInstance.getProperty(givenPropPos); | givenInstance.getProperty(givenPropPos); |
| |
// Copy over the property from the given to the original | // Copy over the property from the given to the original |
|
|
{ | { |
// Case: Total property replacement | // Case: Total property replacement |
cimInstance.removeProperty(origPropPos); | cimInstance.removeProperty(origPropPos); |
cimInstance.addProperty(givenProperty); |
cimInstance.addProperty(givenProperty.clone()); |
} | } |
else | else |
{ | { |
|
|
if (givenPropPos != PEG_NOT_FOUND) | if (givenPropPos != PEG_NOT_FOUND) |
{ | { |
// Case: Property set in given and not in original | // Case: Property set in given and not in original |
CIMProperty givenProperty = |
CIMConstProperty givenProperty = |
givenInstance.getProperty(givenPropPos); | givenInstance.getProperty(givenPropPos); |
| |
// Copy over the property from the given to the original | // Copy over the property from the given to the original |
if (includeQualifiers) | if (includeQualifiers) |
{ | { |
// Case: Total property copy | // Case: Total property copy |
cimInstance.addProperty(givenProperty); |
cimInstance.addProperty(givenProperty.clone()); |
} | } |
else | else |
{ | { |