morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::detail::MutationRuntime Class Reference

A mutation at run time (spec 5 §5): concurrency, optimistic writes and the reply's effects. More...

#include <interpreter.hpp>

Public Member Functions

 MutationRuntime (MutationDecl const &decl, RtScope &scope, ModelAlias *alias)
 A mutation of scope.
 MutationRuntime (MutationRuntime const &)=delete
MutationRuntime & operator= (MutationRuntime const &)=delete
 MutationRuntime (MutationRuntime &&)=delete
MutationRuntime & operator= (MutationRuntime &&)=delete
 ~MutationRuntime ()
 Drops the replies still to come.
void run (Value body, std::shared_ptr< Bindings const > bindings, RunDone done)
 Runs it, queues the run or refuses it, as its concurrency says.
bool pending () const
 Whether a run is in flight or queued. A tracked read.
Value result () const
 The last applied result. A tracked read.
Value error () const
 The last applied failure's text, or null. A tracked read.
Value errorKind () const
 The last applied failure's kind, or null. A tracked read.
MutationDecl const & decl () const noexcept
 The declaration.
std::string const & typeId () const noexcept
 The model type.

Detailed Description

A mutation at run time (spec 5 §5): concurrency, optimistic writes and the reply's effects.

Definition at line 2016 of file interpreter.hpp.

Constructor & Destructor Documentation

◆ MutationRuntime()

morph::ui::detail::MutationRuntime::MutationRuntime ( MutationDecl const & decl,
RtScope & scope,
ModelAlias * alias )
inline

A mutation of scope.

Parameters
declThe declaration.
scopeThe scope.
aliasThe model alias it goes through.

Definition at line 3734 of file interpreter.hpp.

◆ ~MutationRuntime()

morph::ui::detail::MutationRuntime::~MutationRuntime ( )
inline

Drops the replies still to come.

Definition at line 3745 of file interpreter.hpp.

Member Function Documentation

◆ run()

void morph::ui::detail::MutationRuntime::run ( Value body,
std::shared_ptr< Bindings const > bindings,
RunDone done )
inline

Runs it, queues the run or refuses it, as its concurrency says.

Parameters
bodyThe body.
bindingsThe names bound where the run was started, for onSuccess and onError.
doneCalled once the run settles, or at once when it is refused.

Definition at line 3755 of file interpreter.hpp.

◆ pending()

bool morph::ui::detail::MutationRuntime::pending ( ) const
inlinenodiscard

Whether a run is in flight or queued. A tracked read.

Returns
It.

Definition at line 2040 of file interpreter.hpp.

◆ result()

Value morph::ui::detail::MutationRuntime::result ( ) const
inlinenodiscard

The last applied result. A tracked read.

Returns
It.

Definition at line 2044 of file interpreter.hpp.

◆ error()

Value morph::ui::detail::MutationRuntime::error ( ) const
inlinenodiscard

The last applied failure's text, or null. A tracked read.

Returns
It.

Definition at line 2048 of file interpreter.hpp.

◆ errorKind()

Value morph::ui::detail::MutationRuntime::errorKind ( ) const
inlinenodiscard

The last applied failure's kind, or null. A tracked read.

Returns
It.

Definition at line 2052 of file interpreter.hpp.

◆ decl()

MutationDecl const & morph::ui::detail::MutationRuntime::decl ( ) const
inlinenodiscardnoexcept

The declaration.

Returns
It.

Definition at line 2056 of file interpreter.hpp.

◆ typeId()

std::string const & morph::ui::detail::MutationRuntime::typeId ( ) const
inlinenodiscardnoexcept

The model type.

Returns
It.

Definition at line 2060 of file interpreter.hpp.


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