#include <Method.h>
Public Types | |
typedef std::list< Class * > | ArgumentList |
Public Member Functions | |
Method () | |
boost::uint32_t | methodID () const |
void | setMethodID (boost::uint32_t m) |
void | initPrototype (Machine *machine) |
boost::uint32_t | getMaxRegisters () |
void | setMaxRegisters (boost::uint32_t maxRegisters) |
boost::uint32_t | getBodyLength () |
void | setBodyLength (boost::uint32_t length) |
void | setMaxStack (boost::uint32_t max) |
boost::uint32_t | maxStack () const |
void | setMaxScope (boost::uint32_t max) |
boost::uint32_t | maxScope () const |
void | setScopeDepth (boost::uint32_t depth) |
boost::uint32_t | scopeDepth () const |
abc_function * | getPrototype () |
void | addTrait (const Trait &t) |
Add a Trait to this Method. | |
void | initTraits (AbcBlock &bl) |
Initialize Traits. This is bogus. | |
asBinding * | getBinding (string_table::key name) |
bool | isNative () |
bool | hasBody () const |
as_object * | construct (as_object *) |
bool | needsActivation () const |
void | setNeedsActivation () |
CodeStream * | getBody () |
void | setBody (CodeStream *b) |
bool | addValue (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type, as_value &val, bool isconst) |
bool | addSlot (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type) |
bool | addMethod (string_table::key name, Namespace *ns, Method *method) |
bool | addGetter (string_table::key name, Namespace *ns, Method *method) |
bool | addSetter (string_table::key name, Namespace *ns, Method *method) |
bool | addMemberScript (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type) |
bool | addSlotFunction (string_table::key name, Namespace *ns, boost::uint32_t slotID, Method *method) |
void | setOwner (Class *s) |
Set the owner of this method. | |
Class * | getReturnType () const |
Get the unique identifier for the return type. 0 is 'anything'. (This is the value of any dynamic property.) Id reference: Type. | |
void | setReturnType (Class *t) |
Set the return type. | |
Method * | getSuper () |
void | setSuper (Method *s) |
bool | isFinal () const |
Is the method final? If so, it may not be overridden. | |
void | setFinal () |
Set the method as final. | |
void | unsetFinal () |
Unset the method as final. Not final anymore. | |
bool | isPrivate () const |
Is the method private? | |
void | setPrivate () |
Make the method private. | |
bool | isProtected () const |
Is the method protected? | |
void | setProtected () |
Make the method protected. | |
bool | isPublic () const |
Is the method public? | |
void | setPublic () |
Make the method public. | |
int | minArgumentCount () const |
How many arguments are required? -1 means unknown. | |
void | setMinArgumentCount (int i) |
Set the required minimum arguments. | |
int | maxArgumentCount () const |
How many arguments are allowed? -1 means unknown. | |
void | setMaxArgumentCount (int i) |
Set the required maximum arguments. | |
void | pushArgument (Class *t) |
Push an argument of type t into the method definition. | |
void | pushOptional (const as_value &v) |
Push an optional argument's default value. | |
bool | optionalArguments () const |
Are any of the arguments optional? | |
const ArgumentList & | getArgumentList () const |
Get a reference to a list of argument types. | |
as_function * | getImplementation () |
Get an object capable of executing this function. Note: This may be NULL, because we might have information about this function but not actually have it yet. | |
void | print_body () |
Print the opcodes that define a method using log_parse. |
A class to represent, abstractly, an ActionScript method.
Methods are unnamed until they are bound to an object.
typedef std::list<Class*> gnash::abc::Method::ArgumentList |
gnash::abc::Method::Method | ( | ) |
bool gnash::abc::Method::addGetter | ( | string_table::key | name, | |
Namespace * | ns, | |||
Method * | method | |||
) |
bool gnash::abc::Method::addMemberScript | ( | string_table::key | name, | |
Namespace * | ns, | |||
boost::uint32_t | slotID, | |||
Class * | type | |||
) |
References addSlot().
bool gnash::abc::Method::addMethod | ( | string_table::key | name, | |
Namespace * | ns, | |||
Method * | method | |||
) |
bool gnash::abc::Method::addSetter | ( | string_table::key | name, | |
Namespace * | ns, | |||
Method * | method | |||
) |
bool gnash::abc::Method::addSlot | ( | string_table::key | name, | |
Namespace * | ns, | |||
boost::uint32_t | slotID, | |||
Class * | type | |||
) |
References gnash::abc::Namespace::getURI(), and gnash::as_object::init_member().
Referenced by addMemberScript().
bool gnash::abc::Method::addSlotFunction | ( | string_table::key | name, | |
Namespace * | ns, | |||
boost::uint32_t | slotID, | |||
Method * | method | |||
) |
References addValue(), gnash::key::b, gnash::NSV::CLASS_FUNCTION, getPrototype(), and gnash::abc::Class::setName().
bool gnash::abc::Method::addValue | ( | string_table::key | name, | |
Namespace * | ns, | |||
boost::uint32_t | slotID, | |||
Class * | type, | |||
as_value & | val, | |||
bool | isconst | |||
) |
const ArgumentList& gnash::abc::Method::getArgumentList | ( | ) | const [inline] |
Get a reference to a list of argument types.
NB: Some values may be 0, meaning "any".
asBinding* gnash::abc::Method::getBinding | ( | string_table::key | name | ) |
CodeStream* gnash::abc::Method::getBody | ( | ) | [inline] |
Referenced by gnash::abc::abc_function::getCodeStream().
boost::uint32_t gnash::abc::Method::getBodyLength | ( | ) | [inline] |
as_function* gnash::abc::Method::getImplementation | ( | ) | [inline] |
Get an object capable of executing this function. Note: This may be NULL, because we might have information about this function but not actually have it yet.
boost::uint32_t gnash::abc::Method::getMaxRegisters | ( | ) | [inline] |
Referenced by gnash::abc::abc_function::getMaxRegisters().
abc_function* gnash::abc::Method::getPrototype | ( | ) | [inline] |
Class* gnash::abc::Method::getReturnType | ( | ) | const |
Get the unique identifier for the return type. 0 is 'anything'. (This is the value of any dynamic property.) Id reference: Type.
Method* gnash::abc::Method::getSuper | ( | ) |
bool gnash::abc::Method::hasBody | ( | ) | const [inline] |
void gnash::abc::Method::initPrototype | ( | abc::Machine * | machine | ) |
void gnash::abc::Method::initTraits | ( | AbcBlock & | bl | ) |
Initialize Traits. This is bogus.
TODO: fix!
References gnash::key::_1, gnash::abc::Trait::finalize(), and gnash::renderer::opengl::for_each().
bool gnash::abc::Method::isFinal | ( | ) | const [inline] |
Is the method final? If so, it may not be overridden.
bool gnash::abc::Method::isNative | ( | ) | [inline] |
bool gnash::abc::Method::isPrivate | ( | ) | const [inline] |
Is the method private?
bool gnash::abc::Method::isProtected | ( | ) | const [inline] |
Is the method protected?
bool gnash::abc::Method::isPublic | ( | ) | const [inline] |
Is the method public?
int gnash::abc::Method::maxArgumentCount | ( | ) | const [inline] |
How many arguments are allowed? -1 means unknown.
Referenced by optionalArguments().
boost::uint32_t gnash::abc::Method::maxScope | ( | ) | const [inline] |
boost::uint32_t gnash::abc::Method::maxStack | ( | ) | const [inline] |
boost::uint32_t gnash::abc::Method::methodID | ( | ) | const [inline] |
int gnash::abc::Method::minArgumentCount | ( | ) | const [inline] |
How many arguments are required? -1 means unknown.
Referenced by optionalArguments().
bool gnash::abc::Method::needsActivation | ( | ) | const [inline] |
Referenced by gnash::abc::abc_function::needsActivation().
bool gnash::abc::Method::optionalArguments | ( | ) | const [inline] |
Are any of the arguments optional?
References maxArgumentCount(), and minArgumentCount().
void gnash::abc::Method::print_body | ( | ) |
Print the opcodes that define a method using log_parse.
References gnash::key::i, gnash::CodeStream::read_as3op(), and gnash::CodeStream::seekTo().
void gnash::abc::Method::pushArgument | ( | Class * | t | ) | [inline] |
Push an argument of type t into the method definition.
A value of 0 stands for 'any'.
void gnash::abc::Method::pushOptional | ( | const as_value & | v | ) | [inline] |
Push an optional argument's default value.
boost::uint32_t gnash::abc::Method::scopeDepth | ( | ) | const [inline] |
void gnash::abc::Method::setBody | ( | CodeStream * | b | ) | [inline] |
void gnash::abc::Method::setBodyLength | ( | boost::uint32_t | length | ) | [inline] |
void gnash::abc::Method::setFinal | ( | ) | [inline] |
Set the method as final.
void gnash::abc::Method::setMaxArgumentCount | ( | int | i | ) | [inline] |
Set the required maximum arguments.
void gnash::abc::Method::setMaxRegisters | ( | boost::uint32_t | maxRegisters | ) | [inline] |
void gnash::abc::Method::setMaxScope | ( | boost::uint32_t | max | ) | [inline] |
void gnash::abc::Method::setMaxStack | ( | boost::uint32_t | max | ) | [inline] |
void gnash::abc::Method::setMethodID | ( | boost::uint32_t | m | ) | [inline] |
void gnash::abc::Method::setMinArgumentCount | ( | int | i | ) | [inline] |
Set the required minimum arguments.
void gnash::abc::Method::setNeedsActivation | ( | ) | [inline] |
void gnash::abc::Method::setOwner | ( | Class * | s | ) |
Set the owner of this method.
References gnash::abc::Class::getPrototype(), gnash::NSV::PROP_PROTOTYPE, and gnash::as_object::set_member().
void gnash::abc::Method::setPrivate | ( | ) | [inline] |
Make the method private.
void gnash::abc::Method::setProtected | ( | ) | [inline] |
Make the method protected.
void gnash::abc::Method::setPublic | ( | ) | [inline] |
Make the method public.
void gnash::abc::Method::setReturnType | ( | Class * | t | ) |
Set the return type.
TODO: This is currently a no-op, so find out what it's for and implement it. NB: the return type of a method can be * (any) or void, neither of which are known names, so this may not be an appropriate way to handle return type.
void gnash::abc::Method::setScopeDepth | ( | boost::uint32_t | depth | ) | [inline] |
void gnash::abc::Method::setSuper | ( | Method * | s | ) |
void gnash::abc::Method::unsetFinal | ( | ) | [inline] |
Unset the method as final. Not final anymore.