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

Diff for /pegasus/src/Pegasus/Repository/AssocClassCache.cpp between version 1.2 and 1.3

version 1.2, 2006/01/30 16:18:20 version 1.3, 2006/05/31 19:59:46
Line 86 
Line 86 
 /** Retrieve the list of entries for a from class through direct /** Retrieve the list of entries for a from class through direct
  * access via the from class name.  * access via the from class name.
 */ */
 Boolean AssocClassCache::getAssocClassEntry(const String& lowerCaseFromClassName,  Boolean AssocClassCache::getAssocClassEntry(const String& fromClassName,
                                             Array< Array<String> >& entryList)                                             Array< Array<String> >& entryList)
 { {
    return _assocClassCache->lookup(lowerCaseFromClassName,entryList);     return _assocClassCache->lookup(fromClassName,entryList);
 } }
  
 /** Add a new record to the association cache. /** Add a new record to the association cache.
Line 97 
Line 97 
  * the new entry is appended to the old entry. Otherwise a new entry  * the new entry is appended to the old entry. Otherwise a new entry
  * is added to the cache.  * is added to the cache.
 */ */
 Boolean AssocClassCache::addRecord(const String& lowerCaseFromClassName,  Boolean AssocClassCache::addRecord(const String& fromClassName,
                                    Array<String> assocClassRecord)                                    Array<String> assocClassRecord)
 { {
    Array< Array<String> > oldAssocClassEntryList;    Array< Array<String> > oldAssocClassEntryList;
  
    if (_assocClassCache->lookup(lowerCaseFromClassName, oldAssocClassEntryList))     if (_assocClassCache->lookup(fromClassName, oldAssocClassEntryList))
    {    {
       _assocClassCache->remove(lowerCaseFromClassName);        _assocClassCache->remove(fromClassName);
    }    }
  
    oldAssocClassEntryList.append(assocClassRecord);    oldAssocClassEntryList.append(assocClassRecord);
  
    return _assocClassCache->insert(lowerCaseFromClassName,oldAssocClassEntryList);     return _assocClassCache->insert(fromClassName,oldAssocClassEntryList);
 } }
  
 /** Remove an entry from the association cache specified by the given /** Remove an entry from the association cache specified by the given
  *  from class name.  *  from class name.
 */ */
 Boolean AssocClassCache::removeEntry(const String& lowerCaseFromClassName)  Boolean AssocClassCache::removeEntry(const String& fromClassName)
 { {
    return _assocClassCache->remove(lowerCaseFromClassName);     return _assocClassCache->remove(fromClassName);
 } }
  
 /** Remove an association record from the association cache specified by the given /** Remove an association record from the association cache specified by the given
  *  from class name and association name.  *  from class name and association name.
 */ */
 Boolean AssocClassCache::removeRecord(const String& lowerCaseFromClassName,  Boolean AssocClassCache::removeRecord(const String& fromClassName,
                                       const String& lowerCaseAssocClassName)                                        const String& assocClassName)
 { {
    Array< Array<String> > oldAssocClassEntryList;    Array< Array<String> > oldAssocClassEntryList;
    if (_assocClassCache->lookup(lowerCaseFromClassName, oldAssocClassEntryList))  
      if (_assocClassCache->lookup(fromClassName, oldAssocClassEntryList))
    {    {
       for (Uint16 idx=0; idx < oldAssocClassEntryList.size(); idx++ )       for (Uint16 idx=0; idx < oldAssocClassEntryList.size(); idx++ )
       {       {
          // The first entry in each record is the association class          // The first entry in each record is the association class
          // name. Find the record for the association class and remove          // name. Find the record for the association class and remove
          // it from the cache entry.          // it from the cache entry.
          if (oldAssocClassEntryList[idx][ASSOC_CLASS_NAME_INDEX] == lowerCaseAssocClassName)           if (String::equalNoCase(oldAssocClassEntryList[idx][ASSOC_CLASS_NAME_INDEX],
                                    assocClassName))
          {          {
             _assocClassCache->remove(lowerCaseFromClassName);              _assocClassCache->remove(fromClassName);
             if (oldAssocClassEntryList.size() > 1)             if (oldAssocClassEntryList.size() > 1)
             {             {
                oldAssocClassEntryList.remove(idx);                oldAssocClassEntryList.remove(idx);
                _assocClassCache->insert(lowerCaseFromClassName,oldAssocClassEntryList);                 _assocClassCache->insert(fromClassName,oldAssocClassEntryList);
             }             }
             return true;             return true;
          }          }


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2