CASM
1.1.0
A Clusters Approach to Statistical Mechanics
DatabaseHandler.cc
Go to the documentation of this file.
1
#include "
casm/app/ProjectSettings.hh
"
2
#include "
casm/clex/PrimClex.hh
"
3
#include "
casm/database/DatabaseHandler_impl.hh
"
4
#include "
casm/database/json/jsonDatabase.hh
"
5
6
namespace
CASM
{
7
8
namespace
DB {
9
14
DatabaseHandler::DatabaseHandler
(
const
PrimClex
&_primclex)
15
: m_primclex(&_primclex),
16
m_default_db_name(m_primclex->settings().default_database_name()) {
17
jsonDB::insert
(*
this
);
18
}
19
20
DatabaseHandler::~DatabaseHandler
() {
close
(); }
21
22
const
PrimClex
&
DatabaseHandler::primclex
()
const
{
return
*
m_primclex
; }
23
25
void
DatabaseHandler::close
() {
26
for
(
auto
&
db
:
m_db
) {
27
db
.second->close();
28
}
29
}
30
31
}
// namespace DB
32
33
}
// namespace CASM
DatabaseHandler_impl.hh
PrimClex.hh
ProjectSettings.hh
CASM::DB::DatabaseHandler::m_primclex
const PrimClex * m_primclex
Definition:
DatabaseHandler.hh:175
CASM::DB::DatabaseHandler::primclex
const PrimClex & primclex() const
Definition:
DatabaseHandler.cc:22
CASM::DB::DatabaseHandler::m_db
map_type m_db
Definition:
DatabaseHandler.hh:181
CASM::DB::DatabaseHandler::db
Database< T > & db()
Access default Database<T>
Definition:
DatabaseHandler_impl.hh:50
CASM::DB::DatabaseHandler::close
void close()
Close all databases.
Definition:
DatabaseHandler.cc:25
CASM::DB::DatabaseHandler::DatabaseHandler
DatabaseHandler(const PrimClex &_primclex)
Definition:
DatabaseHandler.cc:14
CASM::DB::DatabaseHandler::~DatabaseHandler
~DatabaseHandler()
Definition:
DatabaseHandler.cc:20
CASM::PrimClex
PrimClex is the top-level data structure for a CASM project.
Definition:
PrimClex.hh:55
jsonDatabase.hh
CASM
Main CASM namespace.
Definition:
APICommand.hh:8
CASM::DB::jsonDB::insert
static void insert(DatabaseHandler &)
Definition:
jsonDatabase.cc:68
src
casm
database
DatabaseHandler.cc
Generated on Tue Mar 23 2021 14:16:47 for CASM by
1.9.1