gatb.core-API-0.0.0
|
Factory that creates instances related to the storage feature. More...
#include <Storage.hpp>
Public Member Functions | |
StorageFactory (StorageMode_e mode) | |
Storage * | create (const std::string &name, bool deleteIfExist, bool autoRemove, bool dont_add_extension=false, bool append=false) |
bool | exists (const std::string &name) |
Storage * | load (const std::string &name) |
Group * | createGroup (ICell *parent, const std::string &name) |
template<typename Type > | |
Partition< Type > * | createPartition (ICell *parent, const std::string &name, size_t nb) |
template<typename Type > | |
CollectionNode< Type > * | createCollection (ICell *parent, const std::string &name, system::ISynchronizer *synchro) |
Public Member Functions inherited from SmartPointer | |
void | use () |
void | forget () |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
Additional Inherited Members | |
Protected Member Functions inherited from SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Factory that creates instances related to the storage feature.
This class provides some createXXX methods for instantiations.
It also provides a few general methods like exists and load, so the name 'factory' may be not well choosen...
Example 1:
Example 2:
|
inline |
Constructor
[in] | mode | : kind of storage to be used (HDF5 for instance) |
Storage* create | ( | const std::string & | name, |
bool | deleteIfExist, | ||
bool | autoRemove, | ||
bool | dont_add_extension = false , |
||
bool | append = false |
||
) |
Create a Storage instance. This function is a bit of a misnomer: it can create a new storage instance and is also used to load an existing one.
[in] | name | : name of the instance to be created |
[in] | deleteIfExist | : if the storage exits in file system, delete it if true. |
[in] | autoRemove | : auto delete the storage from file system during Storage destructor. |
CollectionNode<Type>* createCollection | ( | ICell * | parent, |
const std::string & | name, | ||
system::ISynchronizer * | synchro | ||
) |
Create a Collection instance and attach it to a cell in a storage.
[in] | parent | : parent of the collection to be created |
[in] | name | : name of the collection to be created |
[in] | synchro | : synchronizer instance if needed |
bool exists | ( | const std::string & | name | ) |
Tells whether or not a Storage exists in file system given a name
[in] | name | : name of the storage to be checked |
|
inline |