ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ScriptInterface::System::Leaf Class Reference

Script interface wrapper for a component of the system class. More...

#include <Leaf.hpp>

Inheritance diagram for ScriptInterface::System::Leaf:
Collaboration diagram for ScriptInterface::System::Leaf:

Public Member Functions

 ~Leaf () override=default
void bind_system (std::shared_ptr<::System::System > const &system)
void detach_system ()
Public Member Functions inherited from ScriptInterface::ObjectHandle
 ObjectHandle ()=default
 ObjectHandle (ObjectHandle const &)=delete
ObjectHandle & operator= (ObjectHandle const &)=delete
virtual ~ObjectHandle ()=default
std::string_view name () const
Context * context () const
 Responsible context.
void construct (VariantMap const &params)
 Construct the handled object.
virtual void do_construct (VariantMap const &params)
VariantMap get_parameters () const
 Get current parameters.
virtual std::vector< std::string_view > valid_parameters () const
 Get required and optional parameters for class.
virtual bool has_parameter (std::string const &needle) const
virtual Variant get_parameter (std::string const &name) const
 Get single parameter.
void set_parameter (const std::string &name, const Variant &value)
 Set single parameter.
virtual void do_set_parameter (const std::string &, const Variant &)
 Local implementation of set_parameter.
Variant call_method (const std::string &name, const VariantMap &params)
 Call a method on the object.
virtual Variant do_call_method (const std::string &, const VariantMap &)
 Local implementation of call_method.
std::string serialize () const
virtual std::vector< std::pair< std::string, Variant > > serialize_parameters () const
 Serialize parameters.

Protected Member Functions

auto const & get_system () const
auto & get_system ()

Protected Attributes

std::weak_ptr<::System::System > m_system

Private Member Functions

virtual void on_bind_system (::System::System &)
 Callback triggered upon binding a leaf to a system.
virtual void on_detach_system (::System::System &)
 Callback triggered upon detaching a leaf from a system.

Additional Inherited Members

Static Public Member Functions inherited from ScriptInterface::ObjectHandle
static ObjectRef deserialize (const std::string &state, Context &ctx)
 Make object from serialized state.

Detailed Description

Script interface wrapper for a component of the system class.

This class manages a core leaf object. A leaf can exist without a system, in which case the managed object cannot be fully initialized and has nothing to act upon. Binding a leaf to a system triggers an initialization of the managed object. Detaching a leaf may trigger a memory deallocation of the managed object resources, without deallocating the managed object itself. This behavior can be leveraged to implement move semantics. See System class design for more details.

Definition at line 44 of file script_interface/system/Leaf.hpp.

Constructor & Destructor Documentation

◆ ~Leaf()

ScriptInterface::System::Leaf::~Leaf ( )
overridedefault

Member Function Documentation

◆ bind_system()

void ScriptInterface::System::Leaf::bind_system ( std::shared_ptr<::System::System > const & system)
inline

Definition at line 68 of file script_interface/system/Leaf.hpp.

References m_system, and on_bind_system().

◆ detach_system()

void ScriptInterface::System::Leaf::detach_system ( )
inline

◆ get_system() [1/2]

auto & ScriptInterface::System::Leaf::get_system ( )
inlineprotected

Definition at line 59 of file script_interface/system/Leaf.hpp.

References m_system.

◆ get_system() [2/2]

◆ on_bind_system()

virtual void ScriptInterface::System::Leaf::on_bind_system ( ::System::System & )
inlineprivatevirtual

Callback triggered upon binding a leaf to a system.

Reimplemented in ScriptInterface::Analysis::Analysis, ScriptInterface::CellSystem::CellSystem, ScriptInterface::CollisionDetection::CollisionDetection, ScriptInterface::Coulomb::Actor< SIClass, CoreClass >, ScriptInterface::Coulomb::Actor< CoulombMMM1D, ::CoulombMMM1D >, ScriptInterface::Coulomb::Actor< CoulombScafacos, ::CoulombScafacos >, ScriptInterface::Coulomb::Actor< DebyeHueckel, ::DebyeHueckel >, ScriptInterface::Coulomb::Actor< ElectrostaticLayerCorrection, ::ElectrostaticLayerCorrection >, ScriptInterface::Coulomb::Actor< ReactionField, ::ReactionField >, ScriptInterface::Coulomb::Container, ScriptInterface::Coulomb::ElectrostaticLayerCorrection, ScriptInterface::Dipoles::Actor< SIClass, CoreClass >, ScriptInterface::Dipoles::Actor< DipolarDirectSum, ::DipolarDirectSum >, ScriptInterface::Dipoles::Actor< DipolarLayerCorrection, ::DipolarLayerCorrection >, ScriptInterface::Dipoles::Actor< DipolarScafacos, ::DipolarScafacos >, ScriptInterface::Dipoles::Container, ScriptInterface::Dipoles::DipolarLayerCorrection, ScriptInterface::Galilei::ComFixed, ScriptInterface::Galilei::Galilei, ScriptInterface::Integrators::IntegratorHandle, ScriptInterface::Interactions::NonBondedInteractions, ScriptInterface::LB::Container, ScriptInterface::LeesEdwards::LeesEdwards, ScriptInterface::Thermostat::Interface< CoreClass >, ScriptInterface::Thermostat::Interface<::BrownianThermostat >, ScriptInterface::Thermostat::Interface<::DPDThermostat >, ScriptInterface::Thermostat::Interface<::IsotropicNptThermostat >, ScriptInterface::Thermostat::Interface<::LangevinThermostat >, ScriptInterface::Thermostat::Interface<::LBThermostat >, ScriptInterface::Thermostat::Interface<::StokesianThermostat >, ScriptInterface::Thermostat::Interface<::ThermalizedBondThermostat >, and ScriptInterface::Thermostat::Thermostat.

Definition at line 46 of file script_interface/system/Leaf.hpp.

References ScriptInterface::System::System::System().

Referenced by bind_system().

◆ on_detach_system()

Member Data Documentation

◆ m_system


The documentation for this class was generated from the following file: