Public Types |
Public Member Functions |
Public Attributes |
Static Public Attributes |
Friends |
List of all members
rBPF::VirtualMachine Class Reference
#include <VirtualMachine.h>
Collaboration diagram for rBPF::VirtualMachine:
Public Types | |
| using | Container = FSTR::Array< uint8_t > |
Public Member Functions | |||||
| VirtualMachine () | |||||
| Create an uninitialised VM. More... | |||||
| int | getLastError () const | ||||
| Get error code from last call to execute() More... | |||||
Create a VM and load a container | |||||
| |||||
| VirtualMachine (const Container &container, size_t stackSize=defaultStackSize) | |||||
| ~VirtualMachine () | |||||
| bool | load (const Container &container, size_t stackSize=defaultStackSize) | ||||
| Load container and initialise it. More... | |||||
| void | unload () | ||||
| Unload container and free any allocated resources. More... | |||||
Run the container | |||||
| |||||
| template<typename Context > | |||||
| int64_t | execute (Context &ctx) | ||||
| int64_t | execute (void *ctx, size_t ctxLength) | ||||
| int64_t | execute () | ||||
Public Attributes | |
| LocalStore | locals |
Static Public Attributes | |
| static constexpr size_t | defaultStackSize {512} |
| static GlobalStore | globals |
Friends | |
| class | LocalStore |
Member Typedef Documentation
◆ Container
| using rBPF::VirtualMachine::Container = FSTR::Array<uint8_t> |
Constructor & Destructor Documentation
◆ VirtualMachine() [1/2]
| rBPF::VirtualMachine::VirtualMachine | ( | ) |
Create an uninitialised VM.
◆ VirtualMachine() [2/2]
|
inline |
◆ ~VirtualMachine()
| rBPF::VirtualMachine::~VirtualMachine | ( | ) |
Member Function Documentation
◆ execute() [1/3]
|
inline |
◆ execute() [2/3]
template<typename Context >
|
inline |
◆ execute() [3/3]
| int64_t rBPF::VirtualMachine::execute | ( | void * | ctx, |
| size_t | ctxLength | ||
| ) |
◆ getLastError()
|
inline |
Get error code from last call to execute()
- Return values
-
int 0 on success. Retrieve text for error code using getErrorString()
◆ load()
| bool rBPF::VirtualMachine::load | ( | const Container & | container, |
| size_t | stackSize = defaultStackSize |
||
| ) |
Load container and initialise it.
- Return values
-
bool true on success
◆ unload()
| void rBPF::VirtualMachine::unload | ( | ) |
Unload container and free any allocated resources.
Friends And Related Function Documentation
◆ LocalStore
|
friend |
Member Data Documentation
◆ defaultStackSize
|
staticconstexpr |
◆ globals
|
static |
◆ locals
| LocalStore rBPF::VirtualMachine::locals |
The documentation for this class was generated from the following file:
1.9.1