Falcon::Item Class Reference

Basic item abstraction. More...

#include <item.h>

Inheritance diagram for Falcon::Item:

Inheritance graph
[legend]

List of all members.

Public Types


Public Member Functions

void add (const Item &operand, Item &result) const
CoreArrayasArray () const
bool asBoolean () const
CoreClassasClass () const
CoreStringasCoreString () const
DeepItemasDeepItem () const
CoreDictasDict () const
GarbageItemasFBind () const
CoreFuncasFunction () const
ItemasFutureBind ()
const ItemasFutureBind () const
FalconDataasGCPointer () const
GarbagePointerasGCPointerShell () const
int64 asInteger () const
StringasLBind () const
 Return the binding name associate with this LBind item.
MemBufasMemBuf () const
CoreClassasMethodClass () const
CoreObjectasMethodClassOwner () const
CallPointasMethodFunc () const
Item asMethodItem () const
 Gets the "self" in an item (return the item version).
numeric asNumeric () const
CoreObjectasObject () const
CoreObjectasObjectSafe () const
CoreRangeasRange () const
int64 asRangeEnd () const
bool asRangeIsOpen () const
int64 asRangeStart () const
int64 asRangeStep () const
GarbageItemasReference () const
StringasString () const
LiveModuleasStringModule () const
bool canBeMethod () const
 Return true if this is a callable item that is turned into a method when found as property.
bool clone (Item &target) const
 Clone the item (with the help of a VM).
int compare (const Item &operand) const
void content (Garbageable *dt)
Garbageablecontent () const
 Returns the content of the item.
void copy (const Item &other)
void dec (Item &target)
void decpost (Item &target)
void deMethod ()
 Turns a method item into its original "self".
const Itemdereference () const
Itemdereference ()
e_sercode deserialize (Stream *in, VMachine *vm=0)
 Loads a serialized item from a stream.
void div (const Item &operand, Item &result) const
void flags (byte b)
byte flags () const
 Flags, used for internal vm needs.
void flagsOff (byte b)
void flagsOn (byte b)
int64 forceInteger () const
 Convert current object into an integer.
int64 forceIntegerEx () const
 Convert current object into an integer.
numeric forceNumeric () const
 Convert current object into a numeric.
void getIndex (const Item &idx, Item &result) const
void getMethodItem (Item &itm) const
 Gets the "self" in an item (pass byref version).
void getProperty (const String &property, Item &result) const
uint32 hash () const
 Calculates the hash function for this item.
void inc (Item &target)
void incpost (Item &target)
bool isArray () const
bool isBoolean () const
bool isCallable () const
 Tells if this item is callable.
bool isClass () const
bool isClassMethod () const
bool isComposed () const
 Returns true if this item is an instance of some sort.
bool isDeep () const
 Return true if the item deep.
bool isDict () const
bool isFunction () const
bool isFutureBind () const
bool isGCPointer () const
bool isInteger () const
bool isLBind () const
 Returns true if this item is a valid LBind.
bool isLitLBind () const
bool isMemBuf () const
bool isMethod () const
bool isMethodic () const
bool isNil () const
bool isNumeric () const
bool isObject () const
bool isOfClass (const String &className) const
bool isOob () const
 Tells wether this item is out of band.
bool isOrdinal () const
bool isRange () const
bool isReference () const
bool isScalar () const
bool isString () const
bool isTrue () const
 Item (CoreClass *cls)
 Creates a class item.
 Item (CoreObject *obj, CoreClass *cls)
 Item (const Item &data, CallPoint *func)
 Creates a method.
 Item (GarbageItem *ref)
 Item (MemBuf *buf)
 Creates a memory buffer.
 Item (CoreDict *obj)
 Creates a dictionary item.
 Item (CoreObject *obj)
 Creates an object item.
 Item (CoreArray *array)
 Creates an array item.
 Item (String *str)
 Creates a CoreString item.
 Item (const String &str)
 Creates a corestring.
 Item (CoreRange *r)
 Creates a range item.
 Item (numeric val)
 Creates a numeric item.
 Item (uint64 val)
 Creates an integer item.
 Item (int64 val)
 Creates an integer item.
 Item (uint32 val)
 Creates an integer item.
 Item (int32 val)
 Creates an integer item.
 Item (uint16 val)
 Creates an integer item.
 Item (int16 val)
 Creates an integer item.
 Item (const Item &other)
 Item (CoreFunc *cf)
 Item (byte t, Garbageable *dt)
 Item (byte t=FLC_ITEM_NIL)
