ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ScriptInterface::AutoParameter Struct Reference

Description and getter/setter for a parameter. More...

#include <AutoParameter.hpp>

Collaboration diagram for ScriptInterface::AutoParameter:

Classes

struct  WriteError
struct  ReadOnly

Public Member Functions

template<typename T, class O>
 AutoParameter (const char *name, std::shared_ptr< O > &obj, void(O::*setter)(T const &), T const &(O::*getter)() const)
 Read-write parameter that is bound to an object.
template<typename T, class O>
 AutoParameter (const char *name, std::shared_ptr< O > &obj, void(O::*setter)(T const &), T(O::*getter)() const)
 Read-write parameter that is bound to an object.
template<typename T, class O>
 AutoParameter (const char *name, std::shared_ptr< O > &obj, T const &(O::*getter)())
 Read-only parameter that is bound to an object.
template<typename T, class O>
 AutoParameter (const char *name, std::shared_ptr< O > &obj, T(O::*getter)() const)
 Read-only parameter that is bound to an object.
template<typename T, class O>
 AutoParameter (const char *name, std::shared_ptr< O > &obj, T O::*getter)
 Read-only parameter that is bound to an object.
template<typename T, class O>
 AutoParameter (const char *name, std::shared_ptr< O > &obj, T &(O::*getter_setter)())
 Read-write parameter that is bound to an object.
template<typename T>
 AutoParameter (const char *name, T &binding)
 Read-write parameter that is bound to an object.
template<typename T>
 AutoParameter (const char *name, T const &binding)
 Read-only parameter that is bound to an object.
template<typename Setter, typename Getter>
 AutoParameter (const char *name, Setter const &set, Getter const &get)
 Read-write parameter with a user-provided getter and setter.
template<typename Getter>
 AutoParameter (const char *name, ReadOnly, Getter const &get)
 Read-only parameter with a user-provided getter.
void set (Variant const &v) const
Variant get () const

Public Attributes

const std::string name
 The interface name.
const std::function< void(Variant const &)> setter_
 Set the parameter.
const std::function< Variant()> getter_
 Get the parameter.

Static Public Attributes

static constexpr const ReadOnly read_only = ReadOnly{}

Detailed Description

Description and getter/setter for a parameter.

This is to be used with AutoParameters.

Definition at line 36 of file AutoParameter.hpp.

Constructor & Destructor Documentation

◆ AutoParameter() [1/10]

template<typename T, class O>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
std::shared_ptr< O > & obj,
void(O::* setter )(T const &),
T const &(O::* getter )() const )
inline

Read-write parameter that is bound to an object.

Parameters
nameThe name the parameter should be bound to in the interface.
objThe object the parameter should be bound to.
setterThe setter.
getterThe getter.

Definition at line 52 of file AutoParameter.hpp.

References ScriptInterface::get_value(), name, and setter_.

◆ AutoParameter() [2/10]

template<typename T, class O>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
std::shared_ptr< O > & obj,
void(O::* setter )(T const &),
T(O::* getter )() const )
inline

Read-write parameter that is bound to an object.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 63 of file AutoParameter.hpp.

References ScriptInterface::get_value(), name, and setter_.

◆ AutoParameter() [3/10]

template<typename T, class O>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
std::shared_ptr< O > & obj,
T const &(O::* getter )() )
inline

Read-only parameter that is bound to an object.

Parameters
nameThe name the parameter should be bound to in the interface.
objThe object the parameter should be bound to.
getterThe getter.

Definition at line 77 of file AutoParameter.hpp.

References name, and setter_.

◆ AutoParameter() [4/10]

template<typename T, class O>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
std::shared_ptr< O > & obj,
T(O::* getter )() const )
inline

Read-only parameter that is bound to an object.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 86 of file AutoParameter.hpp.

References name, and setter_.

◆ AutoParameter() [5/10]

template<typename T, class O>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
std::shared_ptr< O > & obj,
T O::* getter )
inline

Read-only parameter that is bound to an object.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 95 of file AutoParameter.hpp.

References name, and setter_.

◆ AutoParameter() [6/10]

