(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.7 and 1.13

version 1.7, 2001/04/29 18:57:33 version 1.13, 2001/05/23 21:57:14
Line 55 
Line 55 
 { {
     Uint32 pos = findQualifier(CIMQualifierNames::ASSOCIATION);     Uint32 pos = findQualifier(CIMQualifierNames::ASSOCIATION);
  
     if (pos == Uint32(-1))      if (pos == PEG_NOT_FOUND)
         return false;         return false;
  
     Boolean flag;     Boolean flag;
Line 73 
Line 73 
 { {
     Uint32 pos = findQualifier(CIMQualifierNames::ABSTRACT);     Uint32 pos = findQualifier(CIMQualifierNames::ABSTRACT);
  
     if (pos == Uint32(-1))      if (pos == PEG_NOT_FOUND)
         return false;         return false;
  
     Boolean flag;     Boolean flag;
Line 101 
Line 101 
  
     // Reject addition of duplicate property name:     // Reject addition of duplicate property name:
  
     if (findProperty(x.getName()) != Uint32(-1))      if (findProperty(x.getName()) != PEG_NOT_FOUND)
         throw AlreadyExists();         throw AlreadyExists();
  
     // Reject addition of references to non-associations:     // Reject addition of references to non-associations:
Line 120 
Line 120 
     _properties.append(x);     _properties.append(x);
 } }
  
 void CIMClassRep::removeProperty(Uint32 pos)  
 {  
     if (pos >= _properties.size())  
         throw OutOfBounds();  
 }  
  
 Uint32 CIMClassRep::findProperty(const String& name) Uint32 CIMClassRep::findProperty(const String& name)
 { {
Line 134 
Line 129 
             return i;             return i;
     }     }
  
     return Uint32(-1);      return PEG_NOT_FOUND;
   }
   
   Boolean CIMClassRep::existsProperty(const String& name)
   {
       return (findProperty(name) != PEG_NOT_FOUND) ?
                       true : false;
 } }
  
 CIMProperty CIMClassRep::getProperty(Uint32 pos) CIMProperty CIMClassRep::getProperty(Uint32 pos)
Line 145 
Line 146 
     return _properties[pos];     return _properties[pos];
 } }
  
   void CIMClassRep::removeProperty(Uint32 pos)
   {
       if (pos >= _properties.size())
           throw OutOfBounds();
   
       _properties.remove(pos);
   }
   
   
 Uint32 CIMClassRep::getPropertyCount() const Uint32 CIMClassRep::getPropertyCount() const
 { {
     return _properties.size();     return _properties.size();
Line 157 
Line 167 
  
     // Reject duplicate method names:     // Reject duplicate method names:
  
     if (findMethod(x.getName()) != Uint32(-1))      if (findMethod(x.getName()) != PEG_NOT_FOUND)
         throw AlreadyExists();         throw AlreadyExists();
  
     // Add the method:     // Add the method:
Line 173 
Line 183 
             return i;             return i;
     }     }
  
     return Uint32(-1);      return PEG_NOT_FOUND;
 } }
  
   Boolean CIMClassRep::existsMethod(const String& name)
   {
       return(findMethod(name) != PEG_NOT_FOUND) ?
                           true : false;
   }
 CIMMethod CIMClassRep::getMethod(Uint32 pos) CIMMethod CIMClassRep::getMethod(Uint32 pos)
 { {
     if (pos >= _methods.size())     if (pos >= _methods.size())
Line 188 
Line 203 
 { {
     return _methods.size();     return _methods.size();
 } }
   //ATTN: Ks 18 May
   void CIMClassRep::removeMethod(Uint32 pos)
   {
       if (pos >= _methods.size())
           throw OutOfBounds();
   
       _methods.remove(pos);
   }
  
 void CIMClassRep::resolve( void CIMClassRep::resolve(
     DeclContext* context,     DeclContext* context,
Line 211 
Line 234 
             = context->lookupClass(nameSpace, _superClassName);             = context->lookupClass(nameSpace, _superClassName);
  
         if (!superClass)         if (!superClass)
             throw NoSuchSuperClass(_superClassName);              throw PEGASUS_CIM_EXCEPTION(INVALID_SUPERCLASS, _superClassName);
  
 #if 0 #if 0
         if (!superClass._rep->_resolved)         if (!superClass._rep->_resolved)
Line 228 
Line 251 
             CIMProperty& property = _properties[i];             CIMProperty& property = _properties[i];
             Uint32 pos = superClass.findProperty(property.getName());             Uint32 pos = superClass.findProperty(property.getName());
  
             if (pos == Uint32(-1))              if (pos == PEG_NOT_FOUND)
             {             {
                 property.resolve(context, nameSpace, false);                 property.resolve(context, nameSpace, false);
             }             }
             else             else
             {             {
                 CIMConstProperty superClassProperty = superClass.getProperty(pos);                  CIMConstProperty superClassProperty =
                   superClass.getProperty(pos);
                 property.resolve(context, nameSpace, false, superClassProperty);                 property.resolve(context, nameSpace, false, superClassProperty);
             }             }
         }         }
Line 254 
Line 278 
             // insert it (setting the propagated flag). Otherwise, change             // insert it (setting the propagated flag). Otherwise, change
             // the class-origin and propagated flag accordingly.             // the class-origin and propagated flag accordingly.
  
             Uint32 pos = Uint32(-1);              Uint32 pos = PEG_NOT_FOUND;
  
             for (Uint32 j = m, n = _properties.size(); j < n; j++)             for (Uint32 j = m, n = _properties.size(); j < n; j++)
             {             {
Line 271 
Line 295 
             // clone and insert it. Otherwise, the properties class             // clone and insert it. Otherwise, the properties class
             // origin was set above.             // origin was set above.
  
             if (pos == Uint32(-1))              if (pos == PEG_NOT_FOUND)
             {             {
                 CIMProperty property = superClassProperty.clone();                 CIMProperty property = superClassProperty.clone();
                 property.setPropagated(true);                 property.setPropagated(true);
Line 289 
Line 313 
             CIMMethod& method = _methods[i];             CIMMethod& method = _methods[i];
             Uint32 pos = superClass.findMethod(method.getName());             Uint32 pos = superClass.findMethod(method.getName());
  
             if (pos == Uint32(-1))              if (pos == PEG_NOT_FOUND)
             {             {
                 method.resolve(context, nameSpace);                 method.resolve(context, nameSpace);
             }             }
Line 313 
Line 337 
             // insert it (setting the propagated flag). Otherwise, change             // insert it (setting the propagated flag). Otherwise, change
             // the class-origin and propagated flag accordingly.             // the class-origin and propagated flag accordingly.
  
             Uint32 pos = Uint32(-1);              Uint32 pos = PEG_NOT_FOUND;
  
             for (Uint32 j = m, n = _methods.size(); j < n; j++)             for (Uint32 j = m, n = _methods.size(); j < n; j++)
             {             {
Line 330 
Line 354 
             // clone and insert it. Otherwise, the method's class origin             // clone and insert it. Otherwise, the method's class origin
             // has already been set above.             // has already been set above.
  
             if (pos == Uint32(-1))              if (pos == PEG_NOT_FOUND)
             {             {
                 CIMMethod method = superClassMethod.clone();                 CIMMethod method = superClassMethod.clone();
                 method.setPropagated(true);                 method.setPropagated(true);
Line 413 
Line 437 
     out << "</CLASS>\n";     out << "</CLASS>\n";
 } }
  
 void CIMClassRep::print(std::ostream &os) const  void CIMClassRep::print(PEGASUS_STD(ostream) &os) const
 { {
     Array<Sint8> tmp;     Array<Sint8> tmp;
     toXml(tmp);     toXml(tmp);
Line 520 
Line 544 
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
   


Legend:
Removed from v.1.7  
changed lines
  Added in v.1.13

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2