Fix finding object cache entries.

(cherry picked from commit 69929f596f)
This commit is contained in:
Ralf Habacker 2016-06-17 17:48:31 +02:00
parent 3e7f2feb6b
commit 5cc53e1aa2
2 changed files with 13 additions and 2 deletions

View File

@ -68,9 +68,15 @@ class OSGDB_EXPORT ObjectCache : public osg::Referenced
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::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;
OpenThreads::Mutex _objectCacheMutex;

View File

@ -16,6 +16,11 @@
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