template<typename T, class O>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
std::shared_ptr< O > & obj,
T &(O::* getter_setter )() )
inline

Read-write parameter that is bound to an object.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 103 of file AutoParameter.hpp.

References ScriptInterface::get_value(), name, and setter_.

◆ AutoParameter() [7/10]

template<typename T>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
T & binding )
inline

Read-write parameter that is bound to an object.

Parameters
nameThe name the parameter should be bound to in the interface.
bindingThe reference the parameter should be bound to.

Definition at line 118 of file AutoParameter.hpp.

References ScriptInterface::get_value(), name, and setter_.

◆ AutoParameter() [8/10]

template<typename T>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
T const & binding )
inline

Read-only parameter that is bound to an object.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 127 of file AutoParameter.hpp.

References name, and setter_.

◆ AutoParameter() [9/10]

template<typename Setter, typename Getter>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
Setter const & set,
Getter const & get )
inline

Read-write parameter with a user-provided getter and setter.

Parameters
nameThe name the parameter should be bound to in the interface.
setA setter, which can be a Functor, a Lambda or a std::function that accepts a Variant const&.
getA getter, which can be a Functor, a Lambda or a std::function that return the parameter. The return type must be convertible to Variant.

Definition at line 142 of file AutoParameter.hpp.

References get(), getter_, name, set(), and setter_.

◆ AutoParameter() [10/10]

template<typename Getter>
ScriptInterface::AutoParameter::AutoParameter ( const char * name,
ReadOnly ,
Getter const & get )
inline

Read-only parameter with a user-provided getter.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 150 of file AutoParameter.hpp.

References get(), name, and setter_.

Member Function Documentation

◆ get()

Variant ScriptInterface::AutoParameter::get ( ) const
inline

Definition at line 168 of file AutoParameter.hpp.

References getter_.

Referenced by AutoParameter(), and AutoParameter().

◆ set()

void ScriptInterface::AutoParameter::set ( Variant const & v) const
inline

Definition at line 166 of file AutoParameter.hpp.

References setter_.

Referenced by AutoParameter().

Member Data Documentation

◆ getter_

const std::function<Variant()> ScriptInterface::AutoParameter::getter_

Get the parameter.

Definition at line 164 of file AutoParameter.hpp.

Referenced by AutoParameter(), and get().

◆ name

const std::string ScriptInterface::AutoParameter::name

◆ read_only

const ReadOnly ScriptInterface::AutoParameter::read_only = ReadOnly{}
staticconstexpr

Definition at line 42 of file AutoParameter.hpp.

