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

Implementation of the Collection interface with a file. More...

#include <CollectionFile.hpp>

Inheritance diagram for CollectionFile< Item >:
Inheritance graph

Public Member Functions

 CollectionFile (const std::string &filename, size_t cacheItemsNb=10000)
 
virtual ~CollectionFile ()
 
void remove ()
 
void addProperty (const std::string &key, const std::string value)
 
std::string getProperty (const std::string &key)
 
- 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 char *format...)
 
- 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::storage::impl::CollectionFile< Item >

Implementation of the Collection interface with a file.

This implementation reads/writes Item objects in a file.

Constructor & Destructor Documentation

CollectionFile ( const std::string &  filename,
size_t  cacheItemsNb = 10000 
)
inline

Constructor.

virtual ~CollectionFile ( )
inlinevirtual

Destructor.

Member Function Documentation

void addProperty ( const std::string &  key,
const std::string  value 
)
inlinevirtual

Add a property to the collection.

Parameters
[in]key: key of the property
[in]value: value of the property.

Reimplemented from CollectionAbstract< Item >.

std::string getProperty ( const std::string &  key)
inlinevirtual

Retrieve a property for a given key

Parameters
[in]key: key of the property to be retrieved
Returns
the value of the property.

Reimplemented from CollectionAbstract< Item >.

void remove ( )
inlinevirtual

Remove physically the collection.

Implements Collection< Item >.


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