gatb.core-API-1.4.2
Partition< Type > Class Template Reference

Define a set of Collection instances having the same type. More...

#include <Storage.hpp>

Inheritance diagram for Partition< Type >:
Inheritance graph

Public Member Functions

 Partition (StorageFactory *factory, ICell *parent, const std::string &id, size_t nbCollections)
 
 ~Partition ()
 
size_t size () const
 
collections::Collection< Type > & operator[] (size_t idx)
 
dp::Iterator< Type > * iterator ()
 
int64_t getNbItems ()
 
int64_t estimateNbItems ()
 
u_int64_t getSizeItems ()
 
void flush ()
 
void remove ()
 
- Public Member Functions inherited from Group
 Group (StorageFactory *factory, ICell *parent, const std::string &name)
 
 ~Group ()
 
GroupgetGroup (const std::string &name)
 
template<class Type >
Partition< Type > & getPartition (const std::string &name, size_t nb=0)
 
template<class Type >
CollectionNode< Type > & getCollection (const std::string &name)
 
virtual void addProperty (const std::string &key, const std::string value)
 
virtual std::string getProperty (const std::string &key)
 
- Public Member Functions inherited from Cell
 Cell (ICell *parent, const std::string &id)
 
 ~Cell ()
 
ICellgetParent () const
 
const std::string & getId () const
 
std::string getFullId (char sep='.') const
 
void setCompressLevel (int level)
 
int getCompressLevel () const
 
- Public Member Functions inherited from ICell
virtual ~ICell ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 
- Public Member Functions inherited from Iterable< Type >
void iterate (Functor f)
 
virtual Type * getItems (Type *&buffer)
 
virtual size_t getItems (Type *&buffer, size_t start, size_t nb)
 

Additional Inherited Members

- Static Public Member Functions inherited from ICell
static ICellgetRoot (ICell *cell)
 
- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

template<typename Type>
class gatb::core::tools::storage::impl::Partition< Type >

Define a set of Collection instances having the same type.

The Partition class groups several Collections that share the same kind of items.

It is defined as a subclass of Group.

Constructor & Destructor Documentation

Partition ( StorageFactory factory,
ICell parent,
const std::string &  id,
size_t  nbCollections 
)

Constructor.

Parameters
[in]factory: factory to be used
[in]parent: the parent node
[in]id: the identifier of the instance to be created
[in]nbCollections: number of collections for this partition
~Partition ( )

Destructor.

Member Function Documentation

int64_t estimateNbItems ( )
virtual

Return the (approximate) number of items. If a specific implementation doesn't know the value, it should return -1 by convention.

Returns
the number of items if known, -1 otherwise.

Implements Iterable< Type >.

void flush ( )

Flush the whole partition (ie flush each collection).

int64_t getNbItems ( )
virtual

Return the number of items. If a specific implementation doesn't know the value, it should return -1 by convention.

Returns
the number of items if known, -1 otherwise.

Implements Iterable< Type >.

u_int64_t getSizeItems ( )

Return the sum of the items size.

Returns
the total size.
dp::Iterator<Type>* iterator ( )
virtual

Create an iterator for the given Iterable instance.

Returns
the new iterator.

Implements Iterable< Type >.

collections::Collection<Type>& operator[] ( size_t  idx)

Get the ith collection

Parameters
[in]idx: index of the collection to be retrieved
Returns
the wanted collection.
void remove ( )
virtual

Remove physically the partition (ie. remove each collection).

Reimplemented from Group.

size_t size ( ) const

Return the number of collections for this partition.

Returns
the number of collections.

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