Falcon::VarDef Class Reference

Variable initial value definition. More...

#include <vardef.h>

Inheritance diagram for Falcon::VarDef:

Inheritance graph
[legend]

List of all members.

Public Types


Public Member Functions

bool asBool () const
int64 asInteger () const
numeric asNumeric () const
t_reflection asReflecMode () const
uint32 asReflecOffset () const
void * asReflectFuncData () const
reflectionFunc asReflectFuncFrom () const
reflectionFunc asReflectFuncTo () const
const StringasString () const
SymbolasSymbol () const
bool isBaseClass () const
bool isBool () const
bool isInteger () const
bool isNil () const
bool isNumeric () const
bool isReadOnly () const
bool isReference () const
bool isReflectFunc () const
bool isReflective () const
bool isString () const
bool isSymbol () const
bool load (Module *mod, Stream *in)
bool save (Stream *out) const
VarDefsetBaseClass (Symbol *sym)
VarDefsetBool (bool val)
VarDefsetInteger (int64 val)
VarDefsetNil ()
 Describes this property as nil.
VarDefsetNumeric (numeric val)
VarDefsetReadOnly (bool ro)
 Describes this property as reflective.
VarDefsetReference (Symbol *sym)
VarDefsetReflectFunc (reflectionFunc rfrom, reflectionFunc rto=0, void *reflect_data=0)
 Describes this property as reflective.
VarDefsetReflective (t_reflection mode, void *base, void *position)
 Describes this property as reflective.
VarDefsetReflective (t_reflection mode, uint32 offset)
 Describes this property as reflective.
VarDefsetString (const String *str)
VarDefsetSymbol (Symbol *sym)
t_type type () const
 VarDef (t_reflection mode, uint32 offset)
 VarDef (reflectionFunc rfrom, reflectionFunc rto=0)
 VarDef (t_type t, int64 iv)
 VarDef (t_type t, Symbol *sym)
 VarDef (Symbol *sym)
 VarDef (const String *str)
 VarDef (numeric val)
 VarDef (int64 val)
 VarDef (bool val)
 VarDef ()


Detailed Description

Variable initial value definition.

This class holds the immediate values of properties of classes and objects, and eventually the values static symbols, when an initial value has been declared if it's declared. If the properties are declared as expressions, or anyhow not as immediate values, the relative property definition is set to nil and the code generator will create an internal constructor (called before the user-defined constructor) that will initialize the complex property values.

Property definition can then be:


Member Enumeration Documentation

Enumerator:
t_nil 
t_int 
t_bool 
t_num 
t_string 
t_symbol 
t_base 
t_reference 
t_reflective 
t_reflectFunc 


Constructor & Destructor Documentation

Falcon::VarDef::VarDef (  )  [inline]

Falcon::VarDef::VarDef ( bool  val  )  [inline, explicit]

Falcon::VarDef::VarDef ( int64  val  )  [inline]

Falcon::VarDef::VarDef ( numeric  val  )  [inline]

Falcon::VarDef::VarDef ( const String str  )  [inline]

Falcon::VarDef::VarDef ( Symbol sym  )  [inline]

Falcon::VarDef::VarDef ( t_type  t,
Symbol sym 
) [inline]

Falcon::VarDef::VarDef ( t_type  t,
int64  iv 
) [inline]

Falcon::VarDef::VarDef ( reflectionFunc  rfrom,
reflectionFunc  rto = 0 
) [inline]

Falcon::VarDef::VarDef ( t_reflection  mode,
uint32  offset 
) [inline]


Member Function Documentation

bool Falcon::VarDef::asBool (  )  const [inline]

int64 Falcon::VarDef::asInteger (  )  const [inline]

numeric Falcon::VarDef::asNumeric (  )  const [inline]

t_reflection Falcon::VarDef::asReflecMode (  )  const [inline]

uint32 Falcon::VarDef::asReflecOffset (  )  const [inline]

void* Falcon::VarDef::asReflectFuncData (  )  const [inline]

reflectionFunc Falcon::VarDef::asReflectFuncFrom (  )  const [inline]

reflectionFunc Falcon::VarDef::asReflectFuncTo (  )  const [inline]

const String* Falcon::VarDef::asString (  )  const [inline]

Symbol* Falcon::VarDef::asSymbol (  )  const [inline]

bool Falcon::VarDef::isBaseClass (  )  const [inline]

bool Falcon::VarDef::isBool (  )  const [inline]

bool Falcon::VarDef::isInteger (  )  const [inline]

bool Falcon::VarDef::isNil (  )  const [inline]

bool Falcon::VarDef::isNumeric (  )  const [inline]

bool Falcon::VarDef::isReadOnly (  )  const [inline]

bool Falcon::VarDef::isReference (  )  const [inline]

bool Falcon::VarDef::isReflectFunc (  )  const [inline]

bool Falcon::VarDef::isReflective (  )  const [inline]

bool Falcon::VarDef::isString (  )  const [inline]

bool Falcon::VarDef::isSymbol (  )  const [inline]

bool Falcon::VarDef::load ( Module mod,
Stream in 
)

bool Falcon::VarDef::save ( Stream out  )  const

VarDef& Falcon::VarDef::setBaseClass ( Symbol sym  )  [inline]

References val_sym.

VarDef& Falcon::VarDef::setBool ( bool  val  )  [inline]

References val_bool.

VarDef& Falcon::VarDef::setInteger ( int64  val  )  [inline]

VarDef& Falcon::VarDef::setNil (  )  [inline]

Describes this property as nil.

Returns:
a reference to this instance, for variable parameter initialization idiom.

VarDef& Falcon::VarDef::setNumeric ( numeric  val  )  [inline]

References val_num.

VarDef& Falcon::VarDef::setReadOnly ( bool  ro  )  [inline]

Describes this property as reflective.

Returns:
a reference to this instance, for variable parameter initialization idiom.

VarDef& Falcon::VarDef::setReference ( Symbol sym  )  [inline]

References val_sym.

VarDef& Falcon::VarDef::setReflectFunc ( reflectionFunc  rfrom,
reflectionFunc  rto = 0,
void *  reflect_data = 0 
) [inline]

Describes this property as reflective.

This ValDef defines a property that will have user functions called when the VM wants to set or get a property.

It is also possible to define an extra reflective data, that should be alive during the lifespan of the module defining it, that will be passed back to the property set/get callback functions as the PropEntry::reflect_data property of the "entry" parameter.

Parameters:
rfrom Function that gets called when the property is set from an external source.
rto Function that gets called when the property is read and then stored to the external source; set to 0 to have a read-only reflective property.
reflect_data a pointer that will be passed as a part of the entry structure in the callback method.
Returns:
a reference to this instance, for variable parameter initialization idiom.

References val_rfunc.

VarDef& Falcon::VarDef::setReflective ( t_reflection  mode,
void *  base,
void *  position 
) [inline]

Describes this property as reflective.

Shortcut calculating the offset given a sample structure and a field in that.

Returns:
a reference to this instance, for variable parameter initialization idiom.

VarDef& Falcon::VarDef::setReflective ( t_reflection  mode,
uint32  offset 
) [inline]

Describes this property as reflective.

Returns:
a reference to this instance, for variable parameter initialization idiom.

VarDef& Falcon::VarDef::setString ( const String str  )  [inline]

VarDef& Falcon::VarDef::setSymbol ( Symbol sym  )  [inline]

References val_sym.

t_type Falcon::VarDef::type (  )  const [inline]


Member Data Documentation

Referenced by setBool().

Referenced by setNumeric().

struct { ... } Falcon::VarDef::val_rfunc

Referenced by setReflectFunc().


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

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