gatb.core-API-1.4.2
CollectionCache< Item > Class Template Reference

Cache implementation of the Collection interface. More...

#include <CollectionCache.hpp>

Inheritance diagram for CollectionCache< Item >:
Inheritance graph

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 ()
 

Detailed Description

template<class Item>
class gatb::core::tools::collections::impl::CollectionCache< Item >

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.

Constructor & Destructor Documentation

CollectionCache ( Collection< Item > &  ref,
size_t  cacheSize,
system::ISynchronizer synchro 
)
inline

Constructor.

virtual ~CollectionCache ( )
inlinevirtual

Destructor.

Member Function Documentation

Collection<Item>& getRef ( )
inline

Accessor to the delegate Collection.

Returns
the delegate Collection instance.
void remove ( )
inlinevirtual

Remove physically the collection.

Implements Collection< Item >.


The documentation for this class was generated from the following file: