From 69929f596f4e1db9eefb6092d377466b9674974d Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Fri, 17 Jun 2016 17:48:31 +0200 Subject: [PATCH] Fix finding object cache entries. --- include/osgDB/ObjectCache | 10 ++++++++-- src/osgDB/ObjectCache.cpp | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/osgDB/ObjectCache b/include/osgDB/ObjectCache index d6179b51a..01b3f0581 100644 --- a/include/osgDB/ObjectCache +++ b/include/osgDB/ObjectCache @@ -68,9 +68,15 @@ class OSGDB_EXPORT ObjectCache : public osg::Referenced virtual ~ObjectCache(); - typedef std::pair, double > ObjectTimeStampPair; typedef std::pair > FileNameOptionsPair; - typedef std::map ObjectCacheMap; + + class ClassComp { + public: + bool operator() (const ObjectCache::FileNameOptionsPair& lhs, const ObjectCache::FileNameOptionsPair& rhs); + }; + + typedef std::pair, double > ObjectTimeStampPair; + typedef std::map ObjectCacheMap; ObjectCacheMap _objectCache; OpenThreads::Mutex _objectCacheMutex; diff --git a/src/osgDB/ObjectCache.cpp b/src/osgDB/ObjectCache.cpp index 872172395..48acc1b88 100644 --- a/src/osgDB/ObjectCache.cpp +++ b/src/osgDB/ObjectCache.cpp @@ -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