Public Types | Public Member Functions | Friends

gnash::abc::Trait Class Reference

Class describing a static property. More...

#include <AbcBlock.h>

Collaboration diagram for gnash::abc::Trait:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Kind {
  KIND_SLOT = 0, KIND_CONST = 6, KIND_METHOD = 1, KIND_GETTER = 2,
  KIND_SETTER = 3, KIND_CLASS = 4, KIND_FUNCTION = 5
}

Public Member Functions

 Trait ()
bool read (SWFStream *in, AbcBlock *block)
 Read an AS3 'trait'.
bool finalize (AbcBlock *block, abc::Class *cl, bool do_static)
bool finalize_mbody (AbcBlock *block, Method *m)
void set_target (abc::Class *cl, bool do_static)
void set_target (Method *m)
bool finalize (AbcBlock *block)

Friends

class AbcBlock

Detailed Description

Class describing a static property.

Traits are non-dynamic properties. That is, they are not deletable or modifiable in certain ways through ActionScript. They exist for reasons of performance. A property lookup on an object always checks the Traits before dynamic properties. Traits can belong to Methods, Classes, and Scripts. Classes have both instance and Class traits. TODO: Traits currently need finalization. This performs two tasks. At least one, and possibly both, are wrong: 1. Trait definitions contain references to AbcBlock definitions. Currently these references are resolved during finalization. It may be possible to do this during parsing. 2. Traits should be made available to ActionScript. Currently this is done by attaching them to an object. This is plain wrong and doesn't even work in many cases. TODO: As Traits are stored in the correct Class, Method etc, they do not need to store a target.


Member Enumeration Documentation

Enumerator:
KIND_SLOT 
KIND_CONST 
KIND_METHOD 
KIND_GETTER 
KIND_SETTER 
KIND_CLASS 
KIND_FUNCTION 

Constructor & Destructor Documentation

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

Member Function Documentation

bool gnash::abc::Trait::finalize ( AbcBlock block,
abc::Class cl,
bool  do_static 
)
bool gnash::abc::Trait::finalize ( AbcBlock block  )  [inline]

References finalize(), and finalize_mbody().

bool gnash::abc::Trait::finalize_mbody ( AbcBlock block,
Method m 
)

Referenced by finalize().

bool gnash::abc::Trait::read ( SWFStream in,
AbcBlock block 
)

Read an AS3 'trait'.

void gnash::abc::Trait::set_target ( Method m  )  [inline]
void gnash::abc::Trait::set_target ( abc::Class cl,
bool  do_static 
) [inline]

Friends And Related Function Documentation

friend class AbcBlock [friend]

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