Gnash  0.8.11dev
Public Types | Public Member Functions | List of all members
gnash::abc::Method Class Reference

#include <Method.h>

Public Types

typedef std::list< Class * > ArgumentList
 

Public Member Functions

 Method ()
 
std::uint32_t methodID () const
 
void setMethodID (std::uint32_t m)
 
void initPrototype (Machine *machine)
 
std::uint32_t getMaxRegisters ()
 
void setMaxRegisters (std::uint32_t maxRegisters)
 
std::uint32_t getBodyLength ()
 
void setBodyLength (std::uint32_t length)
 
void setMaxStack (std::uint32_t max)
 
std::uint32_t maxStack () const
 
void setMaxScope (std::uint32_t max)
 
std::uint32_t maxScope () const
 
void setScopeDepth (std::uint32_t depth)
 
std::uint32_t scopeDepth () const
 
abc_functiongetPrototype ()
 
void addTrait (const Trait &t)
 Add a Trait to this Method. More...
 
void initTraits (AbcBlock &bl)
 Initialize Traits. This is bogus. More...
 
asBindinggetBinding (string_table::key name)
 
bool isNative ()
 
bool hasBody () const
 
as_objectconstruct (as_object *)
 
bool needsActivation () const
 
void setNeedsActivation ()
 
CodeStreamgetBody ()
 
void setBody (CodeStream *b)
 
bool addValue (string_table::key name, Namespace *ns, std::uint32_t slotID, Class *type, as_value &val, bool isconst)
 
bool addSlot (string_table::key name, Namespace *ns, std::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, std::uint32_t slotID, Class *type)
 
bool addSlotFunction (string_table::key name, Namespace *ns, std::uint32_t slotID, Method *method)
 
void setOwner (Class *s)
 Set the owner of this method. More...
 
ClassgetReturnType () const
 Get the unique identifier for the return type. 0 is 'anything'. (This is the value of any dynamic property.) Id reference: Type. More...
 
void setReturnType (Class *t)
 Set the return type. More...
 
MethodgetSuper ()
 
void setSuper (Method *s)
 
bool isFinal () const
 Is the method final? If so, it may not be overridden. More...
 
void setFinal ()
 Set the method as final. More...
 
void unsetFinal ()
 Unset the method as final. Not final anymore. More...
 
bool isPrivate () const
 Is the method private? More...
 
void setPrivate ()
 Make the method private. More...
 
bool isProtected () const
 Is the method protected? More...
 
void setProtected ()
 Make the method protected. More...
 
bool isPublic () const
 Is the method public? More...
 
void setPublic ()
 Make the method public. More...
 
int minArgumentCount () const
 How many arguments are required? -1 means unknown. More...
 
void setMinArgumentCount (int i)
 Set the required minimum arguments. More...
 
int maxArgumentCount () const
 How many arguments are allowed? -1 means unknown. More...
 
void setMaxArgumentCount (int i)
 Set the required maximum arguments. More...
 
void pushArgument (Class *t)
 Push an argument of type t into the method definition. More...
 
void pushOptional (const as_value &v)
 Push an optional argument's default value. More...
 
bool optionalArguments () const
 Are any of the arguments optional? More...
 
const ArgumentListgetArgumentList () const
 Get a reference to a list of argument types. More...
 
as_functiongetImplementation ()
 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. More...
 
void print_body ()
 Print the opcodes that define a method using log_parse. More...
 

Detailed Description

A class to represent, abstractly, an ActionScript method.

Methods are unnamed until they are bound to an object.

Member Typedef Documentation

§ ArgumentList

Constructor & Destructor Documentation

§ Method()

gnash::abc::Method::Method ( )

Member Function Documentation

§ addGetter()

bool gnash::abc::Method::addGetter ( string_table::key  name,
Namespace ns,
Method method 
)

§ addMemberScript()

bool gnash::abc::Method::addMemberScript ( string_table::key  name,
Namespace ns,
std::uint32_t  slotID,
Class type 
)

References addSlot().

Referenced by gnash::abc::Trait::finalize_mbody().

§ addMethod()

bool gnash::abc::Method::addMethod ( string_table::key  name,
Namespace ns,
Method method 
)

§ addSetter()

bool gnash::abc::Method::addSetter ( string_table::key  name,
Namespace ns,
Method method 
)

§ addSlot()

bool gnash::abc::Method::addSlot ( string_table::key  name,
Namespace ns,
std::uint32_t  slotID,
Class type 
)

§ addSlotFunction()

bool gnash::abc::Method::addSlotFunction ( string_table::key  name,
Namespace ns,
std::uint32_t  slotID,
Method method 
)

§ addTrait()

void gnash::abc::Method::addTrait ( const Trait t)
inline

Add a Trait to this Method.

References name.

§ addValue()

bool gnash::abc::Method::addValue ( string_table::key  name,
Namespace ns,
std::uint32_t  slotID,
Class type,
as_value val,
bool  isconst 
)

§ construct()

as_object* gnash::abc::Method::construct ( as_object )
inline

