diff options
Diffstat (limited to '')
| -rw-r--r-- | src/unstable/cachebase.h | 11 | ||||
| -rw-r--r-- | src/unstable/myriadcache.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/unstable/cachebase.h b/src/unstable/cachebase.h index 807adf0..026e69b 100644 --- a/src/unstable/cachebase.h +++ b/src/unstable/cachebase.h | |||
| @@ -350,6 +350,16 @@ namespace Bu | |||
| 350 | ); | 350 | ); |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | bool has( const keytype &key ) | ||
| 354 | { | ||
| 355 | Bu::ReadWriteMutex::ReadLocker rl( mCacheEntry ); | ||
| 356 | |||
| 357 | if( hCacheEntry.has( key ) ) | ||
| 358 | return true; | ||
| 359 | |||
| 360 | return _has( key ); | ||
| 361 | } | ||
| 362 | |||
| 353 | CachePtr<keytype, obtype> get( const keytype &key ) | 363 | CachePtr<keytype, obtype> get( const keytype &key ) |
| 354 | { | 364 | { |
| 355 | Entry *pEnt = getEntry( key ); | 365 | Entry *pEnt = getEntry( key ); |
| @@ -431,6 +441,7 @@ namespace Bu | |||
| 431 | } | 441 | } |
| 432 | 442 | ||
| 433 | protected: | 443 | protected: |
| 444 | virtual bool _has( const keytype &key )=0; | ||
| 434 | virtual void _create( const obtype *o )=0; | 445 | virtual void _create( const obtype *o )=0; |
| 435 | virtual void _erase( const keytype &k )=0; | 446 | virtual void _erase( const keytype &k )=0; |
| 436 | 447 | ||
diff --git a/src/unstable/myriadcache.h b/src/unstable/myriadcache.h index 7ff2183..7f83250 100644 --- a/src/unstable/myriadcache.h +++ b/src/unstable/myriadcache.h | |||
| @@ -68,6 +68,12 @@ namespace Bu | |||
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | protected: | 70 | protected: |
| 71 | virtual bool _has( const keytype &key ) | ||
| 72 | { | ||
| 73 | Bu::ReadWriteMutex::ReadLocker rl( rwStore ); | ||
| 74 | return hIndex.has( key ); | ||
| 75 | } | ||
| 76 | |||
| 71 | virtual void _create( const obtype *o ) | 77 | virtual void _create( const obtype *o ) |
| 72 | { | 78 | { |
| 73 | Bu::ReadWriteMutex::WriteLocker wl( rwStore ); | 79 | Bu::ReadWriteMutex::WriteLocker wl( rwStore ); |
