finally, first working prototype
This commit is contained in:
parent
d67a3c32eb
commit
5f90a21fe6
11 changed files with 193 additions and 112 deletions
13
database.h
13
database.h
|
@ -25,8 +25,6 @@
|
|||
#include <QDir>
|
||||
#include <lmdb.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
class DataBase
|
||||
{
|
||||
class _Table;
|
||||
|
@ -63,6 +61,17 @@ private:
|
|||
std::map<std::string, _Table*> tables;
|
||||
};
|
||||
|
||||
#include "exceptions.h"
|
||||
|
||||
template <class K, class V>
|
||||
DataBase::Table<K, V>* DataBase::addTable(const QString& p_name) {
|
||||
std::string nm = p_name.toStdString();
|
||||
if (opened) {
|
||||
throw Opened(name, nm);
|
||||
}
|
||||
DataBase::Table<K, V>* table = new DataBase::Table<K, V>(nm, this);
|
||||
tables.insert(std::make_pair(nm, (_Table*)table));
|
||||
return table;
|
||||
}
|
||||
|
||||
#endif // CORE_DATABASE_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue