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

Diff for /pegasus/src/Pegasus/Repository/CIMRepositoryMRR.cpp between version 1.7.6.1 and 1.7.6.2

version 1.7.6.1, 2013/06/03 22:36:27 version 1.7.6.2, 2014/03/12 22:35:05
Line 29 
Line 29 
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
   /**
    * This file redefines the CIMRepository.h interfaces to be a
    * read-only memory-resident  class repository and an in-memory instance
    * repository. It implements all functions of the
    * CIMRepository.h interface. All  class functions that would
    * modify the repository return exceptions since the repository is read-only.
    * Functions that return data (ex. getClass, enumerateClasses, etc.) return
    * the same form of data as the other repository implementations.
    *
    * NOTE: This repository does NOT implement a cache because it
    * appeared that it would be of little gain since the movement
    * of data from the in-memory repository is already fast.
    * Therefore there are some parameters of the API (Ex clone)
    * that are not implemented.
    *
    * The class repository is actually a .CPP/.h file that is
    * produced by the MOF compiler from input mof files. This file
    * includes the definition of all namespaces, qualifiers, and
    * classes defined as part of the mof input.
    *
    * The instance repository is an in-memory repository that
    * includes functions to load the instance repository on startup
    * and checkpoint the instance repository each time a change is
    * made
    *
    * See PEP 307 for more information on the implementation and
    * usage of the memory-resident repository.
    */
   
 #include "MRR.h" #include "MRR.h"
 #include <cstdarg> #include <cstdarg>
 #include <Pegasus/Common/Resolver.h> #include <Pegasus/Common/Resolver.h>
Line 131 
Line 160 
     @return true if the property is in the list otherwise false.     @return true if the property is in the list otherwise false.
 */ */
 static Boolean _containsProperty( static Boolean _containsProperty(
     CIMProperty& property,      const CIMProperty& property,
     const CIMPropertyList& propertyList)     const CIMPropertyList& propertyList)
 { {
     //  For each property in the propertly list     //  For each property in the propertly list
     for (Uint32 p=0; p<propertyList.size(); p++)     for (Uint32 p=0; p<propertyList.size(); p++)
     {     {
         if (propertyList[p].equal(property.getName()))         if (propertyList[p].equal(property.getName()))
           {
             return true;             return true;
     }     }
       }
     return false;     return false;
 } }
  
Line 156 
Line 187 
     // remove qualifiers of the class     // remove qualifiers of the class
     Uint32 count = 0;     Uint32 count = 0;
     while ((count = cimClass.getQualifierCount()) > 0)     while ((count = cimClass.getQualifierCount()) > 0)
       {
         cimClass.removeQualifier(count - 1);         cimClass.removeQualifier(count - 1);
       }
  
     // remove qualifiers from the properties     // remove qualifiers from the properties
     for (Uint32 i = 0; i < cimClass.getPropertyCount(); i++)     for (Uint32 i = 0; i < cimClass.getPropertyCount(); i++)
Line 164 
Line 197 
         CIMProperty p = cimClass.getProperty(i);         CIMProperty p = cimClass.getProperty(i);
         count = 0;         count = 0;
         while ((count = p.getQualifierCount()) > 0)         while ((count = p.getQualifierCount()) > 0)
           {
             p.removeQualifier(count - 1);             p.removeQualifier(count - 1);
     }     }
       }
  
     // remove qualifiers from the methods     // remove qualifiers from the methods
     for (Uint32 i = 0; i < cimClass.getMethodCount(); i++)     for (Uint32 i = 0; i < cimClass.getMethodCount(); i++)
Line 176 
Line 211 
             CIMParameter p = m.getParameter(j);             CIMParameter p = m.getParameter(j);
             count = 0;             count = 0;
             while ((count = p.getQualifierCount()) > 0)             while ((count = p.getQualifierCount()) > 0)
               {
                 p.removeQualifier(count - 1);                 p.removeQualifier(count - 1);
         }         }
           }
         count = 0;         count = 0;
         while ((count = m.getQualifierCount()) > 0)         while ((count = m.getQualifierCount()) > 0)
           {
             m.removeQualifier(count - 1);             m.removeQualifier(count - 1);
     }     }
 } }
   }
  
 ///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
 // //
