gatb.core-API-0.0.0
|
Cache implementation of the Collection interface. More...
#include <CollectionCache.hpp>
Public Member Functions | |
CollectionCache (Collection< Item > &ref, size_t cacheSize, system::ISynchronizer *synchro) | |
virtual | ~CollectionCache () |
void | remove () |
Collection< Item > & | getRef () |
Public Member Functions inherited from CollectionAbstract< Item > | |
CollectionAbstract (Bag< Item > *bag, Iterable< Item > *iterable) | |
virtual | ~CollectionAbstract () |
Bag< Item > * | bag () |
Iterable< Item > * | iterable () |
dp::Iterator< Item > * | iterator () |
int64_t | getNbItems () |
int64_t | estimateNbItems () |
Item * | getItems (Item *&buffer) |
size_t | getItems (Item *&buffer, size_t start, size_t nb) |
void | insert (const Item &item) |
void | insert (const std::vector< Item > &items, size_t length) |
void | insert (const Item *items, size_t length) |
void | flush () |
void | addProperty (const std::string &key, const std::string value) |
void | addProperty (const std::string &key, const char *format...) |
std::string | getProperty (const std::string &key) |
Public Member Functions inherited from Collection< Item > | |
virtual | ~Collection () |
virtual void | addProperty (const std::string &key, const char *format,...)=0 |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
Public Member Functions inherited from Iterable< Item > | |
template<typename Functor > | |
void | iterate (Functor f) |
Public Member Functions inherited from SmartPointer | |
void | use () |
void | forget () |
Additional Inherited Members | |
Protected Member Functions inherited from SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Cache implementation of the Collection interface.
This implementations allows to add items into the collection through a cache. It means that a memory block for inserting the items and when the memory is full, all its items are flushed into the delegate Collection (provided at construction).
A synchronizer can be provided to be sure that the delegate can't suffer concurrent accesses by several threads. This allows to encapsulate a single Collection into several CollectionCache instances, each one used in a thread.
|
inline |
Constructor.
|
inlinevirtual |
Destructor.
|
inline |
Accessor to the delegate Collection.
|
inlinevirtual |
Remove physically the collection.
Implements Collection< Item >.