![]() |
rego-cpp 1.0.0
A C++ implementation of the Rego language and runtime
|
This class implements a virtual machine that can execute compiled Rego bundles. More...
#include <rego.hh>
Public Member Functions | |
| Node | run_entrypoint (const Location &entrypoint, Node input) const |
| Executes the entrypoint plan in the bundle with the provided input. | |
| Node | run_query (Node input) const |
| Executes the query plan in the bundle with the provided input. | |
| VirtualMachine & | builtins (BuiltIns builtins) |
| Sets the built-in functions to use during execution. | |
| BuiltIns | builtins () const |
| Gets the built-in functions used during execution. | |
| VirtualMachine & | bundle (Bundle bundle) |
| Sets the bundle to use during execution. | |
| Bundle | bundle () const |
| Gets the bundle used during execution. | |
This class implements a virtual machine that can execute compiled Rego bundles.
For more information on the IR used by the virtual machine, see https://www.openpolicyagent.org/docs/ir.
| BuiltIns rego::VirtualMachine::builtins | ( | ) | const |
Gets the built-in functions used during execution.
| VirtualMachine & rego::VirtualMachine::builtins | ( | BuiltIns | builtins | ) |
Sets the built-in functions to use during execution.
| builtins | The built-in functions to use. |
| VirtualMachine & rego::VirtualMachine::bundle | ( | Bundle | bundle | ) |
Sets the bundle to use during execution.
| bundle | The bundle to use. |
| Node rego::VirtualMachine::run_entrypoint | ( | const Location & | entrypoint, |
| Node | input ) const |
Executes the entrypoint plan in the bundle with the provided input.
The entrypoint must have been specified when the bundle was built otherwise an error node will be returned.
| entrypoint | The name of the entrypoint plan to execute. |
| input | The input to the plan. |
| Node rego::VirtualMachine::run_query | ( | Node | input | ) | const |
Executes the query plan in the bundle with the provided input.
The bundle must have been built with a query plan, otherwise an error node will be returned.
| input | The input to the query. |