(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.62 and 1.71.2.1

version 1.62, 2004/10/07 13:51:08 version 1.71.2.1, 2006/02/10 16:09:33
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // 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.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec 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 29 
Line 35 
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 //              Carol Ann Krug Graves, Hewlett-Packard Company //              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 43 
Line 51 
 #include "MofWriter.h" #include "MofWriter.h"
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
 #include <Pegasus/Common/MessageLoader.h> //l10n #include <Pegasus/Common/MessageLoader.h> //l10n
   #include "CIMNameUnchecked.h"
   #include "StrLit.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
 PEGASUS_USING_STD; PEGASUS_USING_STD;
Line 125 
Line 135 
         throw TypeMismatchException();         throw TypeMismatchException();
     }     }
  
     // Set the class origin:  
     // ATTN: put this check in other places:  
   
     if (x.getClassOrigin().isNull())  
         CIMProperty(x).setClassOrigin(_reference.getClassName());  
   
     // Add the property:     // Add the property:
  
     _properties.append(x);     _properties.append(x);
Line 247 
Line 251 
                 {                 {
                         CIMProperty& property = _properties[i];                         CIMProperty& property = _properties[i];
  
             if(property.getValue().getType() == CIMTYPE_REFERENCE)              if(!isAssociationClass &&
             {                 property.getValue().getType() == CIMTYPE_REFERENCE)
                         if (!isAssociationClass)  
                         {                         {
                                 //l10n                                 //l10n
                             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER,                             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER,
Line 258 
Line 261 
                                                 MessageLoaderParms("Common.CIMClassRep.NON_ASSOCIATION_CLASS_CONTAINS_REFERENCE_PROPERTY",                                                 MessageLoaderParms("Common.CIMClassRep.NON_ASSOCIATION_CLASS_CONTAINS_REFERENCE_PROPERTY",
                                                                                    "Non-assocation class contains reference property"));                                                                                    "Non-assocation class contains reference property"));
  
                         }  
                         if(property.getReferenceClassName().isNull())  
                         {  
                             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_INVALID_PARAMETER,  
                                 MessageLoaderParms("Common.CIMClassRep.REFERENCE_PROPERTY_MISSING_REFERENCE_CLASS_NAME",  
                                                                                    "Reference Property for CIMClass Definition missing ReferenceClass Name"));  
                         }  
             }             }
  
  
Line 274 
Line 271 
                         {                         {
                             Resolver::resolveProperty (property, context,                             Resolver::resolveProperty (property, context,
                                 nameSpace, false, true);                                 nameSpace, false, true);
                               if (property.getClassOrigin().isNull())
                               {
                                   property.setClassOrigin(getClassName());
                               }
                               property.setPropagated(false);
                         }                         }
                         else                         else
                         {                         {
Line 281 
Line 283 
                                 superClass.getProperty(index);                                 superClass.getProperty(index);
                             Resolver::resolveProperty (property, context,                             Resolver::resolveProperty (property, context,
                                 nameSpace, false, superClassProperty, true);                                 nameSpace, false, superClassProperty, true);
                               if (property.getClassOrigin().isNull())
                               {
                                   property.setClassOrigin(
                                       superClassProperty.getClassOrigin());
                               }
                         }                         }
                 }                 }
  
Line 459 
Line 466 
                 //cout << "KSTEST Class Resolve, No Super class " << getClassName() << endl;                 //cout << "KSTEST Class Resolve, No Super class " << getClassName() << endl;
  
                 for (Uint32 i = 0, n = _properties.size(); i < n; i++)                 for (Uint32 i = 0, n = _properties.size(); i < n; i++)
                   {
                     Resolver::resolveProperty (_properties[i], context,                     Resolver::resolveProperty (_properties[i], context,
                         nameSpace, false, true);                         nameSpace, false, true);
                       _properties[i].setClassOrigin(getClassName());
                       _properties[i].setPropagated(false);
                   }
  
                 //----------------------------------------------------------------------                 //----------------------------------------------------------------------
                 // Resolve each method:                 // Resolve each method:
