Phasor 2.2.0
Stack VM based Programming Language
Loading...
Searching...
No Matches
Phasor::NativeRuntime Class Reference

CLI wrapper for running Phasor scripts and bytecode in-process. More...

#include <NativeRuntime.hpp>

Collaboration diagram for Phasor::NativeRuntime:
[legend]

Public Member Functions

 NativeRuntime (const std::vector< uint8_t > &bytecodeData, const int argc, const char **argv)
 NativeRuntime (const std::string &script, int argc, char **argv)
 ~NativeRuntime ()
int run ()
void addNativeFunction (const std::string &name, void *function)

Static Public Member Functions

static void eval (VM *vm, const std::string &script)

Private Attributes

Bytecode m_bytecode
std::vector< uint8_t > m_bytecodeData
std::string m_script
std::unique_ptr< VMm_vm
int m_argc
char ** m_argv

Detailed Description

CLI wrapper for running Phasor scripts and bytecode in-process.

Allows embedding and running Phasor scripts and bytecode within a native application.

Definition at line 18 of file NativeRuntime.hpp.

Constructor & Destructor Documentation

◆ NativeRuntime() [1/2]

Phasor::NativeRuntime::NativeRuntime ( const std::vector< uint8_t > & bytecodeData,
const int argc,
const char ** argv )

Definition at line 25 of file NativeRuntime.cpp.

Here is the call graph for this function:

◆ NativeRuntime() [2/2]

Phasor::NativeRuntime::NativeRuntime ( const std::string & script,
int argc,
char ** argv )

Definition at line 33 of file NativeRuntime.cpp.

Here is the call graph for this function:

◆ ~NativeRuntime()

Phasor::NativeRuntime::~NativeRuntime ( )

Definition at line 46 of file NativeRuntime.cpp.

Member Function Documentation

◆ addNativeFunction()

void Phasor::NativeRuntime::addNativeFunction ( const std::string & name,
void * function )

Definition at line 52 of file NativeRuntime.cpp.

Here is the caller graph for this function:

◆ eval()

void Phasor::NativeRuntime::eval ( VM * vm,
const std::string & script )
static

Definition at line 60 of file NativeRuntime.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

int Phasor::NativeRuntime::run ( )

Definition at line 74 of file NativeRuntime.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_argc

int Phasor::NativeRuntime::m_argc
private

Definition at line 34 of file NativeRuntime.hpp.

◆ m_argv

char** Phasor::NativeRuntime::m_argv
private

Definition at line 35 of file NativeRuntime.hpp.

◆ m_bytecode

Bytecode Phasor::NativeRuntime::m_bytecode
private

Definition at line 30 of file NativeRuntime.hpp.

◆ m_bytecodeData

std::vector<uint8_t> Phasor::NativeRuntime::m_bytecodeData
private

Definition at line 31 of file NativeRuntime.hpp.

◆ m_script

std::string Phasor::NativeRuntime::m_script
private

Definition at line 32 of file NativeRuntime.hpp.

◆ m_vm

std::unique_ptr<VM> Phasor::NativeRuntime::m_vm
private

Definition at line 33 of file NativeRuntime.hpp.


The documentation for this class was generated from the following files: