ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ScriptInterface::Context Class Referenceabstract

Context of an object handle. More...

#include <Context.hpp>

+ Inheritance diagram for ScriptInterface::Context:
+ Collaboration diagram for ScriptInterface::Context:

Public Member Functions

virtual void notify_call_method (const ObjectHandle *self, std::string const &name, VariantMap const &arguments)=0
 Call method on remote instances.
 
virtual void notify_set_parameter (const ObjectHandle *self, std::string const &name, Variant const &value)=0
 Set a parameter on remote instances.
 
virtual std::shared_ptr< ObjectHandlemake_shared (std::string const &name, const VariantMap &parameters)=0
 Get a new reference counted instance of a script interface by name.
 
virtual std::shared_ptr< ObjectHandlemake_shared_local (std::string const &name, VariantMap const &parameters)=0
 Get a new reference counted instance of a script interface by name.
 
virtual boost::string_ref name (const ObjectHandle *o) const =0
 Get the class name for an ObjectHandle instance.
 
virtual bool is_head_node () const =0
 
virtual void parallel_try_catch (std::function< void()> const &cb) const =0
 
virtual boost::mpi::communicator const & get_comm () const =0
 
virtual ~Context ()=default
 

Protected Member Functions

void set_context (ObjectHandle *o)
 Set the context of an object to this.
 

Detailed Description

Context of an object handle.

Each instance of ObjectHandle can have an attached context, which can e.g. synchronize distributed copies of the instance. The context does also provide facilities for serializing Objects into a string representation.

Definition at line 54 of file Context.hpp.

Constructor & Destructor Documentation

◆ ~Context()

virtual ScriptInterface::Context::~Context ( )
virtualdefault

Member Function Documentation

◆ get_comm()

◆ is_head_node()

◆ make_shared()

virtual std::shared_ptr< ObjectHandle > ScriptInterface::Context::make_shared ( std::string const &  name,
const VariantMap parameters 
)
pure virtual

Get a new reference counted instance of a script interface by name.

Objects created thru a Context get shared ownership of that context, e.g. the lifetime of the context is at least as long as the objects created by it. Therefore the object can always assume that the context is present.

Implemented in ScriptInterface::GlobalContext, and ScriptInterface::LocalContext.

Referenced by ScriptInterface::ObjectHandle::deserialize(), and ScriptInterface::ContextManager::make_shared().

◆ make_shared_local()

virtual std::shared_ptr< ObjectHandle > ScriptInterface::Context::make_shared_local ( std::string const &  name,
VariantMap const &  parameters 
)
pure virtual

Get a new reference counted instance of a script interface by name.

Objects created thru a Context get shared ownership of that context, e.g. the lifetime of the context is at least as long as the objects created by it. Therefore the object can always assume that the context is present.

Implemented in ScriptInterface::GlobalContext, and ScriptInterface::LocalContext.

◆ name()

virtual boost::string_ref ScriptInterface::Context::name ( const ObjectHandle o) const
pure virtual

Get the class name for an ObjectHandle instance.

This returns the name by which the object can be created.

Implemented in ScriptInterface::GlobalContext, and ScriptInterface::LocalContext.

◆ notify_call_method()

virtual void ScriptInterface::Context::notify_call_method ( const ObjectHandle self,
std::string const &  name,
VariantMap const &  arguments 
)
pure virtual

Call method on remote instances.

Parameters
selfInternal identifier of the instance
nameName of the method to call
argumentsArguments to the call

Implemented in ScriptInterface::LocalContext, and ScriptInterface::GlobalContext.

◆ notify_set_parameter()

virtual void ScriptInterface::Context::notify_set_parameter ( const ObjectHandle self,
std::string const &  name,
Variant const &  value 
)
pure virtual

Set a parameter on remote instances.

Parameters
selfInternal identifier of the instance to be modified
nameName of the parameter to change
valueValue to set it to

Implemented in ScriptInterface::LocalContext, and ScriptInterface::GlobalContext.

◆ parallel_try_catch()

virtual void ScriptInterface::Context::parallel_try_catch ( std::function< void()> const &  cb) const
pure virtual

Implemented in ScriptInterface::GlobalContext, and ScriptInterface::LocalContext.