bool methodize (const CoreObject *co)
bool methodize (const Item &self)
 Turns this item in a method of the given object.
void mod (const Item &operand, Item &result) const
void mul (const Item &operand, Item &result) const
void neg (Item &target) const
bool operator!= (const Item &other) const
bool operator< (const Item &other) const
bool operator<= (const Item &other) const
Itemoperator= (const Item &other)
bool operator== (const Item &other) const
bool operator> (const Item &other) const
bool operator>= (const Item &other) const
void pow (const Item &operand, Item &result) const
void readyFrame (VMachine *vm, uint32 paramCount) const
 Prepares a call frame that will be called at next VM loop.
void resetOob ()
 Clear out of band status of this item.
e_sercode serialize (Stream *out, bool bLive=false) const
 Serialize this item.
void setArray (CoreArray *array)
void setBoolean (bool tof)
 Creates a boolean item.
void setClass (CoreClass *cls)
void setClassMethod (CoreObject *obj, CoreClass *cls)
void setDict (CoreDict *dict)
void setFunction (CoreFunc *cf)
 Creates a function item.
void setGCPointer (GarbagePointer *shell)
void setGCPointer (FalconData *ptr)
 Set this item as a user-defined Garbage pointers.
void setIndex (const Item &idx, const Item &result)
void setInteger (int64 val)
void setLBind (String *lbind, GarbageItem *val=0)
 Creates a late binding item.
void setMemBuf (MemBuf *b)
void setMethod (const Item &data, CallPoint *func)
 Creates a method.
void setNil ()
void setNumeric (numeric val)
void setObject (CoreObject *obj)
void setOob (bool oob)
 Sets or clears the out of band status status of this item.
void setOob ()
 Defines this item as a out of band data.
void setProperty (const String &prop, const Item &result)
void setRange (CoreRange *r)
void setReference (GarbageItem *ref)
 Creates a reference to another item.
void setString (String *str)
void sub (const Item &operand, Item &result) const
void toString (String &target) const
 Provides a basic CoreString representation of the item.
void type (byte nt)
byte type () const

Protected Member Functions

e_sercode deserialize_class (Stream *file, VMachine *vm)
e_sercode deserialize_function (Stream *file, VMachine *vm)
e_sercode deserialize_symbol (Stream *file, VMachine *vm, Symbol **tg_sym, LiveModule **modId)
bool serialize_class (Stream *file, const CoreClass *cls) const
bool serialize_function (Stream *file, const CoreFunc *func, bool bLive) const
bool serialize_object (Stream *file, CoreObject *obj, bool bLive) const
bool serialize_symbol (Stream *file, const Symbol *sym) const

Protected Attributes

