ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Owning map of ObjectHandles. More...
#include <ObjectMap.hpp>
Public Types | |
using | Base = ObjectContainer< ObjectMap, ManagedType, BaseType > |
Public Member Functions | |
ObjectMap () | |
void | do_construct (VariantMap const ¶ms) override=0 |
void | insert (KeyType const &key, std::shared_ptr< ManagedType > const &element) |
Add an element to the map. | |
KeyType | insert (std::shared_ptr< ManagedType > const &element) |
Add an element to the map. | |
void | erase (KeyType const &key) |
Removes all occurrences of an element from the map. | |
auto const & | elements () const |
Map elements. | |
void | clear () |
Clear the map. | |
Protected Member Functions | |
Variant | do_call_method (std::string const &method, VariantMap const ¶meters) override |
void | restore_from_checkpoint (VariantMap const ¶ms) |
KeyType | get_key (Variant const &key) const |
Private Member Functions | |
virtual KeyType | insert_in_core (std::shared_ptr< ManagedType > const &obj_ptr)=0 |
virtual void | insert_in_core (KeyType const &key, std::shared_ptr< ManagedType > const &obj_ptr)=0 |
virtual void | erase_in_core (KeyType const &key)=0 |
Owning map of ObjectHandles.
ManagedType | Type of the managed objects, needs to be derived from ObjectHandle |
Definition at line 43 of file ObjectMap.hpp.
using ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::Base = ObjectContainer<ObjectMap, ManagedType, BaseType> |
Definition at line 45 of file ObjectMap.hpp.
|
inline |
Definition at line 58 of file ObjectMap.hpp.
References ScriptInterface::make_unordered_map_of_variants(), and ScriptInterface::AutoParameter::read_only.
|
inline |
Clear the map.
Definition at line 108 of file ObjectMap.hpp.
References ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::erase_in_core().
Referenced by ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::do_call_method().
|
inlineoverrideprotected |
Definition at line 117 of file ObjectMap.hpp.
References ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::clear(), ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::erase(), ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::get_key(), ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::insert(), ScriptInterface::make_unordered_map_of_variants(), and ScriptInterface::none.
Referenced by ScriptInterface::Interactions::BondedInteractions::do_call_method().
|
overridepure virtual |
|
inline |
Map elements.
Definition at line 103 of file ObjectMap.hpp.
|
inline |
Removes all occurrences of an element from the map.
key | Identifier of the element to remove. |
Definition at line 95 of file ObjectMap.hpp.
References ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::erase_in_core().
Referenced by ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::do_call_method().
|
privatepure virtual |
|
inlineprotected |
Definition at line 182 of file ObjectMap.hpp.
Referenced by ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::do_call_method(), and ScriptInterface::Interactions::BondedInteractions::do_call_method().
|
inline |
Add an element to the map.
key | Identifier of the element to add. |
element | The element to add. |
Definition at line 73 of file ObjectMap.hpp.
References ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::insert_in_core().
Referenced by ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::do_call_method().
|
inline |
Add an element to the map.
A free key is generated automatically.
element | The element to add. |
Definition at line 84 of file ObjectMap.hpp.
References ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::insert_in_core().
|
privatepure virtual |
|
privatepure virtual |
|
inlineprotected |
Definition at line 175 of file ObjectMap.hpp.
References ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::insert_in_core(), and params.
Referenced by ScriptInterface::Interactions::BondedInteractions::on_bind_system().