Line 533 
Line 544 
     return(newInstance);     return(newInstance);
 } }
  
 void CIMClassRep::toXml(Array<Sint8>& out) const  void CIMClassRep::toXml(Buffer& out) const
 { {
     // Class opening element:     // Class opening element:
  
     out << "<CLASS ";      out << STRLIT("<CLASS ");
     out << " NAME=\"" << _reference.getClassName() << "\" ";      out << STRLIT(" NAME=\"") << _reference.getClassName() << STRLIT("\" ");
  
     if (!_superClassName.isNull())     if (!_superClassName.isNull())
         out << " SUPERCLASS=\"" << _superClassName << "\" ";          out << STRLIT(" SUPERCLASS=\"") << _superClassName << STRLIT("\" ");
  
     out << ">\n";      out << STRLIT(">\n");
  
     // Qualifiers:     // Qualifiers:
  
Line 561 
Line 572 
  
     // Class closing element:     // Class closing element:
  
     out << "</CLASS>\n";      out << STRLIT("</CLASS>\n");
 } }
 /** toMof prepares an 8-bit string with the MOF for the class. /** toMof prepares an 8-bit string with the MOF for the class.
     The BNF for this is:     The BNF for this is:
Line 576 
Line 587 
  
 */ */
  
 void CIMClassRep::toMof(Array<Sint8>& out) const  void CIMClassRep::toMof(Buffer& out) const
 { {
     // Get and format the class qualifiers     // Get and format the class qualifiers
     out << "\n//    Class " << _reference.getClassName();      out << STRLIT("\n//    Class ") << _reference.getClassName();
     if (_qualifiers.getCount())     if (_qualifiers.getCount())
         out << "\n";          out.append('\n');
     out << "\n";      out.append('\n');
     _qualifiers.toMof(out);     _qualifiers.toMof(out);
  
     // Separate qualifiers from Class Name     // Separate qualifiers from Class Name
     out << "\n";      out.append('\n');
  
     // output class statement     // output class statement
     out << "class " << _reference.getClassName();      out << STRLIT("class ") << _reference.getClassName();
  
     if (!_superClassName.isNull())     if (!_superClassName.isNull())
         out << " : " << _superClassName;          out << STRLIT(" : ") << _superClassName;
  
     out << "\n{";      out << STRLIT("\n{");
  
     // format the Properties:     // format the Properties:
     for (Uint32 i = 0, n = _properties.size(); i < n; i++)     for (Uint32 i = 0, n = _properties.size(); i < n; i++)
Line 615 
Line 626 
     }     }
  
     // Class closing element:     // Class closing element:
     out << "\n};\n";      out << STRLIT("\n};\n");
 } }
  
  
Line 684 
Line 695 
         CIMConstProperty property = getProperty(i);         CIMConstProperty property = getProperty(i);
  
         Uint32 index;         Uint32 index;
         if ((index = property.findQualifier (CIMName ("key"))) != PEG_NOT_FOUND)          if ((index = property.findQualifier(
               CIMNameUnchecked("key"))) != PEG_NOT_FOUND)
         {         {
             CIMValue value;             CIMValue value;
             value = property.getQualifier (index).getValue ();             value = property.getQualifier (index).getValue ();
Line 706 
Line 718 
         CIMConstProperty property = getProperty(i);         CIMConstProperty property = getProperty(i);
  
         Uint32 index;         Uint32 index;
         if ((index = property.findQualifier (CIMName ("key"))) != PEG_NOT_FOUND)          if ((index = property.findQualifier(
               CIMNameUnchecked("key"))) != PEG_NOT_FOUND)
         {         {
             CIMValue value;             CIMValue value;
             value = property.getQualifier (index).getValue ();             value = property.getQualifier (index).getValue ();


Legend:
Removed from v.1.62  
changed lines
  Added in v.1.71.2.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2