Gnash  0.8.10
Public Member Functions
gnash::abc::Class Class Reference

A class to represent AS3 Classes. More...

#include <Class.h>

List of all members.

Public Member Functions

 Class ()
void setDeclared ()
bool isDeclared ()
void setInherited ()
bool isInherited ()
void setSystem ()
void unsetSystem ()
bool isSystem ()
void setName (string_table::key name)
 Set our Name.
void dump ()
bool addValue (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type, as_value &val, bool isconst, bool isstatic)
bool addSlot (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type, bool isstatic)
bool addMethod (string_table::key name, Namespace *ns, Method *method, bool isstatic)
bool addGetter (string_table::key name, Namespace *ns, Method *method, bool isstatic)
bool addSetter (string_table::key name, Namespace *ns, Method *method, bool isstatic)
bool addMemberScript (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type, bool isstatic)
bool addSlotFunction (string_table::key name, Namespace *ns, boost::uint32_t slotID, Method *method, bool isstatic)
bool isFinal () const
 Is the class final?
void setFinal ()
 Set the class as final.
void unsetFinal ()
 Set the class as not final.
bool isSealed () const
 Is the class sealed?
void setSealed ()
 Set the class as sealed.
void unsetSealed ()
bool isInterface () const
 Is the class an interface type?
void setInterface ()
 Set the class as an interface.
void unsetInterface ()
 Set the class as not an interface.
bool isDynamic () const
 Is the class dynamic?
void setDynamic ()
 Set the class as dynamic.
void unsetDynamic ()
 Set the class as not dynamic.
bool hasProtectedNs () const
 Does the class have a protected namespace to be inherited?
NamespacegetProtectedNs ()
 Get the protected namespace.
void setProtectedNs (Namespace *n)
 Set the protected namespace.
string_table::key getName () const
 The global name of the class.
ClassgetSuper () const
 Retrieve the Class from which this Class derives.
void setSuper (Class *p)
 Set the Super Class.
void pushInterface (Class *p)
 We implement this interface.
void setConstructor (Method *m)
 Set the iinit method.
MethodgetConstructor () const
 Get the iinit method or 'constructor'.
void setStaticConstructor (Method *m)
 Set the cinit method.
MethodgetStaticConstructor () const
 Get the cinit method or 'static constructor'.
void addStaticTrait (const Trait &t)
void addInstanceTrait (const Trait &t)
PropertygetBinding (string_table::key name)
PropertygetGetBinding (as_value &v, abc::MultiName &n)
PropertygetSetBinding (as_value &v, abc::MultiName &n)
void initTraits (AbcBlock &bl)
 This initializes all the traits.
void setPrototype (as_object *prototype)
 Necessary for the current bogus implementation.
void initPrototype ()
 Necessary for the current bogus implementation.
as_objectgetPrototype ()
 Necessary for the current bogus implementation.

Detailed Description

A class to represent AS3 Classes.

Used to store ABC classes. These are not themselves AS-referenceable objects, but can be associated with AS3 Class objects in a way that is yet to be determined. TODO: update this documentation when we've worked it out. An abc::Class is a static description of an ActionScript Class. Classes have the following important properties: 1. A static initialization method ("cinit"). This is executed during the opcode NewClass, which is generally called only once per class. 2. A constructor method ("iinit"). This is run every time the Class is constructed. As not all Classes are constructed, the iinit method may never be executed. 3. A set of class Traits. 4. A set of instance Traits. Classes are parsed from the "instances" and "classes" section of an ABCBlock. Each of these contains the same number of entries. The iinit methods are found in the instances section, the cinit methods in the classes section.


Constructor & Destructor Documentation

gnash::abc::Class::Class ( ) [inline]

Member Function Documentation

bool gnash::abc::Class::addGetter ( string_table::key  name,
Namespace ns,
Method method,
bool  isstatic 
)
void gnash::abc::Class::addInstanceTrait ( const Trait t) [inline]
bool gnash::abc::Class::addMemberScript ( string_table::key  name,
Namespace ns,
boost::uint32_t  slotID,
Class type,
bool  isstatic 
)

References addSlot().

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

bool gnash::abc::Class::addMethod ( string_table::key  name,
Namespace ns,
Method method,
bool  isstatic 
)
bool gnash::abc::Class::addSetter ( string_table::key  name,
Namespace ns,
Method method,
bool  isstatic 
)
bool gnash::abc::Class::addSlot ( string_table::key  name,
Namespace ns,
boost::uint32_t  slotID,
Class type,
bool  isstatic 
)
bool gnash::abc::Class::addSlotFunction ( string_table::key  name,
Namespace ns,
boost::uint32_t  slotID,
Method method,
bool  isstatic 
)
void gnash::abc::Class::addStaticTrait ( const Trait t) [inline]
bool gnash::abc::Class::addValue ( string_table::key  name,
Namespace ns,
boost::uint32_t  slotID,
Class type,
as_value val,
bool  isconst,
bool  isstatic 
)
void gnash::abc::Class::dump ( )
Property* gnash::abc::Class::getBinding ( string_table::key  name) [inline]

