Gnash  0.8.10
Public Member Functions
gnash::builtin_function Class Reference

This is a special type of function implementing AS-code in C++. More...

#include <builtin_function.h>

Inheritance diagram for gnash::builtin_function:
gnash::UserFunction gnash::as_function gnash::as_object gnash::GcResource

List of all members.

Public Member Functions

 builtin_function (Global_as &gl, ASFunction func)
 Construct a builtin function/class with a default interface.
virtual boost::uint8_t registers () const
 Return the number of registers required for function execution.
virtual as_value call (const fn_call &fn)
 Invoke this function or this Class constructor.
bool isBuiltin ()
 Return true if this is a built-in class.

Detailed Description

This is a special type of function implementing AS-code in C++.

Many functions (including classes) are implemented in ActionScript in the reference player. Gnash implements them in C++, but they must be treated like swf-defined functions. They are distinct from NativeFunctions, which are part of the player and do not go through the ActionScript interpreter.


Constructor & Destructor Documentation

gnash::builtin_function::builtin_function ( Global_as gl,
ASFunction  func 
) [inline]

Construct a builtin function/class with a default interface.

The default interface will have a constructor member set as 'this'

Parameters:
funcThe C function to call when this as_function is invoked. For classes, the function pointer is the constructor.

Member Function Documentation

virtual as_value gnash::builtin_function::call ( const fn_call fn) [inline, virtual]

Invoke this function or this Class constructor.

Implements gnash::as_function.

References gnash::getVM(), and assert.

bool gnash::builtin_function::isBuiltin ( ) [inline, virtual]

Return true if this is a built-in class.

Reimplemented from gnash::as_function.

virtual boost::uint8_t gnash::builtin_function::registers ( ) const [inline, virtual]

Return the number of registers required for function execution.

Gnash's C++ implementations of AS functions don't need any registers!

Implements gnash::UserFunction.


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