runtime 1.1.4
Checked CEL programs, owned values, and reusable execution stacks
Loading...
Searching...
No Matches
runtime.hpp File Reference

Provides values, program builders, and reusable execution for C++20 runtime clients. More...

#include <cel/runtime/callable.hpp>
#include <cel/runtime/dyn_segment.hpp>
#include <cel/runtime/layout.hpp>
#include <cel/runtime/raw_stack.hpp>
#include <cel/runtime/record_adapter.hpp>
#include <cel/runtime/value.hpp>
#include <cel/runtime/value_type.hpp>

Go to the source code of this file.

Detailed Description

Provides values, program builders, and reusable execution for C++20 runtime clients.

Include this header and link to cel::runtime to build and evaluate programs. This library does not parse CEL source or register built-in operations.

See also
cel::dyn_segment and cel::raw_stack for cached execution and reusable storage.

Build a checked program and reuse its typed binding:

#include <cel/runtime.hpp>
builder.op1<double, double>([](double n) { return n * 2.0; });
auto program = std::move(builder).finish();
auto bound = program.prepare<double, double>();
const auto needed =
bound.requirements().for_prefix(stack.cursor(), stack.depth());
stack.reserve(needed.bytes.size, needed.bytes.alignment);
stack.reserve_depth(needed.slots);
auto result = bound.call(stack, 3.0); // 6.0; stack is empty again.
A move-only builder of checked, source-ordered operations.
Definition dyn_segment.hpp:249
void op1(F &&callback)
Emits a unary operation that consumes one exact operand and produces R unless it is void.
Definition dyn_segment.hpp:595
void push_argument(std::size_t index, value_type type)
Emits a read that clones a borrowed positional input when the program executes.
An exclusive owner of reusable canonical operand storage.
Definition raw_stack.hpp:47
void reserve(std::size_t bytes, std::size_t alignment)
Reserves bytes, alignment, and at least bytes live slots without changing the cursor.
value_type native_type()
Returns the runtime's complete descriptor for a trusted native value type.
Definition value.hpp:635
Provides values, program builders, and reusable execution for C++20 runtime clients.