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  ReadOnly
 
struct  WriteError
 

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::*)(T const &)  setter,
T const &(O::*)() const  getter 
)
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.

◆ AutoParameter() [2/10]

template<typename T , class O >
ScriptInterface::AutoParameter::AutoParameter ( const char *  name,
std::shared_ptr< O > &  obj,
void(O::*)(T const &)  setter,
T(O::*)() const  getter 
)
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.

◆ 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.

◆ AutoParameter() [4/10]

template<typename T , class O >
ScriptInterface::AutoParameter::AutoParameter ( const char *  name,
std::shared_ptr< O > &  obj,
T(O::*)() const  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 86 of file AutoParameter.hpp.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

Member Function Documentation

◆ get()

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

Definition at line 168 of file AutoParameter.hpp.

References getter_.

◆ set()

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

Definition at line 166 of file AutoParameter.hpp.

References setter_.

Member Data Documentation

◆ getter_

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

Get the parameter.

Definition at line 164 of file AutoParameter.hpp.

Referenced by get().

◆ name

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

The interface name.

Definition at line 155 of file AutoParameter.hpp.

◆ read_only

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

Definition at line 42 of file AutoParameter.hpp.

Referenced by ScriptInterface::Coulomb::Actor< SIClass, CoreClass >::Actor(), ScriptInterface::Dipoles::Actor< SIClass, CoreClass >::Actor(), ScriptInterface::Interactions::BondedInteractions::BondedInteractions(), ScriptInterface::CellSystem::CellSystem::CellSystem(), ScriptInterface::Coulomb::CoulombMMM1D::CoulombMMM1D(), ScriptInterface::Coulomb::CoulombMMM1DGpu::CoulombMMM1DGpu(), ScriptInterface::Coulomb::CoulombP3M::CoulombP3M(), ScriptInterface::Coulomb::CoulombP3MGPU::CoulombP3MGPU(), ScriptInterface::Coulomb::CoulombScafacos::CoulombScafacos(), ScriptInterface::Observables::CylindricalLBProfileObservable< CoreCylLBObs >::CylindricalLBProfileObservable(), ScriptInterface::Observables::CylindricalPidProfileObservable< CoreObs >::CylindricalPidProfileObservable(), ScriptInterface::Math::CylindricalTransformationParameters::CylindricalTransformationParameters(), ScriptInterface::Coulomb::DebyeHueckel::DebyeHueckel(), ScriptInterface::Dipoles::DipolarBarnesHutGpu::DipolarBarnesHutGpu(), ScriptInterface::Dipoles::DipolarDirectSum::DipolarDirectSum(), ScriptInterface::Dipoles::DipolarLayerCorrection::DipolarLayerCorrection(), ScriptInterface::Dipoles::DipolarP3M::DipolarP3M(), ScriptInterface::Dipoles::DipolarScafacos::DipolarScafacos(), ScriptInterface::walberla::EKNone::do_construct(), ScriptInterface::walberla::EKReactant::do_construct(), ScriptInterface::walberla::EKContainer::EKContainer(), ScriptInterface::walberla::EKFFT::EKFFT(), ScriptInterface::walberla::EKIndexedReaction::EKIndexedReaction(), ScriptInterface::walberla::EKSpecies::EKSpecies(), ScriptInterface::walberla::EKSpeciesNode::EKSpeciesNode(), ScriptInterface::Coulomb::ElectrostaticLayerCorrection::ElectrostaticLayerCorrection(), ScriptInterface::Writer::H5md::H5md(), 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< ManagedType, BaseType >::ObjectList(), ScriptInterface::ObjectMap< ManagedType, BaseType, KeyType >::ObjectMap(), ScriptInterface::Particles::ParticleSlice::ParticleSlice(), ScriptInterface::Observables::PidObservable< CorePidObs >::PidObservable(), ScriptInterface::Observables::PidProfileObservable< CoreObs >::PidProfileObservable(), ScriptInterface::Observables::RDF::RDF(), ScriptInterface::ReactionMethods::ReactionAlgorithm::ReactionAlgorithm(), ScriptInterface::Coulomb::ReactionField::ReactionField(), ScriptInterface::ReactionMethods::SingleReaction::SingleReaction(), ScriptInterface::Integrators::SteepestDescent::SteepestDescent(), ScriptInterface::Integrators::StokesianDynamics::StokesianDynamics(), ScriptInterface::Thermostat::Thermostat::Thermostat(), ScriptInterface::Integrators::VelocityVerletIsoNPT::VelocityVerletIsoNPT(), and ScriptInterface::walberla::VTKHandleBase< Field >::VTKHandleBase().

◆ setter_

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

Set the parameter.

Definition at line 160 of file AutoParameter.hpp.

Referenced by set().


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