(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.53 and 1.54

version 1.53, 2002/08/19 17:43:23 version 1.54, 2002/08/20 17:39:37
Line 100 
Line 100 
 void CIMClassRep::addProperty(const CIMProperty& x) void CIMClassRep::addProperty(const CIMProperty& x)
 { {
     if (x.isUninitialized())     if (x.isUninitialized())
         throw UninitializedObject();          throw UninitializedObjectException();
  
     // Reject addition of duplicate property name:     // Reject addition of duplicate property name:
  
     if (findProperty(x.getName()) != PEG_NOT_FOUND)     if (findProperty(x.getName()) != PEG_NOT_FOUND)
         throw AlreadyExists("property \"" + x.getName() + "\"");          throw AlreadyExistsException("property \"" + x.getName() + "\"");
   
     // Reject addition of references to non-associations:  
   
     // ATTN-RK-20020815: This is the wrong place for this check, because  
     // the ASSOCIATION qualifier could be removed later  
     if (!isAssociation() && x.getValue().getType() == CIMTYPE_REFERENCE)  
         throw AddedReferenceToClass(_reference.getClassName());  
  
     // Set the class origin:     // Set the class origin:
     // ATTN: put this check in other places:     // ATTN: put this check in other places:
Line 128 
Line 121 
 void CIMClassRep::addMethod(const CIMMethod& x) void CIMClassRep::addMethod(const CIMMethod& x)
 { {
     if (x.isUninitialized())     if (x.isUninitialized())
         throw UninitializedObject();          throw UninitializedObjectException();
  
     // Reject duplicate method names:     // Reject duplicate method names:
  
     if (findMethod(x.getName()) != PEG_NOT_FOUND)     if (findMethod(x.getName()) != PEG_NOT_FOUND)
         throw AlreadyExists("method \"" + x.getName() + "\"");          throw AlreadyExistsException("method \"" + x.getName() + "\"");
  
     // Add the method:     // Add the method:
  
Line 154 
Line 147 
 CIMMethod CIMClassRep::getMethod(Uint32 pos) CIMMethod CIMClassRep::getMethod(Uint32 pos)
 { {
     if (pos >= _methods.size())     if (pos >= _methods.size())
         throw OutOfBounds();          throw IndexOutOfBoundsException();
  
     return _methods[pos];     return _methods[pos];
 } }
Line 167 
Line 160 
 void CIMClassRep::removeMethod(Uint32 pos) void CIMClassRep::removeMethod(Uint32 pos)
 { {
     if (pos >= _methods.size())     if (pos >= _methods.size())
         throw OutOfBounds();          throw IndexOutOfBoundsException();
  
     _methods.remove(pos);     _methods.remove(pos);
 } }
Line 220 
Line 213 
                 // set the class-origin:                 // set the class-origin:
                 //----------------------------------------------------------------------                 //----------------------------------------------------------------------
  
                   Boolean isAssociationClass = isAssociation();
   
                 for (Uint32 i = 0, n = _properties.size(); i < n; i++)                 for (Uint32 i = 0, n = _properties.size(); i < n; i++)
                 {                 {
                         CIMProperty& property = _properties[i];                         CIMProperty& property = _properties[i];
   
                           if (!isAssociationClass &&
                               property.getValue().getType() == CIMTYPE_REFERENCE)
                           {
                               throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER,
                                   "Non-assocation class contains reference property");
                           }
   
                         Uint32 pos = superClass.findProperty(property.getName());                         Uint32 pos = superClass.findProperty(property.getName());
  
                         if (pos == PEG_NOT_FOUND)                         if (pos == PEG_NOT_FOUND)


Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2