CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <jsonPropertiesDatabase.hh>
An implementation of PropertiesDatabase for reading/writing JSON.
Definition at line 52 of file jsonPropertiesDatabase.hh.
Public Types | |
typedef MappedProperties | value_type |
typedef PropertiesDatabaseIterator | iterator |
typedef Index | size_type |
typedef Base::MostDerived | MostDerived |
Public Member Functions | |
jsonPropertiesDatabase (const PrimClex &_primclex, std::string calc_type, fs::path location) | |
DatabaseBase & | open () override |
void | commit () override |
void | close () override |
void | from_json (jsonParser const &json) |
Clear all and read from JSON. More... | |
jsonParser & | to_json (jsonParser &json) const |
Export all to JSON. More... | |
iterator | begin () const override |
Begin iterator. More... | |
iterator | end () const override |
End iterator. More... | |
size_type | size () const override |
iterator | find_via_to (std::string to_configname) const override |
Return iterator to MappedProperties that is the best mapping to specified config. More... | |
iterator | find_via_origin (std::string origin) const override |
Return iterator to MappedProperties that is from the specified config. More... | |
std::set< std::string, Compare > | all_origins (std::string to_configname) const override |
Names of all configurations that relaxed 'origin'->'to'. More... | |
void | set_score_method (std::string to_configname, const ScoreMappedProperties &score) override |
Change the score method for a single configuration. More... | |
bool | empty () const |
ScoreMappedProperties | score_method (std::string to_configname) const |
Name of ScoreMappedProperties method. More... | |
double | best_score (std::string to_configname) const |
Best score of configurations that relaxed 'origin'->'to'. More... | |
double | score (std::string origin) const |
Score mapping 'origin'->'to'. More... | |
double | score (const MappedProperties &value) const |
Score mapping 'from'->'to'. More... | |
std::pair< iterator, bool > | insert (const MappedProperties &value) |
Insert data. More... | |
iterator | erase (iterator pos) |
Erase data. More... | |
size_type | erase_via_origin (std::string origin) |
Erase data. More... | |
const PrimClex & | primclex () const |
const Structure & | prim () const |
double | crystallography_tol () const |
Protected Member Functions | |
MostDerived & | derived () |
const MostDerived & | derived () const |
Private Member Functions | |
iterator | _iterator (jsonPropertiesDatabaseIterator::base_iterator _it) const |
std::pair< iterator, bool > | _insert (const MappedProperties &value) override |
Private _insert MappedProperties, without modifying 'relaxed_from'. More... | |
iterator | _erase (iterator pos) override |
Private _erase MappedProperties, without modifying 'relaxed_from'. More... | |
void | _set_all_origins (std::string to_configname, const std::set< std::string, Compare > &_set) override |
Names of all configurations that relaxed 'from'->'to'. More... | |
std::set< std::string, Compare > | _make_set (std::string to_configname, const ScoreMappedProperties &score) const |
Private Attributes | |
bool | m_is_open |
std::string | m_calc_type |
fs::path | m_location |
ScoreMappedProperties | m_default_score |
std::map< std::string, MappedProperties > | m_data |
std::map< std::string, std::set< std::string, Compare > > | m_origins |
const PrimClex * | m_primclex |
|
inherited |
Definition at line 215 of file PropertiesDatabase.hh.
|
inherited |
Definition at line 16 of file HasPrimClex.hh.
|
inherited |
Definition at line 216 of file PropertiesDatabase.hh.
|
inherited |
Definition at line 214 of file PropertiesDatabase.hh.
CASM::DB::jsonPropertiesDatabase::jsonPropertiesDatabase | ( | const PrimClex & | _primclex, |
std::string | calc_type, | ||
fs::path | location | ||
) |
Constructor
location | Where the JSON is read from on "open", written to on "commit". Can be used all in memory with empty location. |
Note: "_primclex" and "calc_type" are unused and will be removed in the future
Definition at line 12 of file jsonPropertiesDatabase.cc.
|
overrideprivatevirtual |
Private _erase MappedProperties, without modifying 'relaxed_from'.
Private _erase MappedProperties, without modifying 'origins'.
Implements CASM::DB::PropertiesDatabase.
Definition at line 186 of file jsonPropertiesDatabase.cc.
|
overrideprivatevirtual |
Private _insert MappedProperties, without modifying 'relaxed_from'.
Private _insert MappedProperties, without modifying 'origins'.
Implements CASM::DB::PropertiesDatabase.
Definition at line 180 of file jsonPropertiesDatabase.cc.
|
private |
Definition at line 173 of file jsonPropertiesDatabase.cc.
|
private |
Definition at line 210 of file jsonPropertiesDatabase.cc.
|
overrideprivatevirtual |
Names of all configurations that relaxed 'from'->'to'.
Names of all configurations that relaxed 'origin'->'to'.
Implements CASM::DB::PropertiesDatabase.
Definition at line 193 of file jsonPropertiesDatabase.cc.
|
overridevirtual |
Names of all configurations that relaxed 'origin'->'to'.
Implements CASM::DB::PropertiesDatabase.
Definition at line 137 of file jsonPropertiesDatabase.cc.
|
overridevirtual |
Begin iterator.
Implements CASM::DB::PropertiesDatabase.
Definition at line 101 of file jsonPropertiesDatabase.cc.
|
inlineinherited |
Best score of configurations that relaxed 'origin'->'to'.
Definition at line 254 of file PropertiesDatabase.hh.
|
overridevirtual |
Implements CASM::DB::DatabaseBase.
Definition at line 51 of file jsonPropertiesDatabase.cc.
|
overridevirtual |
Implements CASM::DB::DatabaseBase.
Definition at line 32 of file jsonPropertiesDatabase.cc.
|
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.
|
inlineinherited |
Definition at line 227 of file PropertiesDatabase.hh.
|
overridevirtual |
End iterator.
Implements CASM::DB::PropertiesDatabase.
Definition at line 106 of file jsonPropertiesDatabase.cc.
|
inherited |
Erase data.
Erase the 'origin' data element at provided iterator.
Definition at line 35 of file PropertiesDatabase.cc.
|
inlineinherited |
Erase data.
Definition at line 275 of file PropertiesDatabase.hh.
|
overridevirtual |
Return iterator to MappedProperties that is from the specified config.
Implements CASM::DB::PropertiesDatabase.
Definition at line 129 of file jsonPropertiesDatabase.cc.
|
overridevirtual |
Return iterator to MappedProperties that is the best mapping to specified config.
Implements CASM::DB::PropertiesDatabase.
Definition at line 118 of file jsonPropertiesDatabase.cc.
void CASM::DB::jsonPropertiesDatabase::from_json | ( | jsonParser const & | json | ) |
Clear all and read from JSON.
Definition at line 57 of file jsonPropertiesDatabase.cc.
|
inherited |
Insert data.
Definition at line 18 of file PropertiesDatabase.cc.
|
overridevirtual |
Implements CASM::DB::DatabaseBase.
Definition at line 20 of file jsonPropertiesDatabase.cc.
|
inherited |
Definition at line 19 of file HasPrimClex_impl.hh.
|
inlineinherited |
Definition at line 35 of file Database.hh.
|
inlineinherited |
Score mapping 'from'->'to'.
Definition at line 264 of file PropertiesDatabase.hh.
|
inlineinherited |
Score mapping 'origin'->'to'.
Definition at line 259 of file PropertiesDatabase.hh.
|
inlineinherited |
Name of ScoreMappedProperties method.
Definition at line 249 of file PropertiesDatabase.hh.
|
overridevirtual |
Change the score method for a single configuration.
Implements CASM::DB::PropertiesDatabase.
Definition at line 147 of file jsonPropertiesDatabase.cc.
|
overridevirtual |
Implements CASM::DB::PropertiesDatabase.
Definition at line 110 of file jsonPropertiesDatabase.cc.
jsonParser & CASM::DB::jsonPropertiesDatabase::to_json | ( | jsonParser & | json | ) | const |
Export all to JSON.
Definition at line 82 of file jsonPropertiesDatabase.cc.
|
private |
Definition at line 120 of file jsonPropertiesDatabase.hh.
|
private |
Definition at line 129 of file jsonPropertiesDatabase.hh.
|
private |
Definition at line 123 of file jsonPropertiesDatabase.hh.
|
private |
Definition at line 118 of file jsonPropertiesDatabase.hh.
|
private |
Definition at line 121 of file jsonPropertiesDatabase.hh.
|
private |
Definition at line 132 of file jsonPropertiesDatabase.hh.
|
privateinherited |
Definition at line 38 of file Database.hh.