Referenced by ScriptInterface::Interactions::AngleCosineBond::AngleCosineBond(), ScriptInterface::Interactions::AngleCossquareBond::AngleCossquareBond(), ScriptInterface::Interactions::AngleHarmonicBond::AngleHarmonicBond(), ScriptInterface::CollisionDetection::BindAtPointOfCollision::BindAtPointOfCollision(), ScriptInterface::CollisionDetection::BindCenters::BindCenters(), ScriptInterface::Interactions::BondedCoulomb::BondedCoulomb(), ScriptInterface::Interactions::BondedCoulombSR::BondedCoulombSR(), ScriptInterface::CellSystem::CellSystem::CellSystem(), ScriptInterface::Coulomb::CoulombMMM1D::CoulombMMM1D(), ScriptInterface::Coulomb::CoulombP3M::CoulombP3M(), ScriptInterface::Coulomb::CoulombScafacos::CoulombScafacos(), ScriptInterface::Observables::CylindricalLBProfileObservable< CoreCylLBObs >::CylindricalLBProfileObservable(), ScriptInterface::Observables::CylindricalPidProfileObservable< CoreObs >::CylindricalPidProfileObservable(), ScriptInterface::Math::CylindricalTransformationParameters::CylindricalTransformationParameters(), ScriptInterface::Coulomb::DebyeHueckel::DebyeHueckel(), ScriptInterface::Interactions::DihedralBond::DihedralBond(), ScriptInterface::Dipoles::DipolarDirectSum::DipolarDirectSum(), ScriptInterface::Dipoles::DipolarLayerCorrection::DipolarLayerCorrection(), ScriptInterface::Dipoles::DipolarP3M< Architecture >::DipolarP3M(), ScriptInterface::Dipoles::DipolarScafacos::DipolarScafacos(), ScriptInterface::walberla::EKReactant::do_construct(), ScriptInterface::walberla::EKContainer::EKContainer(), ScriptInterface::walberla::EKFFT::EKFFT(), ScriptInterface::walberla::EKIndexedReaction::EKIndexedReaction(), ScriptInterface::walberla::EKNone::EKNone(), ScriptInterface::walberla::EKPoissonSolverNode::EKPoissonSolverNode(), ScriptInterface::walberla::EKSpecies::EKSpecies(), ScriptInterface::walberla::EKSpeciesNode::EKSpeciesNode(), ScriptInterface::Coulomb::ElectrostaticLayerCorrection::ElectrostaticLayerCorrection(), ScriptInterface::Interactions::FeneBond::FeneBond(), ScriptInterface::CollisionDetection::GlueToSurface::GlueToSurface(), ScriptInterface::Writer::H5md::H5md(), ScriptInterface::Interactions::HarmonicBond::HarmonicBond(), ScriptInterface::Interactions::IBMTribend::IBMTribend(), ScriptInterface::Interactions::IBMTriel::IBMTriel(), ScriptInterface::Interactions::IBMVolCons::IBMVolCons(), ScriptInterface::Coulomb::ICCStar::ICCStar(), ScriptInterface::Interactions::InteractionDPD::InteractionDPD(), ScriptInterface::Thermostat::Interface< CoreClass >::Interface(), ScriptInterface::walberla::LatticeWalberla::LatticeWalberla(), ScriptInterface::walberla::LBFluid::LBFluid(), ScriptInterface::walberla::LBFluidNode::LBFluidNode(), ScriptInterface::Observables::LBProfileObservable< CoreLBObs >::LBProfileObservable(), ScriptInterface::LeesEdwards::LeesEdwards::LeesEdwards(), ScriptInterface::Interactions::InteractionPotentialInterface< CoreIA >::make_autoparameter(), ScriptInterface::ObjectList< AccumulatorBase, AutoParameters< ObjectList< AccumulatorBase, System::Leaf >, System::Leaf > >::ObjectList(), ScriptInterface::ObjectMap< BreakageSpec, AutoParameters< ObjectMap< BreakageSpec, System::Leaf >, System::Leaf > >::ObjectMap(), ScriptInterface::Interactions::OifGlobalForcesBond::OifGlobalForcesBond(), ScriptInterface::Interactions::OifLocalForcesBond::OifLocalForcesBond(), ScriptInterface::Observables::PairwiseDistances< CoreObs >::PairwiseDistances(), ScriptInterface::Particles::ParticleHandle::ParticleHandle(), ScriptInterface::Particles::ParticleSlice::ParticleSlice(), ScriptInterface::Observables::PidObservable< CorePidObs >::PidObservable(), ScriptInterface::Observables::PidProfileObservable< CoreObs >::PidProfileObservable(), ScriptInterface::Interactions::QuarticBond::QuarticBond(), ScriptInterface::Observables::RDF::RDF(), ScriptInterface::Coulomb::ReactionField::ReactionField(), ScriptInterface::Interactions::RigidBond::RigidBond(), ScriptInterface::Integrators::SteepestDescent::SteepestDescent(), ScriptInterface::Integrators::StokesianDynamics::StokesianDynamics(), ScriptInterface::Interactions::TabulatedAngleBond::TabulatedAngleBond(), ScriptInterface::Interactions::TabulatedDihedralBond::TabulatedDihedralBond(), ScriptInterface::Interactions::TabulatedDistanceBond::TabulatedDistanceBond(), ScriptInterface::Interactions::ThermalizedBond::ThermalizedBond(), ScriptInterface::Thermostat::Thermostat::Thermostat(), ScriptInterface::Integrators::VelocityVerletIsoNPT::VelocityVerletIsoNPT(), and ScriptInterface::walberla::VTKHandleBase< Field >::VTKHandleBase().

◆ setter_

const std::function<void(Variant const &)> ScriptInterface::AutoParameter::setter_

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