Moved the updating and expiry of the Registry object cache from DatabasePager into osgViewer::Viewer/CompositeViewer.
This commit is contained in:
@@ -418,18 +418,21 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
* for that object in the cache to specified time.
|
||||
* This would typically be called once per frame by applications which are doing database paging,
|
||||
* and need to prune objects that are no longer required.
|
||||
* Time value is time in seconds.*/
|
||||
void updateTimeStampOfObjectsInCacheWithExternalReferences(double currentTime);
|
||||
* The time used is taken from the FrameStamp::getReferenceTime().*/
|
||||
void updateTimeStampOfObjectsInCacheWithExternalReferences(const osg::FrameStamp& frameStamp);
|
||||
|
||||
/** Removed object in the cache which have a time stamp at or before the specified expiry time.
|
||||
* This would typically be called once per frame by applications which are doing database paging,
|
||||
* and need to prune objects that are no longer required, and called after the a called
|
||||
* after the call to updateTimeStampOfObjectsInCacheWithExternalReferences(currentTime).
|
||||
* Note, the currentTime is not the expiryTime, one would typically set the expiry time
|
||||
* to a fixed amount of time before currentTime, such as expiryTime = currentTime-10.0.
|
||||
* Time value is time in seconds.*/
|
||||
void removeExpiredObjectsInCache(double expiryTime);
|
||||
|
||||
* after the call to updateTimeStampOfObjectsInCacheWithExternalReferences(frameStamp).*/
|
||||
void removeExpiredObjectsInCache(const osg::FrameStamp& frameStamp);
|
||||
|
||||
/** set hint to viewer code calling removeExpiredObjectsInCache to specify how long it should give before expiring objects in Registry cache,*/
|
||||
void setExpiryDelay(double expiryDelay) { _expiryDelay = expiryDelay; }
|
||||
|
||||
double getExpiryDelay() const { return _expiryDelay; }
|
||||
|
||||
|
||||
/** Remove all objects in the cache regardless of having external references or expiry times.*/
|
||||
void clearObjectCache();
|
||||
|
||||
@@ -599,6 +602,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
FilePathList _dataFilePath;
|
||||
FilePathList _libraryFilePath;
|
||||
|
||||
double _expiryDelay;
|
||||
ObjectCache _objectCache;
|
||||
OpenThreads::Mutex _objectCacheMutex;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user