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.
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/value.hpp>
#include <cel/runtime/value_type.hpp>
Go to the source code of this file.
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:
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);
Checks stack effects while constructing a move-only ordinary operation sequence. Operations consume o...
Definition dyn_segment.hpp:227
void op1(F &&callback)
Consumes one exact operand and pushes R unless R is void. Follows op's callback, validation,...
Definition dyn_segment.hpp:457
void push_argument(std::size_t index, value_type type)
Emits a read that clones a borrowed positional input when the program executes. Repeated declarations...
Owns reusable canonical operand bytes and complete live-slot metadata. The owner outlives every borro...
Definition raw_stack.hpp:33
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. Removes cv/reference quali...
Definition value.hpp:363
Provides values, program builders, and reusable execution for C++20 runtime clients....