|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
A value only the host knows what to do with. More...
#include <cpp/a11/flow/values.h>
Public Member Functions | |
| virtual | ~HostObject ()=default |
| virtual std::string | Tag () const =0 |
| The tag the host knows this type by, for a message. | |
| virtual std::string | Text () const =0 |
What as_text gives: what the value is on the wire, not its repr. | |
| virtual bool | Truthy () const =0 |
| Whether the value counts as true. | |
| virtual std::optional< size_t > | Size () const =0 |
| How many things it holds, where that means anything. | |
| virtual Value | Field (std::string_view name) const =0 |
value.name, or a null value when there is no such field. | |
| virtual Value | Element (const Value &key) const =0 |
value[key]. | |
| virtual std::optional< Value > | FindField (std::string_view name) const |
| A field or element with its presence retained, including a null value. | |
| virtual std::optional< Value > | FindElement (const Value &key) const |
| virtual bool | Equals (const HostObject &other) const =0 |
Whether this is the same value as other, by the host's own equality. | |
A value only the host knows what to do with.
The language's own values are JSON-ish, plus durations, instants, bytes and chunks – everything a flow can write. But coerce validates into types a serialisation registry has been told about, and which types exist is the host's decision: a flow cannot import anything, so a11.sdk.Interaction is a pydantic model in the process running the flow and nothing the language can construct. So a coerced value is carried as one of these, and the language only ever asks it the questions an expression can ask: render it, index it, compare it, is it there.
A host object is immutable and shared: an item fans out to every reader of a stream, and copying a model per reader would be paid for in the host's allocator for nothing.
|
virtualdefault |
value[key].
Implemented in a11::flow::NodeReferenceObject, and a11::flow::NodeFragmentObject.
|
pure virtual |
Whether this is the same value as other, by the host's own equality.
Implemented in a11::flow::NodeReferenceObject, and a11::flow::NodeFragmentObject.
|
pure virtual |
value.name, or a null value when there is no such field.
Reading a field a producer did not send answers nothing rather than failing, which is what lets a flow say if not thing.field.
Implemented in a11::flow::NodeReferenceObject, and a11::flow::NodeFragmentObject.
|
virtual |
A field or element with its presence retained, including a null value.
Reimplemented in a11::flow::NodeReferenceObject, and a11::flow::NodeFragmentObject.
|
pure virtual |
How many things it holds, where that means anything.
Implemented in a11::flow::NodeReferenceObject, and a11::flow::NodeFragmentObject.
|
pure virtual |
The tag the host knows this type by, for a message.
Implemented in a11::flow::NodeReferenceObject, and a11::flow::NodeFragmentObject.
|
pure virtual |
What as_text gives: what the value is on the wire, not its repr.
Implemented in a11::flow::NodeReferenceObject, and a11::flow::NodeFragmentObject.
|
pure virtual |
Whether the value counts as true.
Implemented in a11::flow::NodeReferenceObject, and a11::flow::NodeFragmentObject.