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< uint8_t > &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< uint8_t > &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< uint8_t > m_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 18 of file NativeRuntime.hpp.

Constructor & Destructor Documentation

◆ NativeRuntime() [1/5]

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

Definition at line 18 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 26 of file NativeRuntime.cpp.

◆ NativeRuntime() [3/5]

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

Definition at line 32 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 46 of file NativeRuntime.cpp.

◆ NativeRuntime() [5/5]

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

Definition at line 55 of file NativeRuntime.cpp.

Here is the call graph for this function:

◆ ~NativeRuntime()

Phasor::NativeRuntime::~NativeRuntime ( )

Definition at line 68 of file NativeRuntime.cpp.

Member Function Documentation

◆ addNativeFunction()

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

Definition at line 74 of file NativeRuntime.cpp.

◆ eval()

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

Definition at line 82 of file NativeRuntime.cpp.

Here is the call graph for this function:

◆ run()

int Phasor::NativeRuntime::run ( )

Definition at line 96 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 132 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 161 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 39 of file NativeRuntime.hpp.

◆ m_argv

char** Phasor::NativeRuntime::m_argv
private

Definition at line 40 of file NativeRuntime.hpp.

◆ m_bytecode

Bytecode Phasor::NativeRuntime::m_bytecode
private

Definition at line 36 of file NativeRuntime.hpp.

◆ m_bytecodeData

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

Definition at line 37 of file NativeRuntime.hpp.

◆ m_script

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

Definition at line 38 of file NativeRuntime.hpp.

◆ m_vm

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

Definition at line 35 of file NativeRuntime.hpp.


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