MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Portal::Forma::CallTable< Source, Access > Class Template Reference

Functions a document calls by name, with the function's own parameter names as attributes. More...

#include <CallTable.hpp>

Inheritance diagram for MayaFlux::Portal::Forma::CallTable< Source, Access >:
Collaboration diagram for MayaFlux::Portal::Forma::CallTable< Source, Access >:

Public Types

using Maker
 Decodes a form element and the element holding it into a Placer, or nullopt with an error.
using Placer = typename FactoryTable<Source, Access>::Placer

Public Member Functions

bool contains (std::string_view name) const
template<auto Function>
requires Reflect::DescribedFunction<Function>
void expose_form (std::string name={})
 Register a described function that returns a Geometry::Form.
const Maker * find (std::string_view name) const
 The maker of this name, or nullptr.
bool merge (const CallTable &other, std::string_view prefix, std::string &error, bool replace=false)
 Add every call of another table under a name prefix.
std::vector< std::string > names () const
 Registered names in sorted order.

Private Attributes

Memory::FlatMap< std::string, Maker, std::less<> > m_makers

Detailed Description

template<typename Source, typename Access = Reflect::RecordAccess<Source>>
class MayaFlux::Portal::Forma::CallTable< Source, Access >

Functions a document calls by name, with the function's own parameter names as attributes.

A plain value like every table here. Registering a function needs nothing written about it: its generated Signature sidecar (MF_DESCRIBE_FUNCTION) supplies the parameter names, its own type supplies their types, and each attribute is decoded with TextCodec. A form element names the function and gives its arguments, as C++ passes them:

table.expose_form<&Geometry::horizontal_fader>();
// <element name="volume" state="0.5">
// <form call="horizontal_fader" bounds="-0.5 -0.1 0.5 0.1" handle_w="0.04"/>
// </element>
Form< float > horizontal_fader(Kinesis::AABB2D bounds, float handle_w, glm::vec3 track_color, glm::vec3 handle_color, const std::function< glm::vec2()> &live_offset)
Geometry function for a horizontal fader in NDC space.

A function returning a Geometry::Form of T makes an element whose state is a T, written in the element's state attribute as TextCodec of T reads it, and a T{} when it is absent, as Tend does.

Template Parameters
SourceElement type with a Reflect::RecordAccess specialization.

Definition at line 181 of file CallTable.hpp.


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