Skip to main content

VrpcNative

API reference · Documentation

VrpcNative​

Client capable of creating proxy classes and objects to locally call functions as provided through native addons.

Kind: global class


new VrpcNative(adapter)​

Constructs a local caller object, able to communicate to natively added C++

Params

  • adapter Object - An adapter object, typically loaded as native addon

vrpcNative.getClass(className) ⇒​

Provides a proxy class to an existing one in the native addon

You can use the returned class in the usual way. Static function calls are forwarded to the native addon, as are any instantiations and member function calls.

Kind: instance method of VrpcNative
Returns: Proxy Class
Params

  • className String - The name of the class

vrpcNative.delete(proxy) ⇒​

Deletes a proxy object and its underlying instance

Kind: instance method of VrpcNative
Returns: True in case of success, false otherwise
Params

  • proxy Object - A proxy object

vrpcNative.callStatic(className, functionName, ...args) ⇒​

Secondary option to call a static function (when creation of a proxy class seems to be too much overhead)

Kind: instance method of VrpcNative
Returns: The output of the underlying static function
Params

  • className String - The class on which the static function should be called
  • functionName String - Name of the static function
  • ...args any - The function arguments

vrpcNative.getAvailableClasses() ⇒ Array.<String>​

Retrieves an array of all available classes (names only)

Kind: instance method of VrpcNative
Returns: Array.<String> - Array of class names