Referenced by ScriptInterface::CellSystem::CellSystem::CellSystem(), ScriptInterface::CollisionDetection::CollisionDetection::do_call_method(), ScriptInterface::Accumulators::Correlator::do_call_method(), ScriptInterface::Accumulators::MeanVarianceCalculator::do_call_method(), ScriptInterface::Accumulators::TimeSeries::do_call_method(), ScriptInterface::Observables::Observable::do_call_method(), ScriptInterface::walberla::LatticeModel< Method, VTKHandle >::do_call_method(), ScriptInterface::Analysis::Analysis::do_call_method(), ScriptInterface::Particles::Polymer::do_call_method(), ScriptInterface::CellSystem::CellSystem::do_call_method(), ScriptInterface::Coulomb::CoulombScafacos::do_call_method(), ScriptInterface::Coulomb::ICCStar::do_call_method(), ScriptInterface::Interactions::InteractionPotentialInterface< CoreIA >::do_call_method(), ScriptInterface::LeesEdwards::LeesEdwards::do_call_method(), ScriptInterface::ReactionMethods::ReactionAlgorithm::do_call_method(), ScriptInterface::ReactionMethods::WidomInsertion::do_call_method(), ScriptInterface::walberla::EKSpeciesSlice::do_call_method(), ScriptInterface::walberla::LBFluid::do_call_method(), ScriptInterface::walberla::LBFluidSlice::do_call_method(), ScriptInterface::walberla::VTKHandleBase< Field >::do_call_method(), ScriptInterface::Accumulators::Correlator::do_construct(), ScriptInterface::walberla::LatticeWalberla::do_construct(), ScriptInterface::Interactions::InteractionPotentialInterface< CoreIA >::do_construct(), ScriptInterface::Coulomb::CoulombMMM1D::do_construct(), ScriptInterface::Coulomb::CoulombMMM1DGpu::do_construct(), ScriptInterface::Coulomb::CoulombP3M::do_construct(), ScriptInterface::Coulomb::CoulombP3MGPU::do_construct(), ScriptInterface::Coulomb::CoulombScafacos::do_construct(), ScriptInterface::Coulomb::DebyeHueckel::do_construct(), ScriptInterface::Coulomb::ElectrostaticLayerCorrection::do_construct(), ScriptInterface::Coulomb::ICCStar::do_construct(), ScriptInterface::Coulomb::ReactionField::do_construct(), ScriptInterface::Dipoles::DipolarBarnesHutGpu::do_construct(), ScriptInterface::Dipoles::DipolarDirectSum::do_construct(), ScriptInterface::Dipoles::DipolarDirectSumGpu::do_construct(), ScriptInterface::Dipoles::DipolarLayerCorrection::do_construct(), ScriptInterface::Dipoles::DipolarP3M::do_construct(), ScriptInterface::Dipoles::DipolarScafacos::do_construct(), ScriptInterface::Observables::CylindricalLBProfileObservable< CoreCylLBObs >::do_construct(), ScriptInterface::Observables::CylindricalPidProfileObservable< CoreObs >::do_construct(), ScriptInterface::Observables::LBProfileObservable< CoreLBObs >::do_construct(), ScriptInterface::Observables::PidObservable< CorePidObs >::do_construct(), ScriptInterface::Observables::PidProfileObservable< CoreObs >::do_construct(), ScriptInterface::ReactionMethods::ConstantpHEnsemble::do_construct(), ScriptInterface::ReactionMethods::ReactionEnsemble::do_construct(), ScriptInterface::ReactionMethods::SingleReaction::do_construct(), ScriptInterface::ReactionMethods::WidomInsertion::do_construct(), ScriptInterface::walberla::EKSpecies::do_construct(), ScriptInterface::walberla::LBFluid::do_construct(), ScriptInterface::walberla::VTKHandleBase< Field >::do_construct(), ScriptInterface::Thermostat::Interface< CoreClass >::get_member_handle(), ScriptInterface::ReactionMethods::ReactionAlgorithm::get_reaction_index(), ScriptInterface::Integrators::Integrator::integrate(), ScriptInterface::Integrators::IntegratorHandle::IntegratorHandle(), ScriptInterface::Thermostat::Interface< CoreClass >::Interface(), ScriptInterface::walberla::LBFluid::LBFluid(), ScriptInterface::Thermostat::LBThermostat::LBThermostat(), ScriptInterface::LeesEdwards::LeesEdwards::LeesEdwards(), ScriptInterface::Thermostat::Interface< CoreClass >::make_autogamma(), ScriptInterface::Thermostat::Interface< CoreClass >::make_autoparameter(), ScriptInterface::ReactionMethods::ReactionAlgorithm::ReactionAlgorithm(), and ScriptInterface::Thermostat::Thermostat::setup_thermostat().

◆ set_context()

void ScriptInterface::Context::set_context ( ObjectHandle o)
inlineprotected

Set the context of an object to this.

Parameters
oObject to set the context for.

Definition at line 102 of file Context.hpp.

Referenced by ScriptInterface::GlobalContext::make_shared(), ScriptInterface::LocalContext::make_shared(), and ScriptInterface::GlobalContext::make_shared_local().


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