VirtualMachineInterface Class Reference

#include <vm.h>

Inheritance diagram for VirtualMachineInterface:

公共成员函数

MAXON_METHOD Result < void >  Init (const LoadRuntime &runtimeInfo, const DataDictionary &settings=DataDictionary::NullValue())
MAXON_METHOD void  Free ()
MAXON_METHOD Result < VirtualMachineScopeRef >  CreateScope ()
MAXON_METHOD String   GetName ()
MAXON_METHOD String   GetVersion ()
MAXON_METHOD String   GetCopyright ()
MAXON_METHOD String   GetCompiler ()
MAXON_METHOD String   GetBuildInfo ()
MAXON_METHOD Result < void >  EnterInteractiveMode ()
MAXON_METHOD Result < void >  Execute (const String &code)
MAXON_METHOD Result < void >  Execute (const Url &filepath)
MAXON_METHOD Result < void >  ExecuteModule (const String &name)
MAXON_METHOD Result < void >  GetDocumentString (const String &code, DocStringMeta &meta)
MAXON_METHOD LibraryRef  GetLibraryRef ()
MAXON_METHOD Result < BaseArray < Runtime > >  GetAllAvailableVirtualMachineLibraries () const

私有成员函数

  MAXON_INTERFACE ( VirtualMachineInterface , MAXON_REFERENCE_NORMAL , "net.maxon.python.interface.virtualmachine")

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( VirtualMachineInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.python.interface.virtualmachine"   
)
private

◆  Init()

MAXON_METHOD Result <void> Init ( const LoadRuntime runtimeInfo ,
const DataDictionary &  settings = DataDictionary::NullValue()  
)
参数
[in] runtimeInfo Information about the virtual machine, how to start it up.
[in] settings Optional settings which might be needed by the virtual machine.
返回
OK on success.

◆  Free()

MAXON_METHOD void Free ( )

Frees and shuts down the virtual machine. Should never be called on virtual machines which are owned by the system.

◆  CreateScope()

MAXON_METHOD Result <VirtualMachineScopeRef> CreateScope ( )

Creates a virtual machine scope. The scope must be deleted before the virtual machine will be shutdown.

返回
New virtual machine scope.

◆  GetName()

MAXON_METHOD String GetName ( )

Returns the name of the underlying library, e.g. "Python".

返回
Name of the virtual machine.

◆  GetVersion()

MAXON_METHOD String GetVersion ( )

Returns the human readable version string of the underlying library.

返回
Version details.

◆  GetCopyright()

MAXON_METHOD String GetCopyright ( )

Returns the human readable copyright information of the underlying library.

返回
Copyright text.

◆  GetCompiler()

MAXON_METHOD String GetCompiler ( )

Returns a human readable compiler info text.

返回
Compiler which got used to compile the underlying library.

◆  GetBuildInfo()

MAXON_METHOD String GetBuildInfo ( )

Returns a human readable build information.

返回
Build info with information about the build.

◆  EnterInteractiveMode()

MAXON_METHOD Result <void> EnterInteractiveMode ( )

Enters the interactive mode of the virtual machine.

返回
OK after the interactive mode was left, or FunctionNotImplementedError

◆  Execute() [1/2]

MAXON_METHOD Result <void> Execute ( const String code )

Executes a given code in the global scope of the virtual machine.

参数
[in] code Code to execute.
返回
Returns an error if an error occurred. Virtual machine clears all error states when function returns.

◆  Execute() [2/2]

MAXON_METHOD Result <void> Execute ( const Url filepath )

Executes a given file in the global scope of the virtual machine.

参数
[in] filepath Path of file to execute.
返回
Returns an error if an error occurred. Virtual machine clears all error states when function returns.

◆  ExecuteModule()

MAXON_METHOD Result <void> ExecuteModule ( const String name )

Executes a given module in the virtual machine.

参数
[in] name Name of the module.
返回
Returns an error if an error occurred. Virtual machine clears all error states when function returns.

◆  GetDocumentString()

MAXON_METHOD Result <void> GetDocumentString ( const String code ,
DocStringMeta meta  
)

Returns docstrings of a given code.

参数
[in] code String code.
[out] meta Returns the docstrings.
返回
Returns OK if the extraction succeeded, otherwise None.

◆  GetLibraryRef()

MAXON_METHOD LibraryRef GetLibraryRef ( )

Returns the underlying library.

返回
Underlying virtual machine library.

◆  GetAllAvailableVirtualMachineLibraries()

MAXON_METHOD Result < BaseArray < Runtime > > GetAllAvailableVirtualMachineLibraries ( ) const

Returns all available virtual machine libraries.

返回
An array of available virtual machines libraries.