§ getArgumentList()

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".

§ getBinding()

asBinding* gnash::abc::Method::getBinding ( string_table::key  name)

§ getBody()

CodeStream* gnash::abc::Method::getBody ( )
inline

§ getBodyLength()

std::uint32_t gnash::abc::Method::getBodyLength ( )
inline

§ getImplementation()

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.

References gnash::key::b.

§ getMaxRegisters()

std::uint32_t gnash::abc::Method::getMaxRegisters ( )
inline

§ getPrototype()

abc_function* gnash::abc::Method::getPrototype ( )
inline

§ getReturnType()

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.

§ getSuper()

Method* gnash::abc::Method::getSuper ( )

§ hasBody()

bool gnash::abc::Method::hasBody ( ) const
inline

§ initPrototype()

void gnash::abc::Method::initPrototype ( abc::Machine machine)

§ initTraits()

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().

Referenced by gnash::abc::AbcBlock::prepare().

§ isFinal()

bool gnash::abc::Method::isFinal ( ) const
inline

Is the method final? If so, it may not be overridden.

§ isNative()

bool gnash::abc::Method::isNative ( )
inline

§ isPrivate()

bool gnash::abc::Method::isPrivate ( ) const
inline

Is the method private?

§ isProtected()

bool gnash::abc::Method::isProtected ( ) const
inline

Is the method protected?

§ isPublic()

bool gnash::abc::Method::isPublic ( ) const
inline

Is the method public?

§ maxArgumentCount()

int gnash::abc::Method::maxArgumentCount ( ) const
inline

How many arguments are allowed? -1 means unknown.

Referenced by gnash::abc::AbcBlock::locateClass().

§ maxScope()

std::uint32_t gnash::abc::Method::maxScope ( ) const
inline

§ maxStack()

std::uint32_t gnash::abc::Method::maxStack ( ) const
inline

§ methodID()

std::uint32_t gnash::abc::Method::methodID ( ) const
inline

§ minArgumentCount()

int gnash::abc::Method::minArgumentCount ( ) const
inline

How many arguments are required? -1 means unknown.

§ needsActivation()

bool gnash::abc::Method::needsActivation ( ) const
inline

§ optionalArguments()

bool gnash::abc::Method::optionalArguments ( ) const
inline

Are any of the arguments optional?

§ print_body()

void gnash::abc::Method::print_body ( )

Print the opcodes that define a method using log_parse.

References gnash::key::i, gnash::log_parse(), gnash::CodeStream::read_as3op(), and gnash::CodeStream::seekTo().

§ pushArgument()

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'.

Referenced by gnash::abc::AbcBlock::locateClass().

§ pushOptional()

void gnash::abc::Method::pushOptional ( const as_value v)
inline

Push an optional argument's default value.

Referenced by gnash::abc::AbcBlock::locateClass().

§ scopeDepth()

std::uint32_t gnash::abc::Method::scopeDepth ( ) const
inline

§ setBody()

void gnash::abc::Method::setBody ( CodeStream b)
inline

§ setBodyLength()

void gnash::abc::Method::setBodyLength ( std::uint32_t  length)
inline

References length.

Referenced by gnash::abc::AbcBlock::locateClass().

§ setFinal()

void gnash::abc::Method::setFinal ( )
inline

Set the method as final.

§ setMaxArgumentCount()

void gnash::abc::Method::setMaxArgumentCount ( int  i)
inline

Set the required maximum arguments.

References gnash::key::i.

Referenced by gnash::abc::AbcBlock::locateClass().

§ setMaxRegisters()

void gnash::abc::Method::setMaxRegisters ( std::uint32_t  maxRegisters)
inline

§ setMaxScope()

void gnash::abc::Method::setMaxScope ( std::uint32_t  max)
inline

§ setMaxStack()

void gnash::abc::Method::setMaxStack ( std::uint32_t  max)
inline

§ setMethodID()

void gnash::abc::Method::setMethodID ( std::uint32_t  m)
inline

§ setMinArgumentCount()

void gnash::abc::Method::setMinArgumentCount ( int  i)
inline

Set the required minimum arguments.

References gnash::key::i.

Referenced by gnash::abc::AbcBlock::locateClass().

§ setNeedsActivation()

void gnash::abc::Method::setNeedsActivation ( )
inline

§ setOwner()

void gnash::abc::Method::setOwner ( Class s)

§ setPrivate()

void gnash::abc::Method::setPrivate ( )
inline

Make the method private.

§ setProtected()

void gnash::abc::Method::setProtected ( )
inline

Make the method protected.

§ setPublic()

void gnash::abc::Method::setPublic ( )
inline

Make the method public.

§ setReturnType()

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.

Referenced by gnash::abc::AbcBlock::locateClass().

§ setScopeDepth()

void gnash::abc::Method::setScopeDepth ( std::uint32_t  depth)
inline

§ setSuper()

void gnash::abc::Method::setSuper ( Method s)

§ unsetFinal()

void gnash::abc::Method::unsetFinal ( )
inline

Unset the method as final. Not final anymore.


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