Fix finding object cache entries.
(cherry picked from commit 69929f596f
)
This commit is contained in:
parent
3e7f2feb6b
commit
5cc53e1aa2
@ -68,9 +68,15 @@ class OSGDB_EXPORT ObjectCache : public osg::Referenced
|
|||||||
|
|
||||||
virtual ~ObjectCache();
|
virtual ~ObjectCache();
|
||||||
|
|
||||||
typedef std::pair<osg::ref_ptr<osg::Object>, double > ObjectTimeStampPair;
|
|
||||||
typedef std::pair<std::string, osg::ref_ptr<const osgDB::Options> > FileNameOptionsPair;
|
typedef std::pair<std::string, osg::ref_ptr<const osgDB::Options> > FileNameOptionsPair;
|
||||||
typedef std::map<FileNameOptionsPair, ObjectTimeStampPair > ObjectCacheMap;
|
|
||||||
|
class ClassComp {
|
||||||
|
public:
|
||||||
|
bool operator() (const ObjectCache::FileNameOptionsPair& lhs, const ObjectCache::FileNameOptionsPair& rhs);
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::pair<osg::ref_ptr<osg::Object>, double > ObjectTimeStampPair;
|
||||||
|
typedef std::map<FileNameOptionsPair, ObjectTimeStampPair, ClassComp> ObjectCacheMap;
|
||||||
|
|
||||||
ObjectCacheMap _objectCache;
|
ObjectCacheMap _objectCache;
|
||||||
OpenThreads::Mutex _objectCacheMutex;
|
OpenThreads::Mutex _objectCacheMutex;
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
|
|
||||||
using namespace osgDB;
|
using namespace osgDB;
|
||||||
|
|
||||||
|
bool ObjectCache::ClassComp::operator() (const ObjectCache::FileNameOptionsPair& lhs, const ObjectCache::FileNameOptionsPair& rhs)
|
||||||
|
{
|
||||||
|
return lhs.first < rhs.first || *lhs.second < *rhs.second;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// ObjectCache
|
// ObjectCache
|
||||||
|
Loading…
Reference in New Issue
Block a user