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

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
 
ObjectHandleoperator= (ObjectHandle const &)=delete
 
virtual ~ObjectHandle ()=default
 
boost::string_ref name () const
 
Contextcontext () const
 Responsible context.
 
void construct (VariantMap const &params)
 Construct the handled object.
 
VariantMap get_parameters () const
 Get current parameters.
 
virtual Utils::Span< const boost::string_ref > valid_parameters () const
 Get required and optional parameters for class.
 
auto get_valid_parameters () 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.
 
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::Systemm_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.

Member Function Documentation

◆ bind_system()

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

◆ 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()

◆ on_detach_system()

virtual void ScriptInterface::System::Leaf::on_detach_system ( ::System::System )
inlineprivatevirtual

Callback triggered upon detaching a leaf from a system.

Reimplemented in ScriptInterface::Thermostat::Interface< CoreClass >.

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

Referenced by detach_system().

Member Data Documentation

◆ m_system


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