diff options
| -rw-r--r-- | src/unstable/cacheobject.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/unstable/cacheobject.h b/src/unstable/cacheobject.h index 4606493..e83f706 100644 --- a/src/unstable/cacheobject.h +++ b/src/unstable/cacheobject.h | |||
| @@ -33,6 +33,7 @@ namespace Bu | |||
| 33 | { | 33 | { |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | typedef CacheObject<keytype, obtype> MyType; | ||
| 36 | typedef CacheBase<keytype, obtype> CacheType; | 37 | typedef CacheBase<keytype, obtype> CacheType; |
| 37 | 38 | ||
| 38 | virtual keytype getKey() const=0; | 39 | virtual keytype getKey() const=0; |
| @@ -62,6 +63,24 @@ namespace Bu | |||
| 62 | return bChanged; | 63 | return bChanged; |
| 63 | } | 64 | } |
| 64 | 65 | ||
| 66 | class Locker | ||
| 67 | { | ||
| 68 | public: | ||
| 69 | Locker( const MyType *pObj ) : | ||
| 70 | pObj( pObj ) | ||
| 71 | { | ||
| 72 | pObj->lock(); | ||
| 73 | } | ||
| 74 | |||
| 75 | ~Locker() | ||
| 76 | { | ||
| 77 | pObj->unlock(); | ||
| 78 | } | ||
| 79 | |||
| 80 | private: | ||
| 81 | const MyType *pObj; | ||
| 82 | }; | ||
| 83 | |||
| 65 | protected: | 84 | protected: |
| 66 | void changed( bool bChanged=true ) | 85 | void changed( bool bChanged=true ) |
| 67 | { | 86 | { |
