OSG
3.4.0
|
#include <ObjectCache.h>
Public Member Functions | |
ObjectCache () | |
void | updateTimeStampOfObjectsInCacheWithExternalReferences (double referenceTime) |
void | removeExpiredObjectsInCache (double expiryTime) |
void | clear () |
void | addObjectCache (ObjectCache *object) |
void | addEntryToObjectCache (const std::string &filename, osg::Object *object, double timestamp=0.0) |
void | removeFromObjectCache (const std::string &fileName) |
osg::Object * | getFromObjectCache (const std::string &fileName) |
osg::ref_ptr< osg::Object > | getRefFromObjectCache (const std::string &fileName) |
void | releaseGLObjects (osg::State *state) |
![]() | |
Referenced () | |
Referenced (bool threadSafeRefUnref) | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
bool | getThreadSafeRefUnref () const |
OpenThreads::Mutex * | getRefMutex () const |
int | ref () const |
int | unref () const |
int | unref_nodelete () const |
int | referenceCount () const |
ObserverSet * | getObserverSet () const |
ObserverSet * | getOrCreateObserverSet () const |
void | addObserver (Observer *observer) const |
void | removeObserver (Observer *observer) const |
Protected Types | |
typedef std::pair < osg::ref_ptr< osg::Object > , double > | ObjectTimeStampPair |
typedef std::map< std::string, ObjectTimeStampPair > | ObjectCacheMap |
Protected Member Functions | |
virtual | ~ObjectCache () |
![]() | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Protected Attributes | |
ObjectCacheMap | _objectCache |
OpenThreads::Mutex | _objectCacheMutex |
![]() | |
OpenThreads::AtomicPtr | _observerSet |
OpenThreads::Atomic | _refCount |
Additional Inherited Members | |
![]() | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
static bool | getThreadSafeReferenceCounting () |
static void | setDeleteHandler (DeleteHandler *handler) |
static DeleteHandler * | getDeleteHandler () |
Definition at line 26 of file ObjectCache.h.
|
protected |
Definition at line 72 of file ObjectCache.h.
|
protected |
Definition at line 71 of file ObjectCache.h.
osgDB::ObjectCache::ObjectCache | ( | ) |
|
protectedvirtual |
void osgDB::ObjectCache::addEntryToObjectCache | ( | const std::string & | filename, |
osg::Object * | object, | ||
double | timestamp = 0.0 |
||
) |
Add a filename,object,timestamp triple to the Registry::ObjectCache.
void osgDB::ObjectCache::addObjectCache | ( | ObjectCache * | object | ) |
Add contents of specified ObjectCache to this object cache.
void osgDB::ObjectCache::clear | ( | ) |
Remove all objects in the cache regardless of having external references or expiry times.
osg::Object* osgDB::ObjectCache::getFromObjectCache | ( | const std::string & | fileName | ) |
Get an Object from the object cache
osg::ref_ptr<osg::Object> osgDB::ObjectCache::getRefFromObjectCache | ( | const std::string & | fileName | ) |
Get an ref_ptr<Object> from the object cache
void osgDB::ObjectCache::releaseGLObjects | ( | osg::State * | state | ) |
call rleaseGLObjects on all objects attached to the object cache.
void osgDB::ObjectCache::removeExpiredObjectsInCache | ( | double | expiryTime | ) |
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(expirtyTime).
void osgDB::ObjectCache::removeFromObjectCache | ( | const std::string & | fileName | ) |
Remove Object from cache.
void osgDB::ObjectCache::updateTimeStampOfObjectsInCacheWithExternalReferences | ( | double | referenceTime | ) |
For each object in the cache which has an reference count greater than 1 (and therefore referenced by elsewhere in the application) set the time stamp 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. The time used should be taken from the FrameStamp::getReferenceTime().
|
protected |
Definition at line 74 of file ObjectCache.h.
|
protected |
Definition at line 75 of file ObjectCache.h.