14#ifndef OSGDB_OBJECTCACHE
15#define OSGDB_OBJECTCACHE 1
80 typedef std::map<FileNameOptionsPair, ObjectTimeStampPair, ClassComp>
ObjectCacheMap;
The osgDB library provides support for reading and writing scene graphs, providing a plugin framework...
Definition Archive:24
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
void clear()
Remove all objects in the cache regardless of having external references or expiry times.
void addObjectCache(ObjectCache *object)
Add contents of specified ObjectCache to this object cache.
void updateTimeStampOfObjectsInCacheWithExternalReferences(double referenceTime)
For each object in the cache which has an reference count greater than 1 (and therefore referenced by...
OpenThreads::Mutex _objectCacheMutex
Definition ObjectCache:85
void removeFromObjectCache(const std::string &fileName, const Options *options=NULL)
Remove Object from cache.
void removeExpiredObjectsInCache(double expiryTime)
Removed object in the cache which have a time stamp at or before the specified expiry time.
osg::Object * getFromObjectCache(const std::string &fileName, const Options *options=NULL)
Deprecated, the getFromObjectCache() returns a C pointer that is not thread safe when using database ...
ObjectCacheMap::iterator find(const std::string &fileName, const osgDB::Options *options)
std::map< FileNameOptionsPair, ObjectTimeStampPair, ClassComp > ObjectCacheMap
Definition ObjectCache:80
osg::ref_ptr< osg::Object > getRefFromObjectCache(const std::string &fileName, const Options *options=NULL)
Get a thread safe ref_ptr<Object> from the object cache.
std::pair< osg::ref_ptr< osg::Object >, double > ObjectTimeStampPair
Definition ObjectCache:79
void addEntryToObjectCache(const std::string &filename, osg::Object *object, double timestamp=0.0, const Options *options=NULL)
Add a filename,object,timestamp triple to the Registry::ObjectCache.
void releaseGLObjects(osg::State *state)
call rleaseGLObjects on all objects attached to the object cache.
ObjectCacheMap _objectCache
Definition ObjectCache:84
std::pair< std::string, osg::ref_ptr< const osgDB::Options > > FileNameOptionsPair
Definition ObjectCache:71
Definition ObjectCache:74
Options base class used for passing options into plugins to control their operation.
Definition Options:30
#define NULL
Definition Export:55
#define OSGDB_EXPORT
Definition Export:39