(file) Return to MetaTypes.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Repository / Attic

Diff for /pegasus/src/Pegasus/Repository/Attic/MetaTypes.cpp between version 1.1.2.2 and 1.1.2.3

version 1.1.2.2, 2007/10/02 17:27:10 version 1.1.2.3, 2007/10/03 22:45:52
Line 39 
Line 39 
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 static const size_t _MAX_FEATURES = 1024;  
 static const size_t _MAX_QUALIFIERS = 1024; static const size_t _MAX_QUALIFIERS = 1024;
  
 static bool _eqi(const char* s1, const char* s2) static bool _eqi(const char* s1, const char* s2)
Line 290 
Line 289 
             }             }
  
             default:             default:
                 printf("T[%u]\n", __LINE__);  
                 return -1;                 return -1;
         }         }
     }     }
Line 503 
Line 501 
             }             }
  
             default:             default:
                 printf("T[%u]\n", __LINE__);  
                 return -1;                 return -1;
         }         }
     }     }
  
     // Unreachable!     // Unreachable!
     printf("T[%u]\n", __LINE__);  
     return -1;     return -1;
 } }
  
 struct FeatureInfo  int MergeFeatures(
 {  
     const MetaFeature* mf;  
     const MetaClass* mc;  
 };  
   
 static int _mergeFeatures(  
     const MetaClass* mc,     const MetaClass* mc,
     bool localOnly,     bool localOnly,
     FeatureInfo features[_MAX_FEATURES],      Uint32 flags,
       MetaFeatureInfo features[META_MAX_FEATURES],
     size_t& numFeatures)     size_t& numFeatures)
 { {
     if (!localOnly && mc->super)     if (!localOnly && mc->super)
     {     {
         if (_mergeFeatures(mc->super, localOnly, features, numFeatures) != 0)          if (MergeFeatures(
               mc->super, localOnly, 0xFFFFFFFF, features, numFeatures) != 0)
         {         {
             printf("T[%u]\n", __LINE__);  
             return -1;             return -1;
         }         }
     }     }
Line 540 
Line 531 
     {     {
         const MetaFeature* mf = mc->features[i];         const MetaFeature* mf = mc->features[i];
  
           if (!(mf->flags & flags))
               continue;
   
         // Override feature if defined by ancestor class:         // Override feature if defined by ancestor class:
  
         bool found = false;         bool found = false;
Line 561 
Line 555 
  
         if (!found)         if (!found)
         {         {
             if (numFeatures == _MAX_FEATURES)              if (numFeatures == META_MAX_FEATURES)
             {             {
                 printf("T[%u]\n", __LINE__);  
                 return -1;                 return -1;
             }             }
  
Line 701 
Line 694 
             {             {
                 if (numQualifiers == _MAX_QUALIFIERS)                 if (numQualifiers == _MAX_QUALIFIERS)
                 {                 {
                     printf("T[%u]\n", __LINE__);  
                     return -1;                     return -1;
                 }                 }
  
Line 729 
Line 721 
     if (_mergeQualifiers(     if (_mergeQualifiers(
         ns, mc, featureName, parameterName, 0, qualifiers, numQualifiers) != 0)         ns, mc, featureName, parameterName, 0, qualifiers, numQualifiers) != 0)
     {     {
         printf("T[%u]\n", __LINE__);  
         return -1;         return -1;
     }     }
  
Line 753 
Line 744 
  
         if (_makeValue(cv, qd->type, qd->subscript, q + 1) != 0)         if (_makeValue(cv, qd->type, qd->subscript, q + 1) != 0)
         {         {
             printf("T[%u]\n", __LINE__);  
             return -1;             return -1;
         }         }
  
Line 781 
Line 771 
  
     if (_makeValue(cv, mp->type, mp->subscript, mp->value) != 0)     if (_makeValue(cv, mp->type, mp->subscript, mp->value) != 0)
     {     {
         printf("T[%u]\n", __LINE__);  
         return -1;         return -1;
     }     }
  
Line 800 
Line 789 
     {     {
         if (_addQualifiers(ns, mc, mp->name, 0, cp) != 0)         if (_addQualifiers(ns, mc, mp->name, 0, cp) != 0)
         {         {
             printf("T[%u]\n", __LINE__);  
             return -1;             return -1;
         }         }
     }     }
Line 860 
Line 848 
     {     {
         if (_addQualifiers(ns, mc, mr->name, 0, cp) != 0)         if (_addQualifiers(ns, mc, mr->name, 0, cp) != 0)
         {         {
             printf("T[%u]\n", __LINE__);  
             return -1;             return -1;
         }         }
     }     }
Line 903 
Line 890 
     {     {
         if (_addQualifiers(ns, mc, mm->name, mp->name, cm) != 0)         if (_addQualifiers(ns, mc, mm->name, mp->name, cm) != 0)
         {         {
             printf("T[%u]\n", __LINE__);  
             return -1;             return -1;
         }         }
     }     }
Line 947 
Line 933 
     {     {
         if (_addQualifiers(ns, mc, mm->name, mr->name, cm) != 0)         if (_addQualifiers(ns, mc, mm->name, mr->name, cm) != 0)
         {         {
             printf("T[%u]\n", __LINE__);  
             return -1;             return -1;
         }         }
     }     }
Line 1001 
Line 986 
     {     {
         if (_addQualifiers(ns, mc, mm->name, 0, cm) != 0)         if (_addQualifiers(ns, mc, mm->name, 0, cm) != 0)
         {         {
             printf("T[%u]\n", __LINE__);  
             return -1;             return -1;
         }         }
     }     }
Line 1034 
Line 1018 
 { {
     // Merge features from all inheritance levels into a single array:     // Merge features from all inheritance levels into a single array:
  
     FeatureInfo features[_MAX_FEATURES];      MetaFeatureInfo features[META_MAX_FEATURES];
     size_t numFeatures = 0;     size_t numFeatures = 0;
  
     if (_mergeFeatures(mc, localOnly, features, numFeatures) != 0)      if (MergeFeatures(mc, localOnly, 0xFFFFFFFF, features, numFeatures) != 0)
     {     {
         printf("T[%u]\n", __LINE__);  
         return -1;         return -1;
     }     }
  
Line 1047 
Line 1030 
  
     for (size_t i = 0; i < numFeatures; i++)     for (size_t i = 0; i < numFeatures; i++)
     {     {
         const FeatureInfo& fi = features[i];          const MetaFeatureInfo& fi = features[i];
  
         // Set propagated flag:         // Set propagated flag:
  
Line 1073 
Line 1056 
             if (_addProperty(ns, mc, mp, classOrigin, propagated,             if (_addProperty(ns, mc, mp, classOrigin, propagated,
                 includeQualifiers, includeClassOrigin, cc) != 0)                 includeQualifiers, includeClassOrigin, cc) != 0)
             {             {
                 printf("T[%u]\n", __LINE__);  
                 return -1;                 return -1;
             }             }
         }         }
Line 1084 
Line 1066 
             if (_addReference(ns, mc, mr, classOrigin, propagated,             if (_addReference(ns, mc, mr, classOrigin, propagated,
                 includeQualifiers, includeClassOrigin, cc) != 0)                 includeQualifiers, includeClassOrigin, cc) != 0)
             {             {
                 printf("T[%u]\n", __LINE__);  
                 return -1;                 return -1;
             }             }
         }         }
Line 1095 
Line 1076 
             if (_addMethod(ns, mc, mm, classOrigin, propagated,             if (_addMethod(ns, mc, mm, classOrigin, propagated,
                 includeQualifiers, includeClassOrigin, cc) != 0)                 includeQualifiers, includeClassOrigin, cc) != 0)
             {             {
                 printf("T[%u]\n", __LINE__);  
                 return -1;                 return -1;
             }             }
         }         }
Line 1105 
Line 1085 
 } }
  
 int MakeClass( int MakeClass(
       const char* hostName,
     const MetaNameSpace* ns,     const MetaNameSpace* ns,
     const MetaClass* mc,     const MetaClass* mc,
     Boolean localOnly,     Boolean localOnly,
Line 1131 
Line 1112 
         {         {
             if (_addQualifiers(ns, mc, 0, 0, cc) != 0)             if (_addQualifiers(ns, mc, 0, 0, cc) != 0)
             {             {
                 printf("T[%u]\n", __LINE__);  
                 return -1;                 return -1;
             }             }
         }         }
Line 1141 
Line 1121 
         if (_addFeatures(ns, mc, localOnly, includeQualifiers,         if (_addFeatures(ns, mc, localOnly, includeQualifiers,
             includeClassOrigin, propertyList, cc) != 0)             includeClassOrigin, propertyList, cc) != 0)
         {         {
             printf("T[%u]\n", __LINE__);  
             return -1;             return -1;
         }         }
   
           // Object path:
   
           cc.setPath(CIMObjectPath(hostName, ns->name, mc->name));
     }     }
     catch (Exception& e)     catch (Exception& e)
     {     {
Line 1152 
Line 1135 
     }     }
     catch (...)     catch (...)
     {     {
         printf("T[%u]\n", __LINE__);  
         return -1;         return -1;
     }     }
  
Line 1170 
Line 1152 
  
     if (_makeValue(cv, mqd->type, mqd->subscript, mqd->value) != 0)     if (_makeValue(cv, mqd->type, mqd->subscript, mqd->value) != 0)
     {     {
         printf("T[%u]\n", __LINE__);  
         return -1;         return -1;
     }     }
  
Line 1224 
Line 1205 
     return 0;     return 0;
 } }
  
   const MetaClass* FindClass(const MetaNameSpace* ns, const char* name)
   {
       for (size_t i = 0; ns->classes[i]; i++)
       {
           const MetaClass* mc = ns->classes[i];
   
           if (_eqi(mc->name, name))
               return mc;
       }
   
       // Not found!
       return 0;
   }
   
   const MetaQualifierDecl* FindQualifierDecl(
       const MetaNameSpace* ns,
       const char* name)
   {
       for (size_t i = 0; ns->classes[i]; i++)
       {
           const MetaQualifierDecl* mqd = ns->qualifiers[i];
   
           if (_eqi(mqd->name, name))
               return mqd;
       }
   
       // Not found!
       return 0;
   }
   
   bool IsSubClass(const MetaClass* super, const MetaClass* sub)
   {
       if (!super)
           return true;
   
       for (MetaClass* p = sub->super; p; p = p->super)
       {
           if (p == super)
               return true;
       }
   
       return false;
   }
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2