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

Diff for /pegasus/src/Pegasus/Common/CIMMethodRep.cpp between version 1.15 and 1.23

version 1.15, 2002/01/28 15:25:51 version 1.23, 2002/05/15 12:28:21
Line 29 
Line 29 
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <cassert> #include <cassert>
 #include "CIMMethod.h" #include "CIMMethod.h"
   #include "CIMMethodRep.h"
 #include "Indentor.h" #include "Indentor.h"
 #include "CIMName.h" #include "CIMName.h"
 #include "CIMScope.h" #include "CIMScope.h"
 #include "XmlWriter.h" #include "XmlWriter.h"
   #include "MofWriter.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 77 
Line 79 
  
 void CIMMethodRep::addParameter(const CIMParameter& x) void CIMMethodRep::addParameter(const CIMParameter& x)
 { {
     if (!x)      if (x.isNull())
         throw UnitializedHandle();          throw UninitializedHandle();
  
     if (findParameter(x.getName()) != PEG_NOT_FOUND)     if (findParameter(x.getName()) != PEG_NOT_FOUND)
         throw AlreadyExists();         throw AlreadyExists();
Line 86 
Line 88 
     _parameters.append(x);     _parameters.append(x);
 } }
  
 Uint32 CIMMethodRep::findParameter(const String& name)  Uint32 CIMMethodRep::findParameter(const String& name) const
 { {
     for (Uint32 i = 0, n = _parameters.size(); i < n; i++)     for (Uint32 i = 0, n = _parameters.size(); i < n; i++)
     {     {
Line 120 
Line 122 
  
     // Check for type mismatch between return types.     // Check for type mismatch between return types.
  
     assert (inheritedMethod);      assert (!inheritedMethod.isNull());
  
     // Validate the qualifiers of the method (according to     // Validate the qualifiers of the method (according to
     // superClass's method with the same name). This method     // superClass's method with the same name). This method
Line 131 
Line 133 
         nameSpace,         nameSpace,
         CIMScope::METHOD,         CIMScope::METHOD,
         false,         false,
         inheritedMethod._rep->_qualifiers);          inheritedMethod._rep->_qualifiers,
           true);
  
     // Validate each of the parameters:     // Validate each of the parameters:
  
Line 154 
Line 157 
         nameSpace,         nameSpace,
         CIMScope::METHOD,         CIMScope::METHOD,
         false,         false,
         dummy);          dummy,
           true);
  
     // Validate each of the parameters:     // Validate each of the parameters:
  
Line 173 
Line 177 
  
     out << " NAME=\"" << _name << "\"";     out << " NAME=\"" << _name << "\"";
  
     out << " TYPE=\"" << TypeToString(_type) << "\"";      out << " TYPE=\"" << _type.toString() << "\"";
  
     if (_classOrigin.size())     if (_classOrigin.size())
         out << " CLASSORIGIN=\"" << _classOrigin << "\"";         out << " CLASSORIGIN=\"" << _classOrigin << "\"";
Line 186 
Line 190 
     _qualifiers.toXml(out);     _qualifiers.toXml(out);
  
     for (Uint32 i = 0, n = _parameters.size(); i < n; i++)     for (Uint32 i = 0, n = _parameters.size(); i < n; i++)
         _parameters[i].toXml(out);          XmlWriter::appendParameterElement(out, _parameters[i]);
  
     out << "</METHOD>\n";     out << "</METHOD>\n";
 } }
  
 void CIMMethodRep::print(PEGASUS_STD(ostream) &os) const  
 {  
     Array<Sint8> tmp;  
     toXml(tmp);  
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);  
 }  
   
 /** /**
     The BNF for this is;     The BNF for this is;
     methodDeclaration   =  [ qualifierList ] dataType methodName     methodDeclaration   =  [ qualifierList ] dataType methodName
Line 217 
Line 213 
     _qualifiers.toMof(out);     _qualifiers.toMof(out);
  
     // output the type, MethodName and ParmeterList left enclosure     // output the type, MethodName and ParmeterList left enclosure
     out << "\n" << TypeToString(_type) << " " << _name << "(";      out << "\n" << _type.toString() << " " << _name << "(";
  
     // output the param list separated by commas.     // output the param list separated by commas.
  
Line 227 
Line 223 
         if (i)         if (i)
             out << ", ";             out << ", ";
  
         _parameters[i].toMof(out);          MofWriter::appendParameterElement(out, _parameters[i]);
     }     }
  
     // output the parameterlist and method terminator     // output the parameterlist and method terminator
Line 255 
Line 251 
         _parameters.append(x._parameters[i].clone());         _parameters.append(x._parameters[i].clone());
 } }
  
 CIMMethodRep& CIMMethodRep::operator=(const CIMMethodRep& x)  
 {  
     return *this;  
 }  
   
 Boolean CIMMethodRep::identical(const CIMMethodRep* x) const Boolean CIMMethodRep::identical(const CIMMethodRep* x) const
 { {
     if (_name != x->_name)     if (_name != x->_name)


Legend:
Removed from v.1.15  
changed lines
  Added in v.1.23

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2