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

A query at run time (spec 5 §5): a key over the scope, an entry of the session's cache, latest wins. More...

#include <interpreter.hpp>

Public Member Functions

 QueryRuntime (QueryDecl const &decl, RtScope &scope, ModelAlias *alias)
 A query of scope, not yet started.
 QueryRuntime (QueryRuntime const &)=delete
QueryRuntime & operator= (QueryRuntime const &)=delete
 QueryRuntime (QueryRuntime &&)=delete
QueryRuntime & operator= (QueryRuntime &&)=delete
 ~QueryRuntime ()
 Stops its timers and releases its entry.
void start ()
 Starts it: makes its key and the Effect that follows it, and its refresh timer.
Value value () const
 The value: the entry's, kept from the previous key while the new one has none. A tracked read.
bool pending () const
 Whether a request is in flight or waiting out its debounce. A tracked read.
Value error () const
 The failure's text, null when none. A tracked read.
Value errorKind () const
 The failure's kind, null when none. A tracked read.
bool settled () const
 Whether the query has a value or a failure for its current key, or is idle. A tracked read, for a boundary.
void refetch ()
 Refetches the current key now, ending a debounce wait.
void refetchCurrent ()
 Fetches the key its body has now, inside the batch that changed the body: switches to that key's entry when it differs from the current one, and fetches the current one otherwise. A backend switch uses it, so a body onBackendChange changed is fetched once, with what the recovery set, and the old key is not fetched first.
void invalidate ()
 Marks its entry stale and refetches it.
void detach ()
 Forgets its entry without releasing it: the session dropped the cache.
std::shared_ptr< CacheEntry > const & entry () const
 The current entry. A tracked read.
QueryDecl const & decl () const noexcept
 The declaration.
std::string const & typeId () const noexcept
 The model type.
std::shared_ptr< ModelChannel > channel () const
 The channel its alias is bound to now.

Detailed Description

A query at run time (spec 5 §5): a key over the scope, an entry of the session's cache, latest wins.

Definition at line 1902 of file interpreter.hpp.

Constructor & Destructor Documentation

◆ QueryRuntime()

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

A query of scope, not yet started.

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

Definition at line 3538 of file interpreter.hpp.

◆ ~QueryRuntime()

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

Stops its timers and releases its entry.

Definition at line 3549 of file interpreter.hpp.

Member Function Documentation

◆ start()

void morph::ui::detail::QueryRuntime::start ( )
inline

Starts it: makes its key and the Effect that follows it, and its refresh timer.

Definition at line 3561 of file interpreter.hpp.

◆ value()

Value morph::ui::detail::QueryRuntime::value ( ) const
inlinenodiscard

The value: the entry's, kept from the previous key while the new one has none. A tracked read.

Returns
It.

Definition at line 3690 of file interpreter.hpp.

◆ pending()

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

Whether a request is in flight or waiting out its debounce. A tracked read.

Returns
It.

Definition at line 3703 of file interpreter.hpp.

◆ error()

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

The failure's text, null when none. A tracked read.

Returns
It.

Definition at line 3711 of file interpreter.hpp.

◆ errorKind()

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

The failure's kind, null when none. A tracked read.

Returns
It.

Definition at line 3719 of file interpreter.hpp.

◆ settled()

bool morph::ui::detail::QueryRuntime::settled ( ) const
inlinenodiscard

Whether the query has a value or a failure for its current key, or is idle. A tracked read, for a boundary.

Returns
It.

Definition at line 3727 of file interpreter.hpp.

◆ refetch()

void morph::ui::detail::QueryRuntime::refetch ( )
inline

Refetches the current key now, ending a debounce wait.

Definition at line 3655 of file interpreter.hpp.

◆ refetchCurrent()

void morph::ui::detail::QueryRuntime::refetchCurrent ( )
inline

Fetches the key its body has now, inside the batch that changed the body: switches to that key's entry when it differs from the current one, and fetches the current one otherwise. A backend switch uses it, so a body onBackendChange changed is fetched once, with what the recovery set, and the old key is not fetched first.

Definition at line 3671 of file interpreter.hpp.

◆ invalidate()

void morph::ui::detail::QueryRuntime::invalidate ( )
inline

Marks its entry stale and refetches it.

Definition at line 1952 of file interpreter.hpp.

◆ detach()

void morph::ui::detail::QueryRuntime::detach ( )
inline

Forgets its entry without releasing it: the session dropped the cache.

Definition at line 1960 of file interpreter.hpp.

◆ entry()

std::shared_ptr< CacheEntry > const & morph::ui::detail::QueryRuntime::entry ( ) const
inlinenodiscard

The current entry. A tracked read.

Returns
It, or nullptr while idle.

Definition at line 1968 of file interpreter.hpp.

◆ decl()

QueryDecl const & morph::ui::detail::QueryRuntime::decl ( ) const
inlinenodiscardnoexcept

The declaration.

Returns
It.

Definition at line 1972 of file interpreter.hpp.

◆ typeId()

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

The model type.

Returns
It.

Definition at line 1976 of file interpreter.hpp.

◆ channel()

std::shared_ptr< ModelChannel > morph::ui::detail::QueryRuntime::channel ( ) const
inlinenodiscard

The channel its alias is bound to now.

Returns
It, or nullptr while the alias is unbound.

Definition at line 3558 of file interpreter.hpp.


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