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

Diff for /pegasus/src/Pegasus/Common/CIMClassRep.cpp between version 1.73 and 1.74

version 1.73, 2006/05/17 20:06:42 version 1.74, 2006/07/21 18:40:55
Line 53 
Line 53 
 #include <Pegasus/Common/MessageLoader.h> //l10n #include <Pegasus/Common/MessageLoader.h> //l10n
 #include "CIMNameUnchecked.h" #include "CIMNameUnchecked.h"
 #include "StrLit.h" #include "StrLit.h"
   #include "CIMInstanceRep.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
 PEGASUS_USING_STD; PEGASUS_USING_STD;
Line 503 
Line 504 
     const CIMPropertyList& propertyList) const     const CIMPropertyList& propertyList) const
 { {
  
     // Create the new instance      // Create the new instance representation
     CIMInstance newInstance(_reference.getClassName());      CIMInstanceRep* newInstanceRep = new CIMInstanceRep(
           CIMObjectPath(String::EMPTY,
                         CIMNamespaceName(),
                         _reference.getClassName()));
  
     // Copy qualifiers if required     // Copy qualifiers if required
     if (includeQualifiers)     if (includeQualifiers)
     {     {
         for (Uint32 i = 0 ; i < getQualifierCount() ; i++)         for (Uint32 i = 0 ; i < getQualifierCount() ; i++)
         {         {
             newInstance.addQualifier(getQualifier(i).clone());              newInstanceRep->_qualifiers.add(getQualifier(i).clone());
         }         }
     }     }
  
       newInstanceRep->_properties.reserveCapacity(_properties.size());
   
     // Copy Properties     // Copy Properties
     for (Uint32 i = 0 ; i < _properties.size() ; i++)     for (Uint32 i = 0 ; i < _properties.size() ; i++)
     {     {
         CIMConstProperty p = getProperty(i);          CIMConstProperty cp = getProperty(i);
         CIMName name = p.getName();          CIMName name = cp.getName();
         Array<CIMName> pl = propertyList.getPropertyNameArray();         Array<CIMName> pl = propertyList.getPropertyNameArray();
         if (propertyList.isNull() || Contains(pl, name))         if (propertyList.isNull() || Contains(pl, name))
         {         {
             CIMProperty p = getProperty(i).clone();              CIMProperty p;
             if (!includeQualifiers && p.getQualifierCount() != 0)  
             {              if (includeQualifiers)
                 for (Uint32 j = 0 ; j < getQualifierCount() ; j++)  
                 {                 {
                     p.removeQualifier(i - 1);                  p = getProperty(i).clone();
                 }                 }
               else
               {
                   p = CIMProperty(cp.getName(),
                                   cp.getValue(),
                                   cp.getArraySize(),
                                   cp.getReferenceClassName(),
                                   cp.getClassOrigin());
             }             }
   
               // Delete class origin attribute if required
             if (!includeClassOrigin)             if (!includeClassOrigin)
             {             {
                 p.setClassOrigin(CIMName());                 p.setClassOrigin(CIMName());
             }             }
             newInstance.addProperty(p);  
  
             // Delete class origin attribute if required              newInstanceRep->_properties.append(p);
         }         }
     }     }
  
       // Create new CIMInstance from CIMInstanceRep
       CIMInstance newInstance(newInstanceRep);
   
     return(newInstance);     return(newInstance);
 } }
  


Legend:
Removed from v.1.73  
changed lines
  Added in v.1.74

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2