Falcon::CoreClass Class Reference

Representation of classes held in VM while executing code. More...

#include <cclass.h>

Inheritance diagram for Falcon::CoreClass:

Inheritance graph

List of all members.

Public Member Functions

Itemconstructor ()
const Itemconstructor () const
 CoreClass (const Symbol *sym, LiveModule *lmod, PropertyTable *pt)
 Creates an item representation of a live class.
CoreObjectcreateInstance (void *user_data=0, bool bDeserialize=false) const
 Creates an instance of this class.
bool derivedFrom (const String &className) const
 Returns true if the class is derived from a class with the given name.
void factory (ObjectFactory f)
ObjectFactory factory () const
void gcMark (uint32 mark)
 Marks the class and its inner data.
LiveModuleliveModule () const
const PropertyTableproperties () const
PropertyTableproperties ()
const Symbolsymbol () const
 ~CoreClass ()

Detailed Description

Representation of classes held in VM while executing code.

The Virtual Machine has his own image of the classes. Classes items are meant to i.e. access classes wide variables or classes methods.

Class Items are also used to create objects in a faster way. They maintain a copy of an empty object, that is just duplicated as-is via memcopy, making the creation of a new object a quite fast operation.

They also store a list of attributes that must be given at object after their creation. As the classes doesn't really has attributes, they do not participate in attribute loops and list; they just have to remember which attributes must be given to objects being constructed out of them.

Constructor & Destructor Documentation

Falcon::CoreClass::CoreClass ( const Symbol sym,
LiveModule lmod,
PropertyTable pt 

Creates an item representation of a live class.

The representation of the class nees a bit of extra informations that are provided by the virtual machine, other than the symbol that generated this item. The module id is useful as this object often refers to its module in the VM. Having the ID recorded here prevents the need to search for the live ID in the VM at critical times.

Falcon::CoreClass::~CoreClass (  ) 

Member Function Documentation

Item& Falcon::CoreClass::constructor (  )  [inline]

const Item& Falcon::CoreClass::constructor (  )  const [inline]

CoreObject* Falcon::CoreClass::createInstance ( void *  user_data = 0,
bool  bDeserialize = false 
) const

Creates an instance of this class.

The returned object and all its properties are stored in the same memory pool from which this instance is created. On a multithreading application, this method can only be called from inside the thread that is running the VM.

In some cases (e.g. de-serialization) the caller may wish not to have the object initialized and filled with attributes. The optional appedAtribs parameter may be passed false to have the caller to fill the instance with startup data.

This function never calls the constructor of the object.
user_data pre-allocated user data.
bDeserialize set to true if you are deserializing an instance (that is, if its constructor should not configure it).
The new instance of the Core Object.

bool Falcon::CoreClass::derivedFrom ( const String className  )  const

Returns true if the class is derived from a class with the given name.

This function scans the property table of the class (template properties) for an item with the given name, and if that item exists and it's a class item, then this method returns true.

className the name of a possibly parent class
true if the class is derived from a class having the given name

void Falcon::CoreClass::factory ( ObjectFactory  f  )  [inline]

ObjectFactory Falcon::CoreClass::factory (  )  const [inline]

void Falcon::CoreClass::gcMark ( uint32  mark  )  [virtual]

Marks the class and its inner data.

This marks the class, the livemodule it is bound to, the property table data and the ancestors.

Reimplemented from Falcon::Garbageable.

LiveModule* Falcon::CoreClass::liveModule (  )  const [inline]

const PropertyTable& Falcon::CoreClass::properties (  )  const [inline]

PropertyTable& Falcon::CoreClass::properties (  )  [inline]

const Symbol* Falcon::CoreClass::symbol (  )  const [inline]

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

Generated on Mon Oct 19 10:11:33 2009 for Falcon_Core by  doxygen 1.5.8