This class uses runtime polymorphism without client-side inheritance: inheritance is confined to the internals of the this class, invisible to client-code. The class exclusively deals with ownership enabling client-side value semantics. Credit goes to Sean Parent at Adobe: https:/
- DiffEq() defaulted explicit
- Default constructor taking no arguments for Charm++.
template<typename T>DiffEq(T x) explicit
- Constructor taking an object modeling Concept.
template<typename T, typename... Args>DiffEq(std::function<T(Args...)> x, Args&&... args) explicit
- Constructor taking a function pointer to a constructor of an object modeling Concept.
- DiffEq(const DiffEq& x)
- Copy constructor.
- DiffEq(DiffEq&&) noexcept defaulted
- Move constructor.
- void initialize(int stream, tk::Particles& particles) const
- Public interface to setting the initial conditions for the diff eq.
void advance(tk::Particles& particles,
real dt, tk:: real t, const std::map<tk:: ctr:: Product, tk:: real>& moments) const
- Public interface to advancing particles in time by the diff eq.
- auto operator=(const DiffEq& x) -> DiffEq&
- Copy assignment.
- auto operator=(DiffEq&&) noexcept -> DiffEq& defaulted
- Move assignment.
template<typename T, typename... Args>
DiffEq:: DiffEq(std::function<T(Args...)> x,
Args&&... args) explicit
Constructor taking a function pointer to a constructor of an object modeling Concept.
|x in||Function pointer to a constructor of an object modeling Concept.|
|args in||Zero or more constructor arguments|
Passing std::function allows late execution of the constructor, i.e., as late as inside this class' constructor, and thus usage from a factory. Note that there are at least two different ways of using this constructor:
- Bind T's constructor arguments and place it in std::function<T()> and passing no arguments as args.... This case then instantiates the model via its constructor and stores it in here.
Bind a single placeholder argument to T's constructor and pass it in as host's args..., which then forwards it to model's constructor. This allows late binding, i.e., binding the argument only here.