Show
Ignore:
Timestamp:
08/05/09 13:06:53 (4 years ago)
Author:
robert
Message:

Moved the updating and expiry of the Registry object cache from DatabasePager? into osgViewer::Viewer/CompositeViewer.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgDB/Registry

    r10227 r10520  
    419419          * This would typically be called once per frame by applications which are doing database paging, 
    420420          * and need to prune objects that are no longer required. 
    421           * Time value is time in seconds.*/ 
    422         void updateTimeStampOfObjectsInCacheWithExternalReferences(double currentTime); 
     421          * The time used is taken from the FrameStamp::getReferenceTime().*/ 
     422        void updateTimeStampOfObjectsInCacheWithExternalReferences(const osg::FrameStamp& frameStamp); 
    423423 
    424424        /** Removed object in the cache which have a time stamp at or before the specified expiry time. 
    425425          * This would typically be called once per frame by applications which are doing database paging, 
    426426          * and need to prune objects that are no longer required, and called after the a called 
    427           * after the call to updateTimeStampOfObjectsInCacheWithExternalReferences(currentTime).  
    428           * Note, the currentTime is not the expiryTime, one would typically set the expiry time 
    429           * to a fixed amount of time before currentTime, such as expiryTime = currentTime-10.0. 
    430           * Time value is time in seconds.*/ 
    431         void removeExpiredObjectsInCache(double expiryTime); 
    432          
     427          * after the call to updateTimeStampOfObjectsInCacheWithExternalReferences(frameStamp).*/ 
     428        void removeExpiredObjectsInCache(const osg::FrameStamp& frameStamp); 
     429 
     430        /** set hint to viewer code calling removeExpiredObjectsInCache to specify how long it should give before expiring objects in Registry cache,*/ 
     431        void setExpiryDelay(double expiryDelay) { _expiryDelay = expiryDelay; } 
     432 
     433        double getExpiryDelay() const { return _expiryDelay; } 
     434 
     435 
    433436        /** Remove all objects in the cache regardless of having external references or expiry times.*/  
    434437        void clearObjectCache(); 
     
    600603        FilePathList                            _libraryFilePath; 
    601604 
     605        double                                  _expiryDelay; 
    602606        ObjectCache                             _objectCache; 
    603607        OpenThreads::Mutex                      _objectCacheMutex;