Provides values, program builders, and reusable execution for C++20 runtime clients.
More...
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);
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.