union {
   struct {
      union {
         struct {
            byte   flags
            byte   methodId
            byte   oldType
            byte   type
         }   bits
         uint16   half
         uint32   whole
      }   base
      union {
         Garbageable *   content
         numeric   number
         struct {
            void *   extra
            void *   voidp
         }   ptr
         int32   val32
         int64   val64
      }   data
      CallPoint *   method
   }   ctx
   struct {
      uint64   high
      uint64   low
   }   parts
all

Static Protected Attributes

static const byte flagIsMethodic = 0x02
static const byte flagIsOob = 0x04
static const byte flagLiteral = 0x08


Detailed Description

Basic item abstraction.


Member Enumeration Documentation

Common operations that can be performed on items.

Each item type has a function pointer table taking care of this operations.

Deep items operations is that of searching for overloadings via the deep item common DeepItem::getProperty() method, and then eventually calling the operator implementation.

The operator implementation is called on the VM instance of the deep item.

Enumerator:
co_add 
co_sub 
co_mul 
co_div 
co_mod 
co_pow 
co_neg 
co_inc 
co_dec 
co_incpost 
co_decpost 
co_compare 
co_getIndex 
co_setIndex 
co_getProperty 
co_setProperty 
co_call 

Serialization / deserialization error code.

This value is returned by serialization and deserialization functions to communicate what went wrong.

Enumerator:
sc_ok  All was fine.

sc_ferror  File error in serialization/deserialization.
sc_invformat  Invalid format in deserialization.
sc_missclass  Missing class in deserialization (object cannot be instantiated).

sc_misssym  Missing symbol in deserialization (requested function not present in VM).

sc_vmerror  VM Error in serialization or de-serialization.

This is called if VM raised an error during the call of serialization() object methods in case serialization is called, or if the VM raises an error during init() or deserialization() of deserialized objects.

sc_missvm  Needed VM but missing.

This serialization or deserialization operation required a VM to be provided, but it wasn't.

sc_eof  Hit EOF while de-serializing.


Constructor & Destructor Documentation

Falcon::Item::Item ( byte  t = FLC_ITEM_NIL  )  [inline]

Falcon::Item::Item ( byte  t,
Garbageable dt 
)

Falcon::Item::Item ( CoreFunc cf  )  [inline]

Falcon::Item::Item ( const Item other  )  [inline]

Falcon::Item::Item ( int16  val  )  [inline]

Creates an integer item.

Falcon::Item::Item ( uint16  val  )  [inline]

Creates an integer item.

Falcon::Item::Item ( int32  val  )  [inline]

Creates an integer item.

Falcon::Item::Item ( uint32  val  )  [inline]

Creates an integer item.

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

Creates an integer item.

Falcon::Item::Item ( uint64  val  )  [inline]

Creates an integer item.

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

Creates a numeric item.

Falcon::Item::Item ( CoreRange r  )  [inline]

Creates a range item.

Falcon::Item::Item ( const String str  ) 

Creates a corestring.

The given string is copied and stored in the Garbage system. It is also bufferized, as the most common usage of this constructor is in patterns like Item( "a static string" );

Falcon::Item::Item ( String str  )  [inline]

Creates a CoreString item.

Falcon::Item::Item ( CoreArray array  )  [inline]

Creates an array item.

Falcon::Item::Item ( CoreObject obj  )  [inline]

Creates an object item.

Falcon::Item::Item ( CoreDict obj  )  [inline]

Creates a dictionary item.

Falcon::Item::Item ( MemBuf buf  )  [inline]

Creates a memory buffer.

Falcon::Item::Item ( GarbageItem ref  )  [inline]

Falcon::Item::Item ( const Item data,
CallPoint func 
) [inline]

Creates a method.

The method is able to remember if it was called with a Function pointer or using an external function.

Falcon::Item::Item ( CoreObject obj,
CoreClass cls 
) [inline]

Falcon::Item::Item ( CoreClass cls  )  [inline]

Creates a class item.


Member Function Documentation

void Falcon::Item::add ( const Item operand,
Item result 
) const [inline]

CoreArray* Falcon::Item::asArray (  )  const [inline]

bool Falcon::Item::asBoolean (  )  const [inline]

CoreClass* Falcon::Item::asClass (  )  const [inline]

CoreString* Falcon::Item::asCoreString (  )  const [inline]

DeepItem* Falcon::Item::asDeepItem (  )  const [inline]

CoreDict* Falcon::Item::asDict (  )  const [inline]

GarbageItem* Falcon::Item::asFBind (  )  const [inline]

CoreFunc* Falcon::Item::asFunction (  )  const [inline]

Item& Falcon::Item::asFutureBind (  ) 

const Item& Falcon::Item::asFutureBind (  )  const

FalconData* Falcon::Item::asGCPointer (  )  const

GarbagePointer* Falcon::Item::asGCPointerShell (  )  const

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

String* Falcon::Item::asLBind (  )  const [inline]

Return the binding name associate with this LBind item.

MemBuf* Falcon::Item::asMemBuf (  )  const [inline]

CoreClass* Falcon::Item::asMethodClass (  )  const [inline]

CoreObject* Falcon::Item::asMethodClassOwner (  )  const [inline]

CallPoint* Falcon::Item::asMethodFunc (  )  const [inline]

Item Falcon::Item::asMethodItem (  )  const [inline]

Gets the "self" in an item (return the item version).

References dereference(), flagsOn(), and type.

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

CoreObject* Falcon::Item::asObject (  )  const

CoreObject* Falcon::Item::asObjectSafe (  )  const [inline]

CoreRange* Falcon::Item::asRange (  )  const [inline]

int64 Falcon::Item::asRangeEnd (  )  const [inline]

bool Falcon::Item::asRangeIsOpen (  )  const [inline]

int64 Falcon::Item::asRangeStart (  )  const [inline]

int64 Falcon::Item::asRangeStep (  )  const [inline]

GarbageItem* Falcon::Item::asReference (  )  const [inline]

Referenced by dereference().

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

LiveModule* Falcon::Item::asStringModule (  )  const [inline]

bool Falcon::Item::canBeMethod (  )  const

Return true if this is a callable item that is turned into a method when found as property.

bool Falcon::Item::clone ( Item target  )  const

Clone the item (with the help of a VM).

If the item is not cloneable, the method returns false. Is up to the caller to raise an appropriate error if that's the case. The VM parameter may be zero; in that case, returned items will not be stored in any garbage collector.

Reference items are de-referenced; if cloning a reference, the caller will obtain a clone of the target item, not a clone of the reference.

Also, in that case, the returned item will be free of reference.

Parameters:
vm the virtual machine used for cloning.
target the item where to stored the cloned instance of this item.
Returns:
true if the clone operation is possible

int Falcon::Item::compare ( const Item operand  )  const [inline]

References Falcon::CommOpsDict.

void Falcon::Item::content ( Garbageable dt  )  [inline]

Garbageable* Falcon::Item::content (  )  const [inline]

Returns the content of the item.

void Falcon::Item::copy ( const Item other  )  [inline]

References all.

void Falcon::Item::dec ( Item target  )  [inline]

void Falcon::Item::decpost ( Item target  )  [inline]

void Falcon::Item::deMethod (  )  [inline]

Turns a method item into its original "self".

const Item * Falcon::Item::dereference (  )  const [inline]

Item * Falcon::Item::dereference (  )  [inline]

e_sercode Falcon::Item::deserialize ( Stream in,
VMachine vm = 0 
)

Loads a serialized item from a stream.

This method restores an item previously stored on a stream for later retrival. Providing a virtual machine that is optional; if not provided, items requiring the VM for deserialization won't be correctly restored. Objects deserialization requires a VM readied with the class the object derives from.

See also:
serialize()
Parameters:
in the input stream
vm the virtual machine that can be used for object deserialization
Returns:
an error code in case of error (
See also:
e_sercode).

e_sercode Falcon::Item::deserialize_class ( Stream file,
VMachine vm 
) [protected]

e_sercode Falcon::Item::deserialize_function ( Stream file,
VMachine vm 
) [protected]

e_sercode Falcon::Item::deserialize_symbol ( Stream file,
VMachine vm,
Symbol **  tg_sym,
LiveModule **  modId 
) [protected]

void Falcon::Item::div ( const Item operand,
Item result 
) const [inline]

void Falcon::Item::flags ( byte  b  )  [inline]

byte Falcon::Item::flags (  )  const [inline]

Flags, used for internal vm needs.

void Falcon::Item::flagsOff ( byte  b  )  [inline]

void Falcon::Item::flagsOn ( byte  b  )  [inline]

Referenced by asMethodItem(), and getMethodItem().

int64 Falcon::Item::forceInteger (  )  const

Convert current object into an integer.

This operations is usually done on integers, numeric and CoreStrings. It will do nothing meaningfull on other types.

int64 Falcon::Item::forceIntegerEx (  )  const

Convert current object into an integer.

This operations is usually done on integers, numeric and CoreStrings. It will do nothing meaningfull on other types.

Note:
this version will throw a code error if the item is not an ordinal.

numeric Falcon::Item::forceNumeric (  )  const

Convert current object into a numeric.

This operations is usually done on integers, numeric and CoreStrings. It will do nothing meaningfull on other types.

void Falcon::Item::getIndex ( const Item idx,
Item result 
) const [inline]

void Falcon::Item::getMethodItem ( Item itm  )  const [inline]

Gets the "self" in an item (pass byref version).

References dereference(), flagsOn(), and type.

void Falcon::Item::getProperty ( const String property,
Item result 
) const [inline]

uint32 Falcon::Item::hash (  )  const

Calculates the hash function for this item.

void Falcon::Item::inc ( Item target  )  [inline]

void Falcon::Item::incpost ( Item target  )  [inline]

bool Falcon::Item::isArray (  )  const [inline]

References FLC_ITEM_ARRAY.

bool Falcon::Item::isBoolean (  )  const [inline]

References FLC_ITEM_BOOL.

bool Falcon::Item::isCallable (  )  const

Tells if this item is callable.

This function will turn this object into a nil if the item referenced a dead module. As this is a pathological situation, a const cast is forced.

bool Falcon::Item::isClass (  )  const [inline]

References FLC_ITEM_CLASS.

bool Falcon::Item::isClassMethod (  )  const [inline]

References FLC_ITEM_CLSMETHOD.

bool Falcon::Item::isComposed (  )  const [inline]

Returns true if this item is an instance of some sort.

Returns:
true if this is an object, blessed dictionary or bound array.

bool Falcon::Item::isDeep (  )  const [inline]

Return true if the item deep.

Deep items are the ones that are subject to garbage collecting.

Returns:
true if the item is deep.

References FLC_ITEM_FIRST_DEEP.

bool Falcon::Item::isDict (  )  const [inline]

References FLC_ITEM_DICT.

bool Falcon::Item::isFunction (  )  const [inline]

References FLC_ITEM_FUNC.

bool Falcon::Item::isFutureBind (  )  const [inline]

bool Falcon::Item::isGCPointer (  )  const [inline]

References FLC_ITEM_GCPTR.

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

References FLC_ITEM_INT.

bool Falcon::Item::isLBind (  )  const [inline]

Returns true if this item is a valid LBind.

References FLC_ITEM_LBIND.

bool Falcon::Item::isLitLBind (  )  const [inline]

bool Falcon::Item::isMemBuf (  )  const [inline]

References FLC_ITEM_MEMBUF.

bool Falcon::Item::isMethod (  )  const [inline]

References FLC_ITEM_METHOD.

bool Falcon::Item::isMethodic (  )  const [inline]

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

References FLC_ITEM_NIL.

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

References FLC_ITEM_NUM.

bool Falcon::Item::isObject (  )  const [inline]

References FLC_ITEM_OBJECT.

bool Falcon::Item::isOfClass ( const String className  )  const

bool Falcon::Item::isOob (  )  const [inline]

Tells wether this item is out of band.

Returns:
true if out of band.
See also:
oob()

bool Falcon::Item::isOrdinal (  )  const [inline]

References FLC_ITEM_INT, and FLC_ITEM_NUM.

bool Falcon::Item::isRange (  )  const [inline]

References FLC_ITEM_RANGE.

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

References FLC_ITEM_REFERENCE.

bool Falcon::Item::isScalar (  )  const [inline]

References FLC_ITEM_INT, and FLC_ITEM_NUM.

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

References FLC_ITEM_STRING.

bool Falcon::Item::isTrue (  )  const

bool Falcon::Item::methodize ( const CoreObject co  )  [inline]

bool Falcon::Item::methodize ( const Item self  ) 

Turns this item in a method of the given object.

This is meant to be used by external functions when accessing object properties. VM always creates a method when accessor is used; in example, myObject.someFunc() will create a method myObject.someFunc if there is some callable inside the given property, and then will call it. In this way, a function may be assigned to that property, and the VM will take care to create an item that will turn the function in a method.

But when a non-vm program accesses an object "method", the calling program may have assigned something different to it in the meanwhile, and what its returned in CoreObject::getProperty() won't be a callable method, but just the assigned object.

Methodize will turn such an item in a callable method of the object given as parameter, if this is possible, else it will return false.

Note:
External methods (that is, methods calling external functions) won't be methodized, as they often rely in external values carried inside their CoreObject owners. However, the function will return true, as the object can be called, and very probably it will do what expected by the user (as the external method would have never used anything other than the VM generated self anyhow).

CoreObject::getMethod() is a shortcut to this function.

Parameters:
self the object that will be set as "self" for the method
Returns:
true if the item can be called properly, false if it's not a callable.

Referenced by Falcon::CoreObject::getMethod().

void Falcon::Item::mod ( const Item operand,
Item result 
) const [inline]

void Falcon::Item::mul ( const Item operand,
Item result 
) const [inline]

void Falcon::Item::neg ( Item target  )  const [inline]

bool Falcon::Item::operator!= ( const Item other  )  const [inline]

bool Falcon::Item::operator< ( const Item other  )  const [inline]

bool Falcon::Item::operator<= ( const Item other  )  const [inline]

Item& Falcon::Item::operator= ( const Item other  )  [inline]

bool Falcon::Item::operator== ( const Item other  )  const [inline]

bool Falcon::Item::operator> ( const Item other  )  const [inline]

bool Falcon::Item::operator>= ( const Item other  )  const [inline]

void Falcon::Item::pow ( const Item operand,
Item result 
) const [inline]

void Falcon::Item::readyFrame ( VMachine vm,
uint32  paramCount 
) const [inline]

Prepares a call frame that will be called at next VM loop.

Note:
You can use vm->execFrame() to execute the prepared frame immediately instead of waiting for the loop to complete.

References Falcon::CommOpsDict, and Falcon::void().

Referenced by Falcon::VMachine::callFrame().

void Falcon::Item::resetOob (  )  [inline]

Clear out of band status of this item.

See also:
setOob()

e_sercode Falcon::Item::serialize ( Stream out,
bool  bLive = false 
) const

Serialize this item.

This method stores an item on a stream for later retrival.

The function can return true if the serialization succeded. It will return false if the serialization failed; in that case, if there is an error on the stream, it can be retreived form the stream variable. If the stream reports no error, then the serialization failed because a VM was not provided while a serialized method should have been called on the target object, or in any referenced object, or because the VM received an error during the method call.

Parameters:
out the output stream
bLive true
Returns:
an error code in case of error (
See also:
e_sercode).

bool Falcon::Item::serialize_class ( Stream file,
const CoreClass cls 
) const [protected]

bool Falcon::Item::serialize_function ( Stream file,
const CoreFunc func,
bool  bLive 
) const [protected]

bool Falcon::Item::serialize_object ( Stream file,
CoreObject obj,
bool  bLive 
) const [protected]

bool Falcon::Item::serialize_symbol ( Stream file,
const Symbol sym 
) const [protected]

void Falcon::Item::setArray ( CoreArray array  ) 

Reimplemented in Falcon::SafeItem.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::setBoolean ( bool  tof  )  [inline]

Creates a boolean item.

Sets this item as boolean

Reimplemented in Falcon::SafeItem.

References FLC_ITEM_BOOL.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::setClass ( CoreClass cls  ) 

Reimplemented in Falcon::SafeItem.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::setClassMethod ( CoreObject obj,
CoreClass cls 
)

Reimplemented in Falcon::SafeItem.

void Falcon::Item::setDict ( CoreDict dict  ) 

Reimplemented in Falcon::SafeItem.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::setFunction ( CoreFunc cf  ) 

Creates a function item.

Reimplemented in Falcon::SafeItem.

void Falcon::Item::setGCPointer ( GarbagePointer shell  ) 

Reimplemented in Falcon::SafeItem.

void Falcon::Item::setGCPointer ( FalconData ptr  ) 

Set this item as a user-defined Garbage pointers.

VM provides GC-control over them.

Reimplemented in Falcon::SafeItem.

void Falcon::Item::setIndex ( const Item idx,
const Item result 
) [inline]

void Falcon::Item::setInteger ( int64  val  )  [inline]

Reimplemented in Falcon::SafeItem.

References FLC_ITEM_INT.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::setLBind ( String lbind,
GarbageItem val = 0 
)

Creates a late binding item.

The late binding is just a CoreString in a live module which is resolved into a value by referencing a item in the current context (symbol tables) having the given name at runtime.

Thus, the CoreString representing the late binding symbol name lives in the live module that generated this LBind. If the module is unloaded, the LBind is invalidated.

Parameters:
lbind The name of the late binding symbol.
val If provided, a future value (future binding).

Reimplemented in Falcon::SafeItem.

void Falcon::Item::setMemBuf ( MemBuf b  ) 

Reimplemented in Falcon::SafeItem.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::setMethod ( const Item data,
CallPoint func 
)

Creates a method.

The method is able to remember if it was called with a Function pointer or using an external function.

Reimplemented in Falcon::SafeItem.

void Falcon::Item::setNil (  )  [inline]

void Falcon::Item::setNumeric ( numeric  val  )  [inline]

Reimplemented in Falcon::SafeItem.

References FLC_ITEM_NUM.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::setObject ( CoreObject obj  ) 

Reimplemented in Falcon::SafeItem.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::setOob ( bool  oob  )  [inline]

Sets or clears the out of band status status of this item.

Parameters:
oob true to make this item out of band.
See also:
setOob()

void Falcon::Item::setOob (  )  [inline]

Defines this item as a out of band data.

Out of band data allow out-of-order sequencing in functional programming. If an item is out of band, it's type it's still the original one, and its value is preserved across function calls and returns; however, the out of band data may innescate a meta-level processing of the data travelling through the functions.

In example, returning an out of band NIL value from an xmap mapping function will cause xmap to discard the data.

void Falcon::Item::setProperty ( const String prop,
const Item result 
) [inline]

void Falcon::Item::setRange ( CoreRange r  ) 

Reimplemented in Falcon::SafeItem.

void Falcon::Item::setReference ( GarbageItem ref  ) 

Creates a reference to another item.

Reimplemented in Falcon::SafeItem.

void Falcon::Item::setString ( String str  ) 

Reimplemented in Falcon::SafeItem.

Referenced by Falcon::VMachine::retval().

void Falcon::Item::sub ( const Item operand,
Item result 
) const [inline]

void Falcon::Item::toString ( String target  )  const

Provides a basic CoreString representation of the item.

Use Falcon::Format for a finer control of item representation.

Parameters:
target a CoreString where the item CoreString representation will be placed.

void Falcon::Item::type ( byte  nt  )  [inline]

byte Falcon::Item::type (  )  const [inline]

Referenced by dereference().


Member Data Documentation

union { ... } Falcon::Item::all [protected]

Referenced by copy().

union { ... } Falcon::Item::base

struct { ... } Falcon::Item::bits

struct { ... } Falcon::Item::ctx

union { ... } Falcon::Item::data

const byte Falcon::Item::flagIsMethodic = 0x02 [static, protected]

const byte Falcon::Item::flagIsOob = 0x04 [static, protected]

const byte Falcon::Item::flagLiteral = 0x08 [static, protected]

struct { ... } Falcon::Item::parts

struct { ... } Falcon::Item::ptr

Referenced by asMethodItem(), and getMethodItem().


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

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