gatb.core-API-1.4.2
Collection< Item > Class Template Referenceabstract

Collection interface. More...

#include <Collection.hpp>

Inheritance diagram for Collection< Item >:
Inheritance graph

Public Member Functions

virtual ~Collection ()
 
virtual Bag< Item > * bag ()=0
 
virtual Iterable< Item > * iterable ()=0
 
virtual void remove ()=0
 
virtual void addProperty (const std::string &key, const std::string value)=0
 
virtual void addProperty (const std::string &key, const char *format,...)=0
 
virtual std::string getProperty (const std::string &key)=0
 
- Public Member Functions inherited from Bag< Item >
virtual void insert (const Item &item)=0
 
virtual void insert (const std::vector< Item > &items, size_t length=0)
 
virtual void insert (const Item *items, size_t length)
 
virtual void flush ()=0
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 
virtual void use ()=0
 
virtual void forget ()=0
 
- Public Member Functions inherited from Iterable< Item >
virtual dp::Iterator< Item > * iterator ()=0
 
template<typename Functor >
void iterate (Functor f)
 
virtual int64_t getNbItems ()=0
 
virtual int64_t estimateNbItems ()=0
 
virtual Item * getItems (Item *&buffer)
 
virtual size_t getItems (Item *&buffer, size_t start, size_t nb)
 

Detailed Description

template<class Item>
class gatb::core::tools::collections::Collection< Item >

Collection interface.

The Collection interface is the union of a Bag and an Iterable interfaces

It is also to get/set properties (as [key,value]) to collections.

Constructor & Destructor Documentation

virtual ~Collection ( )
inlinevirtual

Destructor.

Member Function Documentation

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

Add a property to the collection.

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

Implemented in CollectionHDF5< Item >, CollectionNode< Item >, CollectionAbstract< Item >, and CollectionFile< Item >.

virtual void addProperty ( const std::string &  key,
const char *  format,
  ... 
)
pure virtual

Add a property to the collection.

Parameters
[in]key: key of the property
[in]format: printf like arguments
[in]...: variable arguments.
virtual Bag<Item>* bag ( )
pure virtual
Returns
the bag instance.

Implemented in CollectionAbstract< Item >.

virtual std::string getProperty ( const std::string &  key)
pure virtual

Retrieve a property for a given key

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

Implemented in CollectionHDF5< Item >, CollectionNode< Item >, CollectionAbstract< Item >, and CollectionFile< Item >.

virtual Iterable<Item>* iterable ( )
pure virtual
Returns
the iterable instance.

Implemented in CollectionAbstract< Item >.

virtual void remove ( )
pure virtual

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