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

Diff for /pegasus/src/Pegasus/Common/CIMParameterRep.cpp between version 1.21 and 1.29.4.1

version 1.21, 2002/07/30 16:14:53 version 1.29.4.1, 2004/04/14 22:20:12
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2003////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
 // The Open Group, Tivoli Systems  // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
   // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
   // IBM Corp.; EMC Corporation, The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 49 
Line 51 
     _isArray(isArray), _arraySize(arraySize),     _isArray(isArray), _arraySize(arraySize),
     _referenceClassName(referenceClassName)     _referenceClassName(referenceClassName)
 { {
     if (!CIMName::legal(name))  
         throw IllegalName();  
   
     if (_type == CIMTYPE_NONE)  
         throw NullType();  
   
     if (_arraySize && !_isArray)     if (_arraySize && !_isArray)
         throw IncompatibleTypes();          throw TypeMismatchException();
  
     if (!referenceClassName.isNull())     if (!referenceClassName.isNull())
     {     {
         if (_type != CIMTYPE_REFERENCE)         if (_type != CIMTYPE_REFERENCE)
         {         {
             throw ExpectedReferenceValue();              throw TypeMismatchException();
         }         }
     }     }
     else     else
     {     {
         // ATTN: revisit this later!          // ATTN: revisit this later!  (Make consistent with CIMPropertyRep)
 #if 0 #if 0
         if (_type == CIMTYPE_REFERENCE)         if (_type == CIMTYPE_REFERENCE)
             throw MissingReferenceClassName();              throw TypeMismatchException();
 #endif #endif
     }     }
 } }
Line 82 
Line 78 
  
 void CIMParameterRep::setName(const CIMName& name) void CIMParameterRep::setName(const CIMName& name)
 { {
     if (!CIMName::legal(name))  
         throw IllegalName();  
   
     _name = name;     _name = name;
 } }
  
   void CIMParameterRep::removeQualifier(Uint32 index)
   {
       if (index >= _qualifiers.getCount())
           throw IndexOutOfBoundsException();
   
       _qualifiers.removeQualifier (index);
   }
   
 void CIMParameterRep::resolve( void CIMParameterRep::resolve(
     DeclContext* declContext,     DeclContext* declContext,
     const CIMNamespaceName& nameSpace)     const CIMNamespaceName& nameSpace)
Line 111 
Line 112 
 { {
     if (_isArray)     if (_isArray)
     {     {
         out << "<PARAMETER.ARRAY";          if (_type == CIMTYPE_REFERENCE)
           {
               out << "<PARAMETER.REFARRAY";
         out << " NAME=\"" << _name << "\" ";         out << " NAME=\"" << _name << "\" ";
  
               if (!_referenceClassName.isNull())
               {
                   out << " REFERENCECLASS=\"" << _referenceClassName.getString()
                       << "\"";
               }
   
               out << ">\n";
   
               _qualifiers.toXml(out);
   
               out << "</PARAMETER.REFARRAY>\n";
           }
           else
           {
               out << "<PARAMETER.ARRAY";
               out << " NAME=\"" << _name << "\" ";
         out << " TYPE=\"" << cimTypeToString (_type) << "\"";         out << " TYPE=\"" << cimTypeToString (_type) << "\"";
  
         if (_arraySize)         if (_arraySize)
Line 130 
Line 148 
  
         out << "</PARAMETER.ARRAY>\n";         out << "</PARAMETER.ARRAY>\n";
     }     }
       }
     else if (_type == CIMTYPE_REFERENCE)     else if (_type == CIMTYPE_REFERENCE)
     {     {
         out << "<PARAMETER.REFERENCE";         out << "<PARAMETER.REFERENCE";
         out << " NAME=\"" << _name << "\" ";         out << " NAME=\"" << _name << "\" ";
         out << " REFERENCECLASS=\"" << _referenceClassName << "\"";          if (!_referenceClassName.isNull())
           {
               out << " REFERENCECLASS=\"" << _referenceClassName.getString() <<
                      "\"";
           }
         out << ">\n";         out << ">\n";
  
         _qualifiers.toXml(out);         _qualifiers.toXml(out);
Line 196 
Line 219 
  
 Boolean CIMParameterRep::identical(const CIMParameterRep* x) const Boolean CIMParameterRep::identical(const CIMParameterRep* x) const
 { {
     if (_name != x->_name)      if (!_name.equal (x->_name))
         return false;         return false;
  
     if (_type != x->_type)     if (_type != x->_type)
         return false;         return false;
  
     if (_referenceClassName != x->_referenceClassName)      if (!_referenceClassName.equal (x->_referenceClassName))
         return false;         return false;
  
     if (!_qualifiers.identical(x->_qualifiers))     if (!_qualifiers.identical(x->_qualifiers))
Line 227 
Line 250 
     x._qualifiers.cloneTo(_qualifiers);     x._qualifiers.cloneTo(_qualifiers);
 } }
  
 void CIMParameterRep::setType(CIMType type)  
 {  
     _type = type;  
   
     if (_referenceClassName.isNull() && _type == CIMTYPE_REFERENCE)  
     {  
         throw MissingReferenceClassName();  
     }  
 }  
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.21  
changed lines
  Added in v.1.29.4.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2