From 1db266b863a805d49928d831a690c39df640dc28 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 18 Mar 2013 15:07:46 +0000 Subject: Corrected compliation issue in the new cache with older GCC versions. --- src/tests/cache.cpp | 84 +++++++++++++++++++++++----------------------- src/unstable/myriadcache.h | 2 +- 2 files changed, 43 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/tests/cache.cpp b/src/tests/cache.cpp index dc5dbd0..20b384e 100644 --- a/src/tests/cache.cpp +++ b/src/tests/cache.cpp @@ -125,54 +125,54 @@ Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingB &s ) namespace Bu { -template<> -void _cacheObjectSave( Bu::Stream &s, const Something *pObject ) -{ - Bu::Archive ar( s, Bu::Archive::save ); - if( typeid(*pObject) == typeid(SubSomethingA) ) - { - ar << (uint8_t)1 << (SubSomethingA &)*pObject; - } - else if( typeid(*pObject) == typeid(SubSomethingB) ) + template<> + void _cacheObjectSave( Bu::Stream &s, const Something *pObject ) { - ar << (uint8_t)2 << (SubSomethingB &)*pObject; + Bu::Archive ar( s, Bu::Archive::save ); + if( typeid(*pObject) == typeid(SubSomethingA) ) + { + ar << (uint8_t)1 << (SubSomethingA &)*pObject; + } + else if( typeid(*pObject) == typeid(SubSomethingB) ) + { + ar << (uint8_t)2 << (SubSomethingB &)*pObject; + } + else + { + Bu::println("Not a recognized type!"); + throw Bu::ExceptionBase("Not recognized type!"); + } } - else - { - Bu::println("Not a recognized type!"); - throw Bu::ExceptionBase("Not recognized type!"); - } -} -template<> -Something *_cacheObjectLoad( Bu::Stream &s ) -{ - Bu::Archive ar( s, Bu::Archive::load ); - uint8_t uType; - ar >> uType; - switch( uType ) + template<> + Something *_cacheObjectLoad( Bu::Stream &s ) { - case 1: - { - SubSomethingA *ret = new SubSomethingA(); - ar >> *ret; - return ret; - } - break; - - case 2: - { - SubSomethingB *ret = new SubSomethingB(); - ar >> *ret; - return ret; - } - break; - - default: - throw Bu::ExceptionBase("Flagrant error! Invalid type!"); + Bu::Archive ar( s, Bu::Archive::load ); + uint8_t uType; + ar >> uType; + switch( uType ) + { + case 1: + { + SubSomethingA *ret = new SubSomethingA(); + ar >> *ret; + return ret; + } + break; + + case 2: + { + SubSomethingB *ret = new SubSomethingB(); + ar >> *ret; + return ret; + } + break; + + default: + throw Bu::ExceptionBase("Flagrant error! Invalid type!"); + } } } -} typedef Bu::CachePtr SomethingPtr; typedef Bu::CachePtr SomethingAPtr; diff --git a/src/unstable/myriadcache.h b/src/unstable/myriadcache.h index f8c0e00..7ff2183 100644 --- a/src/unstable/myriadcache.h +++ b/src/unstable/myriadcache.h @@ -55,7 +55,7 @@ namespace Bu using typename Bu::CacheBase::KeyList; - virtual KeyList getKeys() const + virtual typename Bu::CacheBase::KeyList getKeys() const { Bu::ReadWriteMutex::ReadLocker rl( rwStore ); return hIndex.getKeys(); -- cgit v1.2.3