(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.3 and 1.4

version 1.3, 2006/05/31 19:59:46 version 1.4, 2006/11/14 18:34:57
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Robert Kieninger (kieningr@de.ibm.com)  
 //  
 // Modified By:  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
Line 52 
Line 48 
 Array<AssocClassCache*> AssocClassCache::_assocClassCacheList; Array<AssocClassCache*> AssocClassCache::_assocClassCacheList;
  
  
 /** Retrieves a singleton instance of the class cache for the  /**
   * given namespace.      Retrieves a singleton instance of the class cache for the given namespace.
 */ */
 AssocClassCache* AssocClassCache::getAssocClassCache(const String& nameSpace) AssocClassCache* AssocClassCache::getAssocClassCache(const String& nameSpace)
 { {
Line 80 
Line 76 
         delete(_assocClassCacheList[idx-1]);         delete(_assocClassCacheList[idx-1]);
         _assocClassCacheList.remove(idx-1);         _assocClassCacheList.remove(idx-1);
     }     }
   
 } }
  
 /** 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& fromClassName,  Boolean AssocClassCache::getAssocClassEntry(
       const String& fromClassName,
                                             Array< Array<String> >& entryList)                                             Array< Array<String> >& entryList)
 { {
    return _assocClassCache->lookup(fromClassName,entryList);    return _assocClassCache->lookup(fromClassName,entryList);
 } }
  
 /** Add a new record to the association cache. /** Add a new record to the association cache.
  * If an entry for the given from class name already exists,      If an entry for the given from class name already exists,
  * 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& fromClassName,  Boolean AssocClassCache::addRecord(
       const String& fromClassName,
                                    Array<String> assocClassRecord)                                    Array<String> assocClassRecord)
 { {
    Array< Array<String> > oldAssocClassEntryList;    Array< Array<String> > oldAssocClassEntryList;
Line 113 
Line 110 
 } }
  
 /** 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& fromClassName) Boolean AssocClassCache::removeEntry(const String& fromClassName)
 { {
    return _assocClassCache->remove(fromClassName);    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
  *  from class name and association name.      given from class name and association name.
 */ */
 Boolean AssocClassCache::removeRecord(const String& fromClassName,  Boolean AssocClassCache::removeRecord(
       const String& fromClassName,
                                       const String& assocClassName)                                       const String& assocClassName)
 { {
    Array< Array<String> > oldAssocClassEntryList;    Array< Array<String> > oldAssocClassEntryList;
Line 135 
Line 133 
          // 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 (String::equalNoCase(oldAssocClassEntryList[idx][ASSOC_CLASS_NAME_INDEX],              if (String::equalNoCase(
                       oldAssocClassEntryList[idx][ASSOC_CLASS_NAME_INDEX],
                                  assocClassName))                                  assocClassName))
          {          {
             _assocClassCache->remove(fromClassName);             _assocClassCache->remove(fromClassName);
             if (oldAssocClassEntryList.size() > 1)             if (oldAssocClassEntryList.size() > 1)
             {             {
                oldAssocClassEntryList.remove(idx);                oldAssocClassEntryList.remove(idx);
                _assocClassCache->insert(fromClassName,oldAssocClassEntryList);                      _assocClassCache->insert(
                           fromClassName, oldAssocClassEntryList);
             }             }
             return true;             return true;
          }          }


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2