Line 279 
Line 318 
             // Since the propertyList is not NULL, only properties in the list             // Since the propertyList is not NULL, only properties in the list
             // should be included in the instance.             // should be included in the instance.
             if (!_containsProperty(cimInstance.getProperty(i), propertyList))             if (!_containsProperty(cimInstance.getProperty(i), propertyList))
               {
                 cimInstance.removeProperty(i);                 cimInstance.removeProperty(i);
         }         }
     }     }
 } }
   }
  
 /* remove all Qualifiers from a single CIMInstance. Removes /* remove all Qualifiers from a single CIMInstance. Removes
     all of the qualifiers from the instance and from properties     all of the qualifiers from the instance and from properties
Line 296 
Line 337 
     // remove qualifiers from the instance     // remove qualifiers from the instance
     Uint32 count = 0;     Uint32 count = 0;
     while ((count = cimInstance.getQualifierCount()) > 0)     while ((count = cimInstance.getQualifierCount()) > 0)
       {
         cimInstance.removeQualifier(count - 1);         cimInstance.removeQualifier(count - 1);
       }
  
     // remove qualifiers from the properties     // remove qualifiers from the properties
     for (Uint32 i = 0; i < cimInstance.getPropertyCount(); i++)     for (Uint32 i = 0; i < cimInstance.getPropertyCount(); i++)
Line 304 
Line 347 
         CIMProperty p = cimInstance.getProperty(i);         CIMProperty p = cimInstance.getProperty(i);
         count = 0;         count = 0;
         while ((count = p.getQualifierCount()) > 0)         while ((count = p.getQualifierCount()) > 0)
           {
             p.removeQualifier(count - 1);             p.removeQualifier(count - 1);
     }     }
 } }
   }
  
 /* removes all ClassOrigin attributes from a single CIMInstance. Removes /* removes all ClassOrigin attributes from a single CIMInstance. Removes
     the classOrigin attribute from each property in the Instance.     the classOrigin attribute from each property in the Instance.
Line 320 
Line 365 
  
     Uint32 propertyCount = cimInstance.getPropertyCount();     Uint32 propertyCount = cimInstance.getPropertyCount();
     for (Uint32 i = 0; i < propertyCount ; i++)     for (Uint32 i = 0; i < propertyCount ; i++)
       {
         cimInstance.getProperty(i).setClassOrigin(CIMName());         cimInstance.getProperty(i).setClassOrigin(CIMName());
 } }
   }
  
 /* Filters the properties, qualifiers, and classorigin out of a single instance. /* Filters the properties, qualifiers, and classorigin out of a single instance.
     Based on the parameters provided for propertyList, includeQualifiers,     Based on the parameters provided for propertyList, includeQualifiers,
Line 440 
Line 487 
  
         Uint32 propertyCount = cimClass.getPropertyCount();         Uint32 propertyCount = cimClass.getPropertyCount();
         for (Uint32 i = 0; i < propertyCount ; i++)         for (Uint32 i = 0; i < propertyCount ; i++)
           {
             cimClass.getProperty(i).setClassOrigin(CIMName());             cimClass.getProperty(i).setClassOrigin(CIMName());
           }
  
         Uint32 methodCount =  cimClass.getMethodCount();         Uint32 methodCount =  cimClass.getMethodCount();
         for (Uint32 i=0; i < methodCount ; i++)         for (Uint32 i=0; i < methodCount ; i++)
           {
             cimClass.getMethod(i).setClassOrigin(CIMName());             cimClass.getMethod(i).setClassOrigin(CIMName());
     }     }
 } }
   }
  
  
 static bool _contains(const CIMPropertyList& propertyList, const CIMName& name) static bool _contains(const CIMPropertyList& propertyList, const CIMName& name)
Line 454 
Line 505 
     for (Uint32 i = 0; i < propertyList.size(); i++)     for (Uint32 i = 0; i < propertyList.size(); i++)
     {     {
         if (propertyList[i] == name)         if (propertyList[i] == name)
           {
             return true;             return true;
     }     }
       }
  
     return false;     return false;
 } }
Line 499 
Line 552 
             // Add or replace property in result instance:             // Add or replace property in result instance:
  
             if (pos != PEG_NOT_FOUND)             if (pos != PEG_NOT_FOUND)
               {
                 resultInstance.removeProperty(pos);                 resultInstance.removeProperty(pos);
               }
  
             resultInstance.addProperty(cp);             resultInstance.addProperty(cp);
         }         }
Line 540 
Line 595 
         const MRRNameSpace* ns = _nameSpaceTable[i];         const MRRNameSpace* ns = _nameSpaceTable[i];
  
         if (_eqi(ns->name, name))         if (_eqi(ns->name, name))
           {
             return ns;             return ns;
     }     }
       }
  
     // Not found!     // Not found!
     return 0;     return 0;
Line 550 
Line 607 
 static bool _isSubClass(const MRRClass* super, const MRRClass* sub) static bool _isSubClass(const MRRClass* super, const MRRClass* sub)
 { {
     if (!super)     if (!super)
       {
         return true;         return true;
       }
  
     for (MRRClass* p = sub->super; p; p = p->super)     for (MRRClass* p = sub->super; p; p = p->super)
     {     {
         if (p == super)         if (p == super)
           {
             return true;             return true;
     }     }
       }
  
     return false;     return false;
 } }
Line 571 
Line 632 
 static char** _makePropertyList(const CIMPropertyList& propertyList) static char** _makePropertyList(const CIMPropertyList& propertyList)
 { {
     if (propertyList.isNull())     if (propertyList.isNull())
       {
         return 0;         return 0;
       }
  
     size_t size = propertyList.size();     size_t size = propertyList.size();
     char** pl = (char**)malloc(sizeof(char*) * (size + 1));     char** pl = (char**)malloc(sizeof(char*) * (size + 1));
  
     for (size_t i = 0; i < size; i++)     for (size_t i = 0; i < size; i++)
       {
         pl[i] = strdup(*Str(propertyList[i]));         pl[i] = strdup(*Str(propertyList[i]));
       }
  
     pl[size] = 0;     pl[size] = 0;
  
Line 587 
Line 652 
 static void _freePropertyList(char** pl) static void _freePropertyList(char** pl)
 { {
     if (!pl)     if (!pl)
       {
         return;         return;
       }
  
     for (size_t i = 0; pl[i]; i++)     for (size_t i = 0; pl[i]; i++)
     {     {
Line 600 
Line 667 
 static void _printPropertyList(const char* const* pl) static void _printPropertyList(const char* const* pl)
 { {
     if (!pl)     if (!pl)
       {
         return;         return;
       }
  
     for (size_t i = 0; pl[i]; i++)     for (size_t i = 0; pl[i]; i++)
       {
         printf("pl[%s]\n", pl[i]);         printf("pl[%s]\n", pl[i]);
 } }
   }
  
 static bool _contains(const Array<const MRRClass*>& x, const MRRClass* sc) static bool _contains(const Array<const MRRClass*>& x, const MRRClass* sc)
 { {
Line 614 
Line 685 
     while (n--)     while (n--)
     {     {
         if (*p++ == sc)         if (*p++ == sc)
           {
             return true;             return true;
     }     }
       }
  
     return false;     return false;
 } }
Line 634 
Line 707 
     const MRRClass* sc = FindClass(ns, *Str(className));     const MRRClass* sc = FindClass(ns, *Str(className));
  
     if (!sc)     if (!sc)
       {
         Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(className)));         Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(className)));
       }
  
  
     // Lookup result class (if any).     // Lookup result class (if any).
Line 646 
Line 721 
         rmc = FindClass(ns, *Str(resultClass));         rmc = FindClass(ns, *Str(resultClass));
  
         if (!rmc)         if (!rmc)
           {
             Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(resultClass)));             Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(resultClass)));
     }     }
       }
  
     // Convert these to UTF8 now to avoid doing so in loop below.     // Convert these to UTF8 now to avoid doing so in loop below.
  
Line 664 
Line 741 
         // Skip non-association classes:         // Skip non-association classes:
  
         if (!(amc->flags & MRR_FLAG_ASSOCIATION))         if (!(amc->flags & MRR_FLAG_ASSOCIATION))
           {
             continue;             continue;
           }
  
         // Filter by assocClass parameter:         // Filter by assocClass parameter:
  
         if (!assocClass.isNull() && !_eqi(ac, amc->name))         if (!assocClass.isNull() && !_eqi(ac, amc->name))
           {
             continue;             continue;
           }
  
         // Process reference properties:         // Process reference properties:
  
Line 684 
Line 765 
             // Skip non references:             // Skip non references:
  
             if (!(sf->flags & MRR_FLAG_REFERENCE))             if (!(sf->flags & MRR_FLAG_REFERENCE))
               {
                 continue;                 continue;
               }
  
             const MRRReference* sr = (const MRRReference*)sf;             const MRRReference* sr = (const MRRReference*)sf;
  
             // Filter by role parameter.             // Filter by role parameter.
  
             if (role.size() && !_eqi(r, sf->name))             if (role.size() && !_eqi(r, sf->name))
               {
                 continue;                 continue;
               }
  
             // Filter by source class:             // Filter by source class:
  
             if (!IsA(sr->ref, sc))             if (!IsA(sr->ref, sc))
               {
                 continue;                 continue;
               }
  
             // Process result reference:             // Process result reference:
  
Line 707 
Line 794 
                 // Skip the feature under consideration:                 // Skip the feature under consideration:
  
                 if (rmf == sf)                 if (rmf == sf)
                   {
                     continue;                     continue;
                   }
  
                 // Skip non references:                 // Skip non references:
  
                 if (!(rmf->flags & MRR_FLAG_REFERENCE))                 if (!(rmf->flags & MRR_FLAG_REFERENCE))
                   {
                     continue;                     continue;
                   }
  
                 const MRRReference* rmr = (const MRRReference*)rmf;                 const MRRReference* rmr = (const MRRReference*)rmf;
  
                 // Filter by resultRole parameter.                 // Filter by resultRole parameter.
  
                 if (resultRole.size() && !_eqi(rr, rmf->name))                 if (resultRole.size() && !_eqi(rr, rmf->name))
                   {
                     continue;                     continue;
                   }
  
                 // Skip references not of the result class kind:                 // Skip references not of the result class kind:
  
                 if (rmc && !IsA(rmr->ref, rmc))                 if (rmc && !IsA(rmr->ref, rmc))
                   {
                     continue;                     continue;
                   }
  
                 // ATTN: should we include entire class hierarchy under                 // ATTN: should we include entire class hierarchy under
                 // result class?                 // result class?
Line 732 
Line 827 
                 // If reached, then save this one.                 // If reached, then save this one.
  
                 if (!_contains(result, rmr->ref))                 if (!_contains(result, rmr->ref))
                   {
                     result.append(rmr->ref);                     result.append(rmr->ref);
             }             }
         }         }
     }     }
 } }
   }
  
 static void _references( static void _references(
     const MRRNameSpace* ns,     const MRRNameSpace* ns,
Line 750 
Line 847 
     const MRRClass* sc = FindClass(ns, *Str(className));     const MRRClass* sc = FindClass(ns, *Str(className));
  
     if (!sc)     if (!sc)
       {
         Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(className)));         Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(className)));
       }
  
     // Lookup result class (if any).     // Lookup result class (if any).
  
Line 761 
Line 860 
         rmc = FindClass(ns, *Str(resultClass));         rmc = FindClass(ns, *Str(resultClass));
  
         if (!rmc)         if (!rmc)
           {
             Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(resultClass)));             Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(resultClass)));
     }     }
       }
  
     // Convert these to UTF8 now to avoid doing so in loop below.     // Convert these to UTF8 now to avoid doing so in loop below.
  
Line 777 
Line 878 
         // Skip non-association classes:         // Skip non-association classes:
  
         if (!(amc->flags & MRR_FLAG_ASSOCIATION))         if (!(amc->flags & MRR_FLAG_ASSOCIATION))
           {
             continue;             continue;
           }
  
         // Filter by result class:         // Filter by result class:
  
         if (rmc && !IsA(rmc, amc))         if (rmc && !IsA(rmc, amc))
           {
             continue;             continue;
           }
  
         // Process reference properties:         // Process reference properties:
  
Line 797 
Line 902 
             // Skip non references:             // Skip non references:
  
             if (!(sf->flags & MRR_FLAG_REFERENCE))             if (!(sf->flags & MRR_FLAG_REFERENCE))
               {
                 continue;                 continue;
               }
  
             const MRRReference* sr = (const MRRReference*)sf;             const MRRReference* sr = (const MRRReference*)sf;
  
             // Filter by role parameter.             // Filter by role parameter.
  
             if (role.size() && !_eqi(r, sf->name))             if (role.size() && !_eqi(r, sf->name))
               {
                 continue;                 continue;
               }
  
             // Filter by source class:             // Filter by source class:
  
             if (!IsA(sr->ref, sc))             if (!IsA(sr->ref, sc))
               {
                 continue;                 continue;
               }
  
             // Add this one to the output:             // Add this one to the output:
  
             if (!_contains(result, amc))             if (!_contains(result, amc))
               {
                 result.append((MRRClass*)amc);                 result.append((MRRClass*)amc);
         }         }
     }     }
 } }
   }
  
 static const MRRClass* _findMRRClass( static const MRRClass* _findMRRClass(
     const char* nameSpace,     const char* nameSpace,
Line 828 
Line 941 
     const MRRNameSpace* ns = _findNameSpace(nameSpace);     const MRRNameSpace* ns = _findNameSpace(nameSpace);
  
     if (!ns)     if (!ns)
       {
         return 0;         return 0;
       }
  
     return FindClass(ns, className);     return FindClass(ns, className);
 } }
Line 843 
Line 958 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Lookup class:     // Lookup class:
  
Line 854 
Line 971 
         super = FindClass(ns, *Str(className));         super = FindClass(ns, *Str(className));
  
         if (!super)         if (!super)
           {
             Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(className)));             Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(className)));
     }     }
       }
  
     // Iterate all classes looking for matches:     // Iterate all classes looking for matches:
  
Line 868 
Line 987 
         if (deepInheritance)         if (deepInheritance)
         {         {
             if (_isSubClass(super, sc))             if (_isSubClass(super, sc))
               {
                 result.append(sc->name);                 result.append(sc->name);
         }         }
           }
         else         else
         {         {
             if (_isDirectSubClass(super, sc))             if (_isDirectSubClass(super, sc))
               {
                 result.append(sc->name);                 result.append(sc->name);
         }         }
     }     }
       }
  
     return result;     return result;
 } }
Line 906 
Line 1029 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Get associator schema-classes:     // Get associator schema-classes:
  
Line 951 
Line 1076 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Get associator schema-classes:     // Get associator schema-classes:
  
Line 963 
Line 1090 
     Array<CIMObjectPath> result;     Array<CIMObjectPath> result;
  
     for (Uint32 i = 0; i < mcs.size(); i++)     for (Uint32 i = 0; i < mcs.size(); i++)
       {
         result.append(CIMObjectPath(_getHostName(), nameSpace, mcs[i]->name));         result.append(CIMObjectPath(_getHostName(), nameSpace, mcs[i]->name));
       }
  
     return result;     return result;
 } }
Line 982 
Line 1111 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Get reference schema-classes:     // Get reference schema-classes:
  
Line 1025 
Line 1156 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Get reference schema-classes:     // Get reference schema-classes:
  
Line 1037 
Line 1170 
     Array<CIMObjectPath> result;     Array<CIMObjectPath> result;
  
     for (Uint32 i = 0; i < mcs.size(); i++)     for (Uint32 i = 0; i < mcs.size(); i++)
       {
         result.append(CIMObjectPath(_getHostName(), nameSpace, mcs[i]->name));         result.append(CIMObjectPath(_getHostName(), nameSpace, mcs[i]->name));
       }
  
     return result;     return result;
 } }
Line 1051 
Line 1186 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Lookup qualifier:     // Lookup qualifier:
  
     const MRRQualifierDecl* mqd = FindQualifierDecl(ns, *Str(qualifierName));     const MRRQualifierDecl* mqd = FindQualifierDecl(ns, *Str(qualifierName));
  
     if (!mqd)     if (!mqd)
       {
         Throw((CIM_ERR_NOT_FOUND,         Throw((CIM_ERR_NOT_FOUND,
             "unknown qualifier: %s", *Str(qualifierName)));             "unknown qualifier: %s", *Str(qualifierName)));
       }
  
     // Make the qualifier declaration:     // Make the qualifier declaration:
  
Line 1081 
Line 1220 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Build the array of qualifier declarations:     // Build the array of qualifier declarations:
  
Line 1129 
Line 1270 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Lookup class:     // Lookup class:
  
Line 1141 
Line 1284 
     // Append superclass names:     // Append superclass names:
  
     for (const MRRClass* p = sc->super; p; p = p->super)     for (const MRRClass* p = sc->super; p; p = p->super)
       {
         superClassNames.append(p->name);         superClassNames.append(p->name);
 } }
   }
  
 //============================================================================== //==============================================================================
 // //
Line 1195 
Line 1340 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Lookup class:     // Lookup class:
  
Line 1235 
Line 1382 
     Uint32 pos = _rep->_findInstance(nameSpace, instanceName);     Uint32 pos = _rep->_findInstance(nameSpace, instanceName);
  
     if (pos == PEG_NOT_FOUND)     if (pos == PEG_NOT_FOUND)
       {
         Throw((CIM_ERR_NOT_FOUND, "%s", *Str(instanceName)));         Throw((CIM_ERR_NOT_FOUND, "%s", *Str(instanceName)));
       }
  
     CIMInstance cimInstance = _rep->_rep[pos].second.clone();     CIMInstance cimInstance = _rep->_rep[pos].second.clone();
  
Line 1262 
Line 1411 
     Uint32 pos = _rep->_findInstance(nameSpace, instanceName);     Uint32 pos = _rep->_findInstance(nameSpace, instanceName);
  
     if (pos == PEG_NOT_FOUND)     if (pos == PEG_NOT_FOUND)
       {
         Throw((CIM_ERR_NOT_FOUND, "%s", *Str(instanceName)));         Throw((CIM_ERR_NOT_FOUND, "%s", *Str(instanceName)));
       }
  
     _rep->_rep.remove(pos);     _rep->_rep.remove(pos);
     _rep->_processSaveCallback();     _rep->_processSaveCallback();
Line 1293 
Line 1444 
     // Reject if an instance with this name already exists:     // Reject if an instance with this name already exists:
  
     if (_rep->_findInstance(nameSpace, cop) != PEG_NOT_FOUND)     if (_rep->_findInstance(nameSpace, cop) != PEG_NOT_FOUND)
       {
         Throw((CIM_ERR_ALREADY_EXISTS, "%s", *Str(cop)));         Throw((CIM_ERR_ALREADY_EXISTS, "%s", *Str(cop)));
       }
  
     // Add instance to array:     // Add instance to array:
  
Line 1373 
Line 1526 
     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));     const MRRNameSpace* ns = _findNameSpace(*Str(nameSpace));
  
     if (!ns)     if (!ns)
       {
         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));         Throw((CIM_ERR_INVALID_NAMESPACE, "%s", *Str(nameSpace)));
       }
  
     // Lookup class:     // Lookup class:
  
Line 1384 
Line 1539 
         super = FindClass(ns, *Str(className));         super = FindClass(ns, *Str(className));
  
         if (!super)         if (!super)
           {
             Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(className)));             Throw((CIM_ERR_NOT_FOUND, "unknown class: %s", *Str(className)));
     }     }
       }
  
     // Iterate all classes looking for matches:     // Iterate all classes looking for matches:
  
Line 1453 
Line 1610 
     for (Uint32 i = 0; i < classNames.size(); i++)     for (Uint32 i = 0; i < classNames.size(); i++)
     {     {
         Array<CIMInstance> instances = enumerateInstancesForClass(         Array<CIMInstance> instances = enumerateInstancesForClass(
             nameSpace, classNames[i], false, includeQualifiers,              nameSpace, classNames[i], includeQualifiers,
             includeClassOrigin, propertyList);             includeClassOrigin, propertyList);
  
         for (Uint32 i = 0 ; i < instances.size(); i++)         for (Uint32 i = 0 ; i < instances.size(); i++)
Line 1538 
Line 1695 
     for (Uint32 i = 0; i < _rep->_rep.size(); i++)     for (Uint32 i = 0; i < _rep->_rep.size(); i++)
     {     {
         if (_rep->_rep[i].first != nameSpace)         if (_rep->_rep[i].first != nameSpace)
           {
             continue;             continue;
           }
  
         CIMInstance& ci = _rep->_rep[i].second;         CIMInstance& ci = _rep->_rep[i].second;
  
         if (ci.getPath().getClassName() == className)         if (ci.getPath().getClassName() == className)
           {
             result.append(ci.getPath());             result.append(ci.getPath());
     }     }
       }
  
     return result;     return result;
 } }
Line 1845 
Line 2006 
         CIMNamespaceName nameSpace;         CIMNamespaceName nameSpace;
  
         if (MRRDeserializeNameSpace(in, pos, nameSpace) != 0)         if (MRRDeserializeNameSpace(in, pos, nameSpace) != 0)
           {
             return;             return;
           }
  
         CIMInstance cimInstance;         CIMInstance cimInstance;
  
         if (MRRDeserializeInstance(in, pos, cimInstance) != 0)         if (MRRDeserializeInstance(in, pos, cimInstance) != 0)
           {
             return;             return;
           }
  
         _rep.append(NamespaceInstancePair(nameSpace, cimInstance));         _rep.append(NamespaceInstancePair(nameSpace, cimInstance));
     }     }
Line 1859 
Line 2024 
 Boolean MRRAddNameSpace(const MRRNameSpace* nameSpace) Boolean MRRAddNameSpace(const MRRNameSpace* nameSpace)
 { {
     if (!nameSpace)     if (!nameSpace)
       {
         return false;         return false;
       }
  
     if (_nameSpaceTableSize == _MAX_NAMESPACE_TABLE_SIZE)     if (_nameSpaceTableSize == _MAX_NAMESPACE_TABLE_SIZE)
       {
         return false;         return false;
       }
  
     if (_findNameSpace(nameSpace->name))     if (_findNameSpace(nameSpace->name))
       {
         return false;         return false;
       }
  
     _nameSpaceTable[_nameSpaceTableSize++] = nameSpace;     _nameSpaceTable[_nameSpaceTableSize++] = nameSpace;
  
Line 1892 
Line 2063 
     Boolean localOnly,     Boolean localOnly,
     Boolean includeQualifiers,     Boolean includeQualifiers,
     Boolean includeClassOrigin,     Boolean includeClassOrigin,
     const CIMPropertyList& propertyList)      const CIMPropertyList& propertyList,
       Boolean clone)                 // Not used by MRR.
 { {
     return getClass(nameSpace, className, localOnly, includeQualifiers,     return getClass(nameSpace, className, localOnly, includeQualifiers,
         includeClassOrigin, propertyList);         includeClassOrigin, propertyList);


Legend:
Removed from v.1.7.6.1  
changed lines
  Added in v.1.7.6.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2