CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <ScelDatabase.hh>
Supercell references and pointers must remain valid, therefore the ScelDatabase implementation should typically be the same for different backends, differing only for open, commit, and close. This class should be inherited by those classes to implement all other required methods.
Database insert and emplace methods by convention do not enforce canonical forms. That logic is included in Supercell::insert, which is the safest way to insert new Supercell in the database. But in cases where it is known that a Supercell is generated in canonical form, the Database insert and emplace methods may be used directly.
Derived ScelDatabase must implement public methods:
Definition at line 32 of file ScelDatabase.hh.
Public Types | |
typedef DatabaseIterator< Supercell > | iterator |
typedef Supercell | value_type |
typedef Index | size_type |
typedef Base::MostDerived | MostDerived |
Public Member Functions | |
Database (const PrimClex &_primclex) | |
virtual | ~Database () |
iterator | begin () const override |
iterator | end () const override |
size_type | size () const override |
std::pair< iterator, bool > | insert (const Supercell &obj) override |
std::pair< iterator, bool > | insert (const Supercell &&obj) override |
template<typename... Args> | |
std::pair< iterator, bool > | emplace (Args &&... args) |
iterator | erase (iterator pos) override |
iterator | find (const std::string &name_or_alias) const override |
bool | empty () const |
std::pair< iterator, bool > | set_alias (const std::string &name_or_alias, const std::string &alias) |
For setting an alias. More... | |
std::string | name (const std::string &name_or_alias) const |
std::string | alias (const std::string &name_or_alias) const |
Get alias from name_or_alias. More... | |
void | insert (InputIt first, InputIt last) |
virtual iterator | erase (iterator pos)=0 |
size_type | erase (const std::string &name_or_alias) |
size_type | erase (const Supercell &obj) |
virtual size_type | count (const std::string &name_or_alias) const |
virtual void | commit ()=0 |
Selection< Supercell > & | master_selection () |
const Selection< Supercell > & | master_selection () const |
virtual DatabaseBase & | open ()=0 |
virtual void | close ()=0 |
const PrimClex & | primclex () const |
const Structure & | prim () const |
double | crystallography_tol () const |
Protected Types | |
typedef std::set< Supercell >::iterator | base_iterator |
Protected Member Functions | |
std::pair< iterator, bool > | _on_insert_or_emplace (const std::pair< base_iterator, bool > &result) |
void | clear () |
iterator | _iterator (base_iterator base_it) const |
void | read_aliases () |
void | write_aliases () |
void | clear_name (const _ValueType &obj) const |
Only ValDatabase<ValueType> is allowed to do clear_name. More... | |
void | set_id (const _ValueType &obj, Index id) const |
Only ValDatabase<ValueType> is allowed to do a const id change. More... | |
void | set_id (const _ValueType &obj, std::string id) const |
Only ValDatabase<ValueType> is allowed to do a const id change. More... | |
MostDerived & | derived () |
const MostDerived & | derived () const |
Protected Attributes | |
std::map< std::string, base_iterator > | m_name_to_scel |
std::set< Supercell > | m_scel_list |
Private Attributes | |
std::map< std::string, std::string > | m_name_to_alias |
std::map< std::string, std::string > | m_alias_to_name |
Selection< Supercell > | m_master_selection |
const PrimClex * | m_primclex |
|
protected |
Definition at line 61 of file ScelDatabase.hh.
|
inherited |
Definition at line 223 of file Database.hh.
|
inherited |
Definition at line 16 of file HasPrimClex.hh.
|
inherited |
Definition at line 225 of file Database.hh.
|
inherited |
Definition at line 224 of file Database.hh.
|
inline |
Definition at line 34 of file ScelDatabase.hh.
|
inlinevirtual |
Definition at line 36 of file ScelDatabase.hh.
|
protected |
Definition at line 66 of file ScelDatabase.cc.
|
protected |
Definition at line 48 of file ScelDatabase.cc.
|
inherited |
Get alias from name_or_alias.
Get alias from name_or_alias
Definition at line 250 of file Database_impl.hh.
|
overridevirtual |
Implements CASM::DB::ValDatabase< Supercell >.
Definition at line 6 of file ScelDatabase.cc.
|
protected |
Definition at line 61 of file ScelDatabase.cc.
|
inlineprotectedinherited |
Only ValDatabase<ValueType> is allowed to do clear_name.
Definition at line 298 of file Database.hh.
|
pure virtualinherited |
|
pure virtualinherited |
Implements CASM::DB::DatabaseBase.
Implemented in CASM::DB::jsonDatabase< Supercell >.
|
inlinevirtualinherited |
Definition at line 268 of file Database.hh.
|
inherited |
Definition at line 21 of file HasPrimClex_impl.hh.
|
inlineprotectedinherited |
Definition at line 13 of file CRTPBase.hh.
|
inlineprotectedinherited |
Definition at line 15 of file CRTPBase.hh.
|
inline |
Definition at line 49 of file ScelDatabase.hh.
|
inlineinherited |
Definition at line 236 of file Database.hh.
|
overridevirtual |
Implements CASM::DB::ValDatabase< Supercell >.
Definition at line 10 of file ScelDatabase.cc.
|
inlineinherited |
Definition at line 262 of file Database.hh.
|
inlineinherited |
Definition at line 266 of file Database.hh.
Definition at line 28 of file ScelDatabase.cc.
|
pure virtualinherited |
|
overridevirtual |
Implements CASM::DB::ValDatabase< Supercell >.
Definition at line 36 of file ScelDatabase.cc.
|
overridevirtual |
Implements CASM::DB::ValDatabase< Supercell >.
Definition at line 23 of file ScelDatabase.cc.
|
overridevirtual |
Implements CASM::DB::ValDatabase< Supercell >.
Definition at line 18 of file ScelDatabase.cc.
|
inlineinherited |
Definition at line 256 of file Database.hh.
|
inlineinherited |
Definition at line 285 of file Database.hh.
|
inlineinherited |
Definition at line 287 of file Database.hh.
|
inherited |
Get name from name_or_alias
Definition at line 247 of file Database_impl.hh.
|
pure virtualinherited |
|
inherited |
Definition at line 19 of file HasPrimClex_impl.hh.
|
inlineinherited |
Definition at line 35 of file Database.hh.
|
protectedinherited |
Definition at line 292 of file Database_impl.hh.
|
inherited |
For setting an alias.
Definition at line 239 of file Database_impl.hh.
|
inlineprotectedinherited |
Only ValDatabase<ValueType> is allowed to do a const id change.
Definition at line 304 of file Database.hh.
|
inlineprotectedinherited |
Only ValDatabase<ValueType> is allowed to do a const id change.
Definition at line 310 of file Database.hh.
|
overridevirtual |
Implements CASM::DB::ValDatabase< Supercell >.
Definition at line 14 of file ScelDatabase.cc.
|
protectedinherited |
Definition at line 294 of file Database_impl.hh.
|
privateinherited |
Definition at line 319 of file Database.hh.
|
privateinherited |
Definition at line 322 of file Database.hh.
|
privateinherited |
Definition at line 316 of file Database.hh.
|
protected |
Definition at line 70 of file ScelDatabase.hh.
|
privateinherited |
Definition at line 38 of file Database.hh.
|
protected |
Definition at line 71 of file ScelDatabase.hh.