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

Diff for /pegasus/src/Pegasus/Common/CIMQualifierList.cpp between version 1.27 and 1.33

version 1.27, 2002/03/28 02:57:54 version 1.33, 2002/05/15 10:34:30
Line 32 
Line 32 
 #include "CIMName.h" #include "CIMName.h"
 #include "Indentor.h" #include "Indentor.h"
 #include "XmlWriter.h" #include "XmlWriter.h"
   #include <Pegasus/Common/Tracer.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
 PEGASUS_USING_STD; PEGASUS_USING_STD;
Line 48 
Line 49 
  
 CIMQualifierList& CIMQualifierList::add(const CIMQualifier& qualifier) CIMQualifierList& CIMQualifierList::add(const CIMQualifier& qualifier)
 { {
     if (!qualifier)      if (qualifier.isNull())
         throw UnitializedHandle();          throw UninitializedHandle();
  
     if (find(qualifier.getName()) != PEG_NOT_FOUND)     if (find(qualifier.getName()) != PEG_NOT_FOUND)
         throw AlreadyExists();         throw AlreadyExists();
Line 80 
Line 81 
  
     return PEG_NOT_FOUND;     return PEG_NOT_FOUND;
 } }
   Boolean CIMQualifierList::isTrue(const String& name) const
   {
       Uint32 pos = find(name);
   
       if (pos == PEG_NOT_FOUND)
           return false;
   
       Boolean flag;
       const CIMValue& value = getQualifier(pos).getValue();
   
       if (value.getType() != CIMType::BOOLEAN)
           return false;
   
       value.get(flag);
       return flag;
   }
  
 Uint32 CIMQualifierList::findReverse(const String& name) const Uint32 CIMQualifierList::findReverse(const String& name) const
 { {
Line 100 
Line 117 
     CIMQualifierList& inheritedQualifiers,     CIMQualifierList& inheritedQualifiers,
     Boolean propagateQualifiers)        // Apparently not used ks 24 mar 2002     Boolean propagateQualifiers)        // Apparently not used ks 24 mar 2002
 { {
       PEG_METHOD_ENTER(TRC_OBJECTRESOLUTION, "CIMQualifierList::resolve()");
     // For each qualifier in the qualifiers array, the following     // For each qualifier in the qualifiers array, the following
     // is checked:     // is checked:
     //     //
Line 127 
Line 145 
                 CIMQualifierDecl qd = declContext->lookupQualifierDecl(                 CIMQualifierDecl qd = declContext->lookupQualifierDecl(
                         nameSpace, q.getName());                         nameSpace, q.getName());
  
                 if (!qd)                  if (qd.isNull())
                         throw UndeclaredQualifier(q.getName());                         throw UndeclaredQualifier(q.getName());
  
                 //----------------------------------------------------------------------                 //----------------------------------------------------------------------
Line 156 
Line 174 
                 // against the declaration. If the flavor is disableoverride and tosubclass                 // against the declaration. If the flavor is disableoverride and tosubclass
                 // the resolved qualifier value must be identical to the original                 // the resolved qualifier value must be identical to the original
                 //----------------------------------------------------------------------                 //----------------------------------------------------------------------
   
   
                 // Test for Qualifier found in SuperClass. If found and qualifier                 // Test for Qualifier found in SuperClass. If found and qualifier
                 // is not overridable.                 // is not overridable.
                 // Abstract (not Overridable and restricted) can be found in subclasses                 // Abstract (not Overridable and restricted) can be found in subclasses
Line 177 
Line 193 
                 // characteristics (value, type, flavor, etc.) This also leaves the question                 // characteristics (value, type, flavor, etc.) This also leaves the question
                 // of NULL or no values.  The implication is that we must move the value                 // of NULL or no values.  The implication is that we must move the value
                 // from the superclass or declaration.                 // from the superclass or declaration.
                 //  
   
  
                 Uint32 pos = inheritedQualifiers.find(q.getName());                 Uint32 pos = inheritedQualifiers.find(q.getName());
  
Line 198 
Line 212 
                                         << " decl flavor " << qd.getFlavor() << " Flavor " << q.getFlavor()                                         << " decl flavor " << qd.getFlavor() << " Flavor " << q.getFlavor()
                                         << " Not override " << !qd.isFlavor(CIMFlavor::OVERRIDABLE)                                         << " Not override " << !qd.isFlavor(CIMFlavor::OVERRIDABLE)
                                         << " tosubclass " <<  qd.isFlavor(CIMFlavor::TOSUBCLASS) << endl;                                         << " tosubclass " <<  qd.isFlavor(CIMFlavor::TOSUBCLASS) << endl;
                                 qd.print(); q.print();                                  XmlWriter::printQualifierDeclElement(qd);
                                   XmlWriter::printQualifierElement(q);
                                         //throw BadQualifierOverride(q.getName());                                         //throw BadQualifierOverride(q.getName());
                         }                         }
                         //cout <<  qd.getFlavor() << endl;*/                         //cout <<  qd.getFlavor() << endl;*/
Line 212 
Line 227 
                                 << " decl flavor " << qd.getFlavor() << " Flavor " << q.getFlavor()                                 << " decl flavor " << qd.getFlavor() << " Flavor " << q.getFlavor()
                                 << " Not override " << !qd.isFlavor(CIMFlavor::OVERRIDABLE)                                 << " Not override " << !qd.isFlavor(CIMFlavor::OVERRIDABLE)
                                 << " tosubclass " <<  qd.isFlavor(CIMFlavor::TOSUBCLASS) << endl;                                 << " tosubclass " <<  qd.isFlavor(CIMFlavor::TOSUBCLASS) << endl;
                          qd.print(); q.print(); */                           XmlWriter::printQualifierDeclElement(qd);
                            XmlWriter::printQualifierElement(q); */
                 }                 }
                 else                    // qualifier exists in superclass                 else                    // qualifier exists in superclass
                 {       ////// Make Const again                 {       ////// Make Const again
Line 229 
Line 245 
                                         << "   Superclass flavor " << iq.getFlavor()                                         << "   Superclass flavor " << iq.getFlavor()
                                         << " Flavor " << q.getFlavor()                                         << " Flavor " << q.getFlavor()
                                         << endl;                                         << endl;
                                 iq.print(); q.print();*/                                  XmlWriter::printQualifierElement(iq);
                                   XmlWriter::printQualifierElement(q); */
                                 // test if values the same.                                 // test if values the same.
                                 CIMValue qv = q.getValue();                                 CIMValue qv = q.getValue();
                                 CIMValue iqv = iq.getValue();                                 CIMValue iqv = iq.getValue();
Line 246 
Line 263 
     // Propagate qualifiers to subclass or to instance that do not have     // Propagate qualifiers to subclass or to instance that do not have
     // already have those qualifiers:     // already have those qualifiers:
     //--------------------------------------------------------------------------     //--------------------------------------------------------------------------
         //cout << "KSTEST. Loop of inherited qualifiers. Number = "      //cout << "KSTEST. Inherited qualifiers ct = " << inheritedQualifiers.getCount() << endl;
         //      << inheritedQualifiers.getCount() << endl;  
  
     for (Uint32 i = 0, n = inheritedQualifiers.getCount(); i < n; i++)     for (Uint32 i = 0, n = inheritedQualifiers.getCount(); i < n; i++)
     {     {
Line 255 
Line 271 
                         //cout << "KSTEST inherited qualifier propagate loop " <<  iq.getName()                         //cout << "KSTEST inherited qualifier propagate loop " <<  iq.getName()
                         //<< " flavor " << iq.getFlavor << " count " << i << endl;                         //<< " flavor " << iq.getFlavor << " count " << i << endl;
  
                         // ATTN-DE-P1-This next test is incorrect. It is a temporary, hard-coded  
                         // HACK to avoid propagating the "Abstract" Qualifier to subclasses  
                 //if (CIMName::equal(iq.getName(), "Abstract"))  
                         //   continue;  
                 //<< " flavor= " << iq.getFlavor()  
                 //<< " TOSUBCLASS " << (iq.getFlavor() && CIMFlavor::TOSUBCLASS) << endl;  
   
                 if (isInstancePart)                 if (isInstancePart)
                 {                 {
                         if (!iq.isFlavor(CIMFlavor::TOINSTANCE))                         if (!iq.isFlavor(CIMFlavor::TOINSTANCE))
Line 290 
Line 299 
 void CIMQualifierList::toXml(Array<Sint8>& out) const void CIMQualifierList::toXml(Array<Sint8>& out) const
 { {
     for (Uint32 i = 0, n = _qualifiers.size(); i < n; i++)     for (Uint32 i = 0, n = _qualifiers.size(); i < n; i++)
         _qualifiers[i].toXml(out);          XmlWriter::appendQualifierElement(out, _qualifiers[i]);
 } }
  
 /** toMof - Generates MOF output for a list of CIM Qualifiers. /** toMof - Generates MOF output for a list of CIM Qualifiers.


Legend:
Removed from v.1.27  
changed lines
  Added in v.1.33

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2