(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.29 and 1.36.2.1

version 1.29, 2003/10/22 14:26:02 version 1.36.2.1, 2005/09/30 16:28:15
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., 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.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software 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 27 
Line 31 
 // //
 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 //                (carolann_graves@hp.com) //                (carolann_graves@hp.com)
   //              David Dillard, VERITAS Software Corp.
   //                  (david.dillard@veritas.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 41 
Line 47 
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   CIMParameterRep::CIMParameterRep()
   {
   }
   
   CIMParameterRep::CIMParameterRep(const CIMParameterRep& x) :
       Sharable(),
       _name(x._name),
       _type(x._type),
       _isArray(x._isArray),
       _arraySize(x._arraySize),
       _referenceClassName(x._referenceClassName)
   {
       x._qualifiers.cloneTo(_qualifiers);
   }
   
 CIMParameterRep::CIMParameterRep( CIMParameterRep::CIMParameterRep(
     const CIMName& name,     const CIMName& name,
     CIMType type,     CIMType type,
Line 51 
Line 72 
     _isArray(isArray), _arraySize(arraySize),     _isArray(isArray), _arraySize(arraySize),
     _referenceClassName(referenceClassName)     _referenceClassName(referenceClassName)
 { {
     if (_arraySize && !_isArray)      // ensure name is not null
       if(name.isNull())
       {
           throw UninitializedObjectException();
       }
   
       if((_arraySize != 0) && !_isArray)
       {
         throw TypeMismatchException();         throw TypeMismatchException();
       }
  
     if (!referenceClassName.isNull())     if (!referenceClassName.isNull())
     {     {
Line 63 
Line 92 
     }     }
     else     else
     {     {
         // ATTN: revisit this later!  
 #if 0  
         if (_type == CIMTYPE_REFERENCE)         if (_type == CIMTYPE_REFERENCE)
           {
             throw TypeMismatchException();             throw TypeMismatchException();
 #endif          }
     }     }
 } }
  
 CIMParameterRep::~CIMParameterRep() CIMParameterRep::~CIMParameterRep()
 { {
   
 } }
  
 void CIMParameterRep::setName(const CIMName& name) void CIMParameterRep::setName(const CIMName& name)
 { {
       // ensure name is not null
       if(name.isNull())
       {
           throw UninitializedObjectException();
       }
   
     _name = name;     _name = name;
 } }
  
Line 108 
Line 141 
         true);         true);
 } }
  
 void CIMParameterRep::toXml(Array<Sint8>& out) const  void CIMParameterRep::toXml(Buffer& out) const
 { {
     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()
                       << "\"";
               }
   
                           if (_arraySize)
               {
                   char buffer[32];
                   sprintf(buffer, "%d", _arraySize);
                   out << " ARRAYSIZE=\"" << buffer << "\"";
               }
   
               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 131 
Line 188 
  
         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 169 
Line 231 
  
     Format on a single line.     Format on a single line.
     */     */
 void CIMParameterRep::toMof(Array<Sint8>& out) const  void CIMParameterRep::toMof(Buffer& out) const
 { {
     // Output the qualifiers for the parameter     // Output the qualifiers for the parameter
     _qualifiers.toMof(out);     _qualifiers.toMof(out);
Line 212 
Line 274 
     return true;     return true;
 } }
  
 CIMParameterRep::CIMParameterRep()  
 {  
   
 }  
   
 CIMParameterRep::CIMParameterRep(const CIMParameterRep& x) :  
     Sharable(),  
     _name(x._name),  
     _type(x._type),  
     _isArray(x._isArray),  
     _arraySize(x._arraySize),  
     _referenceClassName(x._referenceClassName)  
 {  
     x._qualifiers.cloneTo(_qualifiers);  
 }  
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.29  
changed lines
  Added in v.1.36.2.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2