morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::author::Body< Action > Class Template Reference

An action body: the action's members with expressions in place of values (spec 5 §11). C++ cannot synthesise the action's struct with its members retyped, so a body lists {&Action::member, value} pairs. More...

#include <author.hpp>

Public Member Functions

 Body ()=default
 An empty body; the query or mutation sends an empty object.
 Body (std::initializer_list< BodyField< Action > > fields)
 A body.
bool empty () const noexcept
 Whether the body has no fields.
Json json () const
 The body's expression.

Detailed Description

template<typename Action>
class morph::ui::author::Body< Action >

An action body: the action's members with expressions in place of values (spec 5 §11). C++ cannot synthesise the action's struct with its members retyped, so a body lists {&Action::member, value} pairs.

Template Parameters
ActionThe action.

Definition at line 1501 of file author.hpp.

Constructor & Destructor Documentation

◆ Body()

template<typename Action>
morph::ui::author::Body< Action >::Body ( std::initializer_list< BodyField< Action > > fields)
inline

A body.

Parameters
fieldsThe fields, in order.

Definition at line 1508 of file author.hpp.

Member Function Documentation

◆ empty()

template<typename Action>
bool morph::ui::author::Body< Action >::empty ( ) const
inlinenodiscardnoexcept

Whether the body has no fields.

Returns
True when it has none.

Definition at line 1512 of file author.hpp.

◆ json()

template<typename Action>
Json morph::ui::author::Body< Action >::json ( ) const
inlinenodiscard

The body's expression.

Returns
{"obj": {...}}.

Definition at line 1516 of file author.hpp.


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