mpqc::Registry< Key, Value > Class Template Reference
Documentation
template<typename Key, typename Value>
class mpqc::Registry< Key, Value >
a syntactically-sweet wrapper of std::map, not thread_safe for writing
Public Types | |
using | container_type = std::map< Key, Value > |
using | value_type = typename container_type::value_type |
using | iterator = typename container_type::iterator |
using | const_iterator = typename container_type::const_iterator |
Public Member Functions | |
Registry ()=default | |
Registry (const container_type &map) | |
Registry (Registry const &)=default | |
Registry & | operator= (Registry const &)=default |
Registry (Registry &&)=default | |
Registry & | operator= (Registry &&)=default |
virtual | ~Registry () |
const container_type & | registry () const |
return the registry More... | |
void | insert (const value_type &val) |
void | insert (const Key &key, const Value &val) |
void | update (const Key &key, const Value &val) |
update value which already exists in registry More... | |
void | update (const value_type &val) |
update value which already exists in registry More... | |
virtual void | remove (const Key &key) |
virtual void | clear () |
clears the contents of the registry More... | |
virtual Value * | retrieve_ptr (const Key &key) |
const Value * | retrieve_ptr (const Key &key) const |
bool | have (const Key &key) const |
check if have key in registry More... | |
Value & | retrieve (const Key &key) |
const Value & | retrieve (const Key &key) const |
template<typename Pred > | |
void | purge_if (const Pred &p) |
purges all objects if p(value_type) == true More... | |
Protected Attributes | |
container_type | registry_ |
Member Typedef Documentation
◆ const_iterator
template<typename Key , typename Value >
using mpqc::Registry< Key, Value >::const_iterator = typename container_type::const_iterator |
◆ container_type
template<typename Key , typename Value >
using mpqc::Registry< Key, Value >::container_type = std::map<Key, Value> |
◆ iterator
template<typename Key , typename Value >
using mpqc::Registry< Key, Value >::iterator = typename container_type::iterator |
◆ value_type
template<typename Key , typename Value >
using mpqc::Registry< Key, Value >::value_type = typename container_type:: value_type |
Constructor & Destructor Documentation
◆ Registry() [1/4]
template<typename Key , typename Value >
|
default |
◆ Registry() [2/4]
template<typename Key , typename Value >
|
inline |
◆ Registry() [3/4]
template<typename Key , typename Value >
|
default |
◆ Registry() [4/4]
template<typename Key , typename Value >
|
default |
◆ ~Registry()
template<typename Key , typename Value >
|
inlinevirtual |
Member Function Documentation
◆ clear()
template<typename Key , typename Value >
|
inlinevirtual |
clears the contents of the registry
◆ have()
template<typename Key , typename Value >
|
inline |
check if have key in registry
◆ insert() [1/2]
template<typename Key , typename Value >
|
inline |
insert {Key,Value} pair
- Note
val
is copied
◆ insert() [2/2]
template<typename Key , typename Value >
|
inline |
insert to registry by std::pair<Key, Value>, throw error if key already exist
◆ operator=() [1/2]
template<typename Key , typename Value >
|
default |
◆ operator=() [2/2]
template<typename Key , typename Value >
|
default |
◆ purge_if()
template<typename Key , typename Value >
template<typename Pred >
|
inline |
purges all objects if p(value_type) == true
◆ registry()
template<typename Key , typename Value >
|
inline |
return the registry
◆ remove()
template<typename Key , typename Value >
|
inlinevirtual |
remove Value by Key
- Parameters
-
[in] key a Key object referring to the item to be removed
- Note
- does not throw even if the item does not exist
◆ retrieve() [1/2]
template<typename Key , typename Value >
|
inline |
find item by key, return non-const reference to the value
- Parameters
-
key the item key
- Exceptions
-
ProgrammingError if key
not found
◆ retrieve() [2/2]
template<typename Key , typename Value >
|
inline |
find item by key, return const reference to the value
- Parameters
-
key the item key
- Exceptions
-
ProgrammingError if key
not found
◆ retrieve_ptr() [1/2]
template<typename Key , typename Value >
|
inlinevirtual |
retrieves pointer to an item
- Parameters
-
[in] key a Key object describing the item to be retrieved
- Returns
- nullptr if the item corresponding to
key
does not exist, otherwise return pointer
◆ retrieve_ptr() [2/2]
template<typename Key , typename Value >
|
inline |
retrieves pointer to an item
- Parameters
-
[in] key a Key object describing the item to be retrieved
- Returns
- nullptr if the item corresponding to
key
does not exist, otherwise return pointer
◆ update() [1/2]
template<typename Key , typename Value >
|
inline |
update value which already exists in registry
◆ update() [2/2]
template<typename Key , typename Value >
|
inline |
update value which already exists in registry
Member Data Documentation
◆ registry_
template<typename Key , typename Value >
|
mutableprotected |
The documentation for this class was generated from the following file:
- mpqc/chemistry/qc/lcao/expression/formula_registry.h