The Repository of DataSets. More...
#include <keyvalue/mngt/Repository.h>
Classes | |
| class | NotFound |
| Exception thrown by get() when a DataSet is not found. More... | |
Public Member Functions | |
| void | add (shared_ptr< DataSet > dataSet) |
| Inserts a DataSet into the Repository. | |
| bool | erase (const string &name) |
| Erases a DataSet from the Repository. | |
| size_t | clear () |
| Erases all DataSets from the Repository. | |
| shared_ptr< DataSet > | find (const string &name) const |
| Gets a DataSet stored by the Repository. | |
| shared_ptr< DataSet > | getDataSet (const string &name) const |
| Gets a DataSet stored by the Repository. | |
| size_t | getSize () const |
| Gets the current number of stored DataSets. | |
| value::Vector | getList () const |
| Gets the list of all stored DataSets. | |
Private Types | |
|
typedef ::std::map< string, shared_ptr< DataSet > > | Map_ |
| typedef Map_::value_type | Pair_ |
Private Attributes | |
| Map_ | map_ |
The Repository of DataSets.
Use util::Global to access the global Repository.
| void add | ( | shared_ptr< DataSet > | dataSet | ) |
Inserts a DataSet into the Repository.
If a DataSet with the same name already exists in the repository, then it will be destroyed and replaced by the new one.
If the DataSet name starts with '#', then nothing will be done.
Debug build asserts that name is not empty. Release build has undefined behaviour in this circumstance.
| dataSet | : Pointer to the DataSet to be inserted. |
| LogicError | : (Debug build only) If DataSet name is empty. |
| bool erase | ( | const string & | name | ) |
Erases a DataSet from the Repository.
| name | : The name of DataSet to be erased. |
true if the DataSet was found and erased. Otherwise it returns false. | size_t clear | ( | ) |
Erases all DataSets from the Repository.
| shared_ptr<DataSet> find | ( | const string & | name | ) | const |
Gets a DataSet stored by the Repository.
| name | : The name of the required DataSet. |
| shared_ptr<DataSet> getDataSet | ( | const string & | name | ) | const |
| size_t getSize | ( | ) | const |
| value::Vector getList | ( | ) | const |
1.7.1