PikaScript
Public Member Functions | List of all members
Pika::Script< Config >::Native Class Reference

Native is the base class for the native functions and objects that can be accessed from PikaScript. More...

#include <PikaScript.h>

Inheritance diagram for Pika::Script< Config >::Native:
Inheritance graph
[legend]

Public Member Functions

virtual Value pikaCall (Frame &)
 Process the PikaScript call. More...
 
virtual Value pikaCall (Frame &)
 Process the PikaScript call. More...
 

Detailed Description

template<class Config>
class Pika::Script< Config >::Native

Native is the base class for the native functions and objects that can be accessed from PikaScript.

It has a single virtual member function which should process a call to the native. Since natives are owned by the variable space once they are registered (and destroyed when the variable space destructs), they often act as simple bridges to other C++ functions and objects.

The easiest way to register a native is by calling one of the Frame::registerNative() member functions (typically on the "root frame"). You will find a couple of template functions there that allows you to register functors directly. They will create the necessary Native classes for you in the background.

Definition at line 459 of file PikaScript.h.

Member Function Documentation

template<class Config >
virtual Value Pika::Script< Config >::Native::pikaCall ( Frame )
inlinevirtual

Process the PikaScript call.

Arguments can be retrieved by getting $0, $1 etc from frame (via Frame::get() or Frame::getOptional()). If the function should not return a value, return Value() (which constructs a void value).

Definition at line 460 of file PikaScript.h.

template<class Config >
virtual Value Pika::Script< Config >::Native::pikaCall ( Frame )
inlinevirtual

Process the PikaScript call.

Arguments can be retrieved by getting $0, $1 etc from frame (via Frame::get() or Frame::getOptional()). If the function should not return a value, return Value() (which constructs a void value).

Definition at line 460 of file PikaScript.h.


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