![]() |
VR-Forces Developer's Guide
|
A thread safe collection, used by the mult-threaded cache, of OSG referenced objects.

Classes | |
| struct | FindReference |
Public Types | |
| typedef std::unordered_map < std::string, osg::ref_ptr < OsgObject > > | InstanceMap |
| typedef std::vector< std::pair < std::string, OsgObject * > > | ReferenceList |
Public Member Functions | |
| DtOsgReferencedCollection (unsigned int initialCapacity) | |
| void | lock () |
| ReferenceList & | getUnsafeList () |
| InstanceMap & | getUnsafeMap () |
| unsigned int | unsafeListSize () const |
| void | unlock () |
| bool | findOrBlockWhilePending (const std::string &name, osg::ref_ptr< OsgObject > &object) |
| osg::ref_ptr< OsgObject > | find (const std::string &filename) |
| void | insert (const std::string &name, const osg::ref_ptr< OsgObject > &obj) |
| void | releaseGLObjects (osg::State *state) |
| void | clear () |
| bool | findOrAddTexture (const std::string &filename, osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter, osg::Texture::WrapMode s, osg::Texture::WrapMode t, osg::ref_ptr< osg::Texture > &texture, bool unloadImageDataFlag, bool compressTexturesFlag, const std::string &alternateFilename="") |
| bool | findTexture (const std::string &filename, osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter, osg::Texture::WrapMode s, osg::Texture::WrapMode t, bool compressedTexturesFlag, osg::ref_ptr< osg::Texture > &texture) |
| void | addTexture (const std::string &filename, osg::ref_ptr< osg::Texture > texture, bool unloadImageDataFlag, bool compressTexturesFlag, std::string alternateFilename="") |
| unsigned int | flush () |
| unsigned int | partialFlush (unsigned int maxToCheck, unsigned int maxToFlush) |
| unsigned int | flushTextures () |
| unsigned int | partialFlushTextures (unsigned int maxToCheck, unsigned int maxToFlush) |
Protected Types | |
| typedef std::unordered_set < std::string > | PendingSet |
Protected Attributes | |
| boost::mutex | myMutex |
| boost::condition_variable | myPendingInstanceDone |
| InstanceMap | myInstanceMap |
| ReferenceList | myRefInstanceList |
| PendingSet | myPendingInstances |
| PendingSet | myFailedInstances |
| unsigned int | myPartialFlushIndex |
| typedef std::unordered_map<std::string,osg::ref_ptr<OsgObject> > makVrv::DtOsgReferencedCollection< OsgObject >::InstanceMap |
| typedef std::vector<std::pair<std::string,OsgObject*> > makVrv::DtOsgReferencedCollection< OsgObject >::ReferenceList |
|
protected |
| makVrv::DtOsgReferencedCollection< OsgObject >::DtOsgReferencedCollection | ( | unsigned int | initialCapacity | ) |
Constructor.
|
inline |
Lock the collection.
|
inline |
Get the unsafe list, to make this safe you MUST lock the collection first.
|
inline |
Get the unsafe map, to make this safe you MUST lock the collection first.
| unsigned int makVrv::DtOsgReferencedCollection< OsgObject >::unsafeListSize | ( | ) | const |
returns size of collection
|
inline |
Unlock the collection.
| bool makVrv::DtOsgReferencedCollection< OsgObject >::findOrBlockWhilePending | ( | const std::string & | name, |
| osg::ref_ptr< OsgObject > & | object | ||
| ) |
Find an object with a given name or save the name as pending. This function will block if the object name was already pending.
| osg::ref_ptr<OsgObject> makVrv::DtOsgReferencedCollection< OsgObject >::find | ( | const std::string & | filename | ) |
Look for an object and return a value (null or not).
| void makVrv::DtOsgReferencedCollection< OsgObject >::insert | ( | const std::string & | name, |
| const osg::ref_ptr< OsgObject > & | obj | ||
| ) |
Insert an instance into the cache Needs to be called if an object is pending (pass 0 to remove from pending without adding anything)
| void makVrv::DtOsgReferencedCollection< OsgObject >::releaseGLObjects | ( | osg::State * | state | ) |
Release GL objects on all objects in the cache.
| void makVrv::DtOsgReferencedCollection< OsgObject >::clear | ( | ) |
Clears all of the instances.
| bool makVrv::DtOsgReferencedCollection< OsgObject >::findOrAddTexture | ( | const std::string & | filename, |
| osg::Texture::FilterMode | minFilter, | ||
| osg::Texture::FilterMode | magFilter, | ||
| osg::Texture::WrapMode | s, | ||
| osg::Texture::WrapMode | t, | ||
| osg::ref_ptr< osg::Texture > & | texture, | ||
| bool | unloadImageDataFlag, | ||
| bool | compressTexturesFlag, | ||
| const std::string & | alternateFilename = "" |
||
| ) |
Find a texture with the given image name. If it is not found the texture input is added to the cache if it is not null.
| bool makVrv::DtOsgReferencedCollection< OsgObject >::findTexture | ( | const std::string & | filename, |
| osg::Texture::FilterMode | minFilter, | ||
| osg::Texture::FilterMode | magFilter, | ||
| osg::Texture::WrapMode | s, | ||
| osg::Texture::WrapMode | t, | ||
| bool | compressedTexturesFlag, | ||
| osg::ref_ptr< osg::Texture > & | texture | ||
| ) |
Find a texture with the given image name.
| void makVrv::DtOsgReferencedCollection< OsgObject >::addTexture | ( | const std::string & | filename, |
| osg::ref_ptr< osg::Texture > | texture, | ||
| bool | unloadImageDataFlag, | ||
| bool | compressTexturesFlag, | ||
| std::string | alternateFilename = "" |
||
| ) |
add a texture for the given image name. also processes the texture to put on a callback for handling when an openGL context is recreated.
| unsigned int makVrv::DtOsgReferencedCollection< OsgObject >::flush | ( | ) |
Do a partial flush of items.
| unsigned int makVrv::DtOsgReferencedCollection< OsgObject >::partialFlush | ( | unsigned int | maxToCheck, |
| unsigned int | maxToFlush | ||
| ) |
Do a partial flush of items.
| unsigned int makVrv::DtOsgReferencedCollection< OsgObject >::flushTextures | ( | ) |
Do a flush of all textures.
| unsigned int makVrv::DtOsgReferencedCollection< OsgObject >::partialFlushTextures | ( | unsigned int | maxToCheck, |
| unsigned int | maxToFlush | ||
| ) |
Do a partial flush of items.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |