gatb.core-API-0.0.0
|
Bag implementation as a cache to a referred Bag instance. More...
#include <BagCache.hpp>
Public Member Functions | |
BagCache () | |
BagCache (Bag< Item > *ref, size_t cacheSize, system::ISynchronizer *synchro=0) | |
virtual | ~BagCache () |
void | insert (const Item &item) |
void | flush () |
Public Member Functions inherited from Bag< Item > | |
virtual void | insert (const std::vector< Item > &items, size_t length=0) |
virtual void | insert (const Item *items, size_t length) |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
Public Member Functions inherited from SmartPointer | |
void | use () |
void | forget () |
Additional Inherited Members | |
Protected Member Functions inherited from SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Bag implementation as a cache to a referred Bag instance.
This implementation is a proxy to a Bag instance. One can insert items into such a bag, it will just put them into a cache. When the cache is full, all the cached items are inserted into the delegate; this operation may be protected by a synchronizer in case several threads use different BagCache on the same delegate.
|
inline |
Constructor
|
inline |
Constructor. Cache size is in terms of number of items (I think)
|
inlinevirtual |
Destructor.
|
inlinevirtual |
Flush the current content. May be useful for implementation that uses a cache.
Implements Bag< Item >.
Reimplemented in BagCacheSorted< Item >, and BagCacheSortedBuffered< Item >.
|
inlinevirtual |
Insert an item into the bag.
[in] | item | : the item to be inserted. |
Implements Bag< Item >.
Reimplemented in BagCacheSorted< Item >, and BagCacheSortedBuffered< Item >.