Phasor 3.3.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< u8 > &bytecodeData, const int argc, const char **argv)
 NativeRuntime (const Phasor::Bytecode &bytecode, const int argc, const char **argv)
 NativeRuntime (const std::string &script, const int argc, const char **argv)
 NativeRuntime (const Phasor::VM &vm, const std::string &script, const int argc, const char **argv)
 NativeRuntime (Phasor::VM *vm, const std::vector< u8 > &bytecodeData, const int argc, const char **argv)
 ~NativeRuntime ()
int run ()
int runFunctionInt (std::string functionName)
std::optional< std::string > runFunctionString (std::string functionName)
void addNativeFunction (const std::string &name, void *function)

Static Public Member Functions

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

Private Attributes

std::shared_ptr< Phasor::VMm_vm
Bytecode m_bytecode
std::vector< u8m_bytecodeData
std::string m_script
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 20 of file NativeRuntime.hpp.

Constructor & Destructor Documentation

◆ NativeRuntime() [1/5]

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

Definition at line 19 of file NativeRuntime.cpp.

Here is the call graph for this function:

◆ NativeRuntime() [2/5]

Phasor::NativeRuntime::NativeRuntime ( const Phasor::Bytecode & bytecode,
const int argc,
const char ** argv )

Definition at line 27 of file NativeRuntime.cpp.

◆ NativeRuntime() [3/5]

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

Definition at line 33 of file NativeRuntime.cpp.

Here is the call graph for this function:

◆ NativeRuntime() [4/5]

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

Definition at line 47 of file NativeRuntime.cpp.

◆ NativeRuntime() [5/5]

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

Definition at line 56 of file NativeRuntime.cpp.

Here is the call graph for this function:

◆ ~NativeRuntime()

Phasor::NativeRuntime::~NativeRuntime ( )

Definition at line 69 of file NativeRuntime.cpp.

Member Function Documentation

◆ addNativeFunction()

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

Definition at line 75 of file NativeRuntime.cpp.

◆ eval()

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

Definition at line 83 of file NativeRuntime.cpp.

Here is the call graph for this function:

◆ run()

int Phasor::NativeRuntime::run ( )

Definition at line 97 of file NativeRuntime.cpp.

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

◆ runFunctionInt()

int Phasor::NativeRuntime::runFunctionInt ( std::string functionName)

Definition at line 133 of file NativeRuntime.cpp.

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

◆ runFunctionString()

std::optional< std::string > Phasor::NativeRuntime::runFunctionString ( std::string functionName)

Definition at line 162 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 41 of file NativeRuntime.hpp.

◆ m_argv

char** Phasor::NativeRuntime::m_argv
private

Definition at line 42 of file NativeRuntime.hpp.

◆ m_bytecode

Bytecode Phasor::NativeRuntime::m_bytecode
private

Definition at line 38 of file NativeRuntime.hpp.

◆ m_bytecodeData

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

Definition at line 39 of file NativeRuntime.hpp.

◆ m_script

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

Definition at line 40 of file NativeRuntime.hpp.

◆ m_vm

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

Definition at line 37 of file NativeRuntime.hpp.


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