7 return _iterator(m_scel_list.begin());
11 return _iterator(m_scel_list.end());
15 return m_scel_list.size();
20 return _on_insert_or_emplace(m_scel_list.insert(obj));
25 return _on_insert_or_emplace(m_scel_list.insert(std::move(obj)));
30 base_iterator base_it =
static_cast<it_type *
>(pos.get())->base();
31 m_name_to_scel.erase(base_it->name());
32 master_selection().data().erase(base_it->name());
33 return _iterator(m_scel_list.erase(base_it));
37 const std::string &name_or_alias)
const {
38 std::string
name = this->
name(name_or_alias);
39 auto it = m_name_to_scel.find(
name);
40 if (it == m_name_to_scel.end()) {
41 return _iterator(m_scel_list.end());
43 return _iterator(it->second);
47 std::pair<Database<Supercell>::iterator,
bool>
49 const std::pair<base_iterator, bool> &result) {
54 m_name_to_scel.
insert(std::make_pair(obj.
name(), result.first));
55 master_selection().data().emplace(obj.
name(),
false);
58 return std::make_pair(_iterator(result.first), result.second);
62 m_name_to_scel.clear();
std::set< Supercell >::iterator base_iterator
DatabaseIterator for implementations using std::set<ValueType>
Represents a supercell of the primitive parent crystal structure.
std::pair< DB::DatabaseIterator< Supercell >, bool > insert() const
Insert the canonical form of this into the database.
GenericDatumFormatter< std::string, DataObject > name()
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.