References gnash::key::i.

Referenced by gnash::abc::Machine::setMember().

Method* gnash::abc::Class::getConstructor ( ) const [inline]

Get the iinit method or 'constructor'.

A Class is also valid if it does not have an iinit method, so this function can return 0.

Referenced by gnash::abc::Machine::execute(), gnash::abc::Machine::initMachine(), and gnash::abc::Machine::instantiateClass().

Property* gnash::abc::Class::getGetBinding ( as_value v,
abc::MultiName n 
)
string_table::key gnash::abc::Class::getName ( ) const [inline]
Namespace* gnash::abc::Class::getProtectedNs ( ) [inline]

Get the protected namespace.

as_object* gnash::abc::Class::getPrototype ( ) [inline]

Necessary for the current bogus implementation.

Referenced by gnash::abc::Machine::execute(), gnash::abc::Machine::instantiateClass(), and gnash::abc::Method::setOwner().

Property* gnash::abc::Class::getSetBinding ( as_value v,
abc::MultiName n 
)
Method* gnash::abc::Class::getStaticConstructor ( ) const [inline]

Get the cinit method or 'static constructor'.

A Class may have no cinit method, so this function can return 0.

Referenced by gnash::abc::Machine::execute().

Class* gnash::abc::Class::getSuper ( ) const [inline]

Retrieve the Class from which this Class derives.

Referenced by gnash::abc::Machine::findSuper().

bool gnash::abc::Class::hasProtectedNs ( ) const [inline]

Does the class have a protected namespace to be inherited?

void gnash::abc::Class::initPrototype ( )

Necessary for the current bogus implementation.

References gnash::get().

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

void gnash::abc::Class::initTraits ( AbcBlock bl)

This initializes all the traits.

Note: this is only necessary because the implementation is bogus. TODO: fix it.

References gnash::renderer::opengl::for_each(), gnash::abc::Trait::finalize(), and gnash::key::_1.

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

bool gnash::abc::Class::isDeclared ( ) [inline]
bool gnash::abc::Class::isDynamic ( ) const [inline]

Is the class dynamic?

bool gnash::abc::Class::isFinal ( ) const [inline]

Is the class final?

bool gnash::abc::Class::isInherited ( ) [inline]
bool gnash::abc::Class::isInterface ( ) const [inline]

Is the class an interface type?

bool gnash::abc::Class::isSealed ( ) const [inline]

Is the class sealed?

bool gnash::abc::Class::isSystem ( ) [inline]
void gnash::abc::Class::pushInterface ( Class p) [inline]

We implement this interface.

void gnash::abc::Class::setConstructor ( Method m) [inline]

Set the iinit method.

This is used to construct instances of the Class.

References gnash::key::m.

void gnash::abc::Class::setDeclared ( ) [inline]
void gnash::abc::Class::setDynamic ( ) [inline]

Set the class as dynamic.

void gnash::abc::Class::setFinal ( ) [inline]

Set the class as final.

void gnash::abc::Class::setInherited ( ) [inline]
void gnash::abc::Class::setInterface ( ) [inline]

Set the class as an interface.

void gnash::abc::Class::setName ( string_table::key  name) [inline]
void gnash::abc::Class::setProtectedNs ( Namespace n) [inline]

Set the protected namespace.

References gnash::key::n.

void gnash::abc::Class::setPrototype ( as_object prototype) [inline]

Necessary for the current bogus implementation.

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

void gnash::abc::Class::setSealed ( ) [inline]

Set the class as sealed.

void gnash::abc::Class::setStaticConstructor ( Method m) [inline]

Set the cinit method.

This is used to initialize the Class.

References gnash::key::m.

void gnash::abc::Class::setSuper ( Class p) [inline]

Set the Super Class.

This is the base class for this Class.

References gnash::key::p.

void gnash::abc::Class::setSystem ( ) [inline]
void gnash::abc::Class::unsetDynamic ( ) [inline]

Set the class as not dynamic.

void gnash::abc::Class::unsetFinal ( ) [inline]

Set the class as not final.

void gnash::abc::Class::unsetInterface ( ) [inline]

Set the class as not an interface.

void gnash::abc::Class::unsetSealed ( ) [inline]
void gnash::abc::Class::unsetSystem ( ) [inline]

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