some thoughts about exceptions
This commit is contained in:
parent
c3139974f1
commit
c491793387
9 changed files with 276 additions and 59 deletions
|
@ -89,10 +89,11 @@ QString Core::DataBase::getName() const
|
|||
|
||||
template <class K, class V>
|
||||
Core::DataBase::Table<K, V>* Core::DataBase::addTable(const QString& p_name) {
|
||||
std::string nm = p_name.toStdString();
|
||||
if (opened) {
|
||||
throw Core::DataBase::Opened(name);
|
||||
throw Core::DataBase::Opened(name, nm);
|
||||
}
|
||||
Core::DataBase::Table<K, V>* table = new Core::DataBase::Table<K, V>();
|
||||
tables.insert(std::make_pair(p_name.toStdString(), table));
|
||||
Core::DataBase::Table<K, V>* table = new Core::DataBase::Table<K, V>(nm, this);
|
||||
tables.insert(std::make_pair(nm, table));
|
||||
return table;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue