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 ()
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_functiongetPrototype ()
void addTrait (const Trait &t)
 Add a Trait to this Method.
void initTraits (AbcBlock &bl)
 Initialize Traits. This is bogus.
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, 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.
ClassgetReturnType () 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.
MethodgetSuper ()
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 ArgumentListgetArgumentList () const
 Get a reference to a list of argument types.
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.
void print_body ()
 Print the opcodes that define a method using log_parse.

Detailed Description

A class to represent, abstractly, an ActionScript method.

Methods are unnamed until they are bound to an object.

Member Typedef Documentation

Constructor & Destructor Documentation

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

Member Function Documentation

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

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

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 
)
bool gnash::abc::Method::addSlotFunction ( string_table::key  name,
Namespace ns,
boost::uint32_t  slotID,
Method method 
)
void gnash::abc::Method::addTrait ( const Trait t)
inline

Add a Trait to this Method.

bool gnash::abc::Method::addValue ( string_table::key  name,
Namespace ns,
boost::uint32_t  slotID,
Class type,
as_value val,
bool  isconst 
)
as_object* gnash::abc::Method::construct ( as_object )
inline
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
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
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().

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

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

References gnash::key::b.

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

References length.

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

Set the method as final.

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

Set the required maximum arguments.

References gnash::key::i.

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

References gnash::key::m.

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

Set the required minimum arguments.

References gnash::key::i.

void gnash::abc::Method::setNeedsActivation ( )
inline
void gnash::abc::Method::setOwner ( Class s)
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.


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