1 #ifndef CASM_jsonPropertiesDatabase
2 #define CASM_jsonPropertiesDatabase
4 #include <boost/filesystem/path.hpp>
11 class jsonPropertiesDatabase;
17 std::unique_ptr<jsonPropertiesDatabaseIterator>
clone()
const {
18 return std::unique_ptr<jsonPropertiesDatabaseIterator>(this->
_clone());
22 typedef typename std::map<std::string, MappedProperties>::const_iterator
68 void close()
override;
113 const std::set<std::string, Compare> &_set)
override;
115 std::set<std::string, Compare>
_make_set(
129 std::map<std::string, MappedProperties>
m_data;
132 std::map<std::string, std::set<std::string, Compare> >
m_origins;
Fully generic database interface for use by DatabaseHandler.
double score(std::string origin) const
Score mapping 'origin'->'to'.
Wrapper class for specializations PropertiesDatabaseIteratorBase.
An implementation of PropertiesDatabase for reading/writing JSON.
std::set< std::string, Compare > _make_set(std::string to_configname, const ScoreMappedProperties &score) const
size_type size() const override
jsonPropertiesDatabase(const PrimClex &_primclex, std::string calc_type, fs::path location)
ScoreMappedProperties m_default_score
void set_score_method(std::string to_configname, const ScoreMappedProperties &score) override
Change the score method for a single configuration.
iterator end() const override
End iterator.
std::map< std::string, std::set< std::string, Compare > > m_origins
std::set< std::string, Compare > all_origins(std::string to_configname) const override
Names of all configurations that relaxed 'origin'->'to'.
iterator find_via_origin(std::string origin) const override
Return iterator to MappedProperties that is from the specified config.
iterator begin() const override
Begin iterator.
iterator find_via_to(std::string to_configname) const override
Return iterator to MappedProperties that is the best mapping to specified config.
DatabaseBase & open() override
std::map< std::string, MappedProperties > m_data
iterator _erase(iterator pos) override
Private _erase MappedProperties, without modifying 'relaxed_from'.
std::pair< iterator, bool > _insert(const MappedProperties &value) override
Private _insert MappedProperties, without modifying 'relaxed_from'.
void from_json(jsonParser const &json)
Clear all and read from JSON.
void _set_all_origins(std::string to_configname, const std::set< std::string, Compare > &_set) override
Names of all configurations that relaxed 'from'->'to'.
jsonParser & to_json(jsonParser &json) const
Export all to JSON.
iterator _iterator(jsonPropertiesDatabaseIterator::base_iterator _it) const
long distance_to(const PropertiesDatabaseIteratorBase &other) const override
jsonPropertiesDatabaseIterator(base_iterator _it)
jsonPropertiesDatabaseIterator()
std::map< std::string, MappedProperties >::const_iterator base_iterator
jsonPropertiesDatabaseIterator * _clone() const override
void increment() override
friend jsonPropertiesDatabase
base_iterator base() const
std::unique_ptr< jsonPropertiesDatabaseIterator > clone() const
bool equal(const PropertiesDatabaseIteratorBase &other) const override
const MappedProperties & dereference() const override
PrimClex is the top-level data structure for a CASM project.
GenericDatumFormatter< std::string, Result > to_configname()