Falcon::CoreSlot Class Reference

Slot for messages sent around by the VM. More...

#include <coreslot.h>

Inheritance diagram for Falcon::CoreSlot:

Inheritance graph
[legend]

List of all members.

Public Member Functions

const Itemassertion () const
 Return the asserted data.
virtual FalconDataclone () const
 Deletes the list.
virtual void copyIterator (Iterator &tgt, const Iterator &source) const
 Copy an iterator so that the two points to the same item.
 CoreSlot (const String &name)
void decref ()
virtual void disposeIterator (Iterator &tgt) const
 Called back to destroy deep data that may be associated with an iterator.
virtual void gcMark (uint32 mark)
 Perform marking of items stored in the list.
virtual void getIterator (Iterator &tgt, bool tail=false) const
 Gets an Iterator valid for this sequence.
bool hasAssert () const
 Returns true if this slot is associated with an assertion.
void incref () const
const Stringname () const
void prepareBroadcast (VMContext *vmc, uint32 pfirst, uint32 pcount, VMMessage *msg=0)
 Prepares a broadcast from the current frame.
bool remove (const Item &subsriber)
 Remove a ceratin item from this slot.
void retract ()
 Retracts the assert data.
void setAssertion (VMachine *vm, const Item &a)
 Performs an assertion for this slot.
void setAssertion (const Item &a)
 Sets an assertion for this slot.


Detailed Description

Slot for messages sent around by the VM.

This class provide abstract support for low level messaging system.

The slot represents an end of the communication process where the incoming message is definitely


Constructor & Destructor Documentation

Falcon::CoreSlot::CoreSlot ( const String name  )  [inline]


Member Function Documentation

const Item& Falcon::CoreSlot::assertion (  )  const [inline]

Return the asserted data.

This data is meaningless if hasAssert() isn't true.

virtual FalconData* Falcon::CoreSlot::clone (  )  const [virtual]

Deletes the list.

Items are shallowly destroyed.

Reimplemented from Falcon::ItemList.

virtual void Falcon::CoreSlot::copyIterator ( Iterator tgt,
const Iterator source 
) const [virtual]

Copy an iterator so that the two points to the same item.

The source iterator may point to the past-end element, but must not be invalid.

Note:
The base version of this function just adds the iterator to the iterator list; it MUST be called by all the implementations.

Reimplemented from Falcon::ItemList.

void Falcon::CoreSlot::decref (  ) 

virtual void Falcon::CoreSlot::disposeIterator ( Iterator tgt  )  const [virtual]

Called back to destroy deep data that may be associated with an iterator.

This method is called back at iterator destructor to clear deep data that the sequence may have stored in the iterator.

After this call, the iterator is invalidated (if correctly found in the list).

Note:
The base class version disengage the iterator from the iterator list and invalidates it. It normally shouldn't be overloaded by subclasses, as the final memory cleaning from a deep iterator, if needed, must be separately provided via the Iterator::deletor() interface.

Reimplemented from Falcon::Sequence.

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

Perform marking of items stored in the list.

Reimplemented from Falcon::ItemList.

virtual void Falcon::CoreSlot::getIterator ( Iterator tgt,
bool  tail = false 
) const [virtual]

Gets an Iterator valid for this sequence.

If you need an iterator as a pointer or in the target stack, use Iterator( Sequence*, bool) instead.

The iterator constructor calls back this method to be configured.

It is possible to call this method thereafter to reset the iterator, even if it's gone invalid.

However, it is not legal to call this method with an iterator coming from another sequence; this will cause the program to throw a CodeError.

Note:
The base version of this function just adds the iterator to the iterator list; it MUST be called by all the implementations.
Parameters:
An Iterator to be set.
tail if false, get an iterator to the first element, else get an iterator to the last element.

Reimplemented from Falcon::ItemList.

bool Falcon::CoreSlot::hasAssert (  )  const [inline]

Returns true if this slot is associated with an assertion.

void Falcon::CoreSlot::incref (  )  const

const String& Falcon::CoreSlot::name (  )  const [inline]

void Falcon::CoreSlot::prepareBroadcast ( VMContext vmc,
uint32  pfirst,
uint32  pcount,
VMMessage msg = 0 
)

Prepares a broadcast from the current frame.

Meant to be called from inside extension functions going to perform broadcasts, this function prepares the multi-call frame used for repeated broadcast-based calls.

Parameters:
vmc The VM context on which the broadcast is going to be performed.
pfirst The first parameter in the current call frame that must be repeated.
pcount Parameter count to be passed in the broadcast.
msg The message that caused the slot to be broadcast (can be none if internally broadcast).

bool Falcon::CoreSlot::remove ( const Item subsriber  ) 

Remove a ceratin item from this slot.

This will remove an item considered equal to the subscriber from this list.

void Falcon::CoreSlot::retract (  )  [inline]

Retracts the assert data.

This function does nothing if the slot didn't have an assertion.

References Falcon::Item::setNil().

void Falcon::CoreSlot::setAssertion ( VMachine vm,
const Item a 
)

Performs an assertion for this slot.

Also, prepares the VM to run a broadcast loop with the asserted item.

void Falcon::CoreSlot::setAssertion ( const Item a  )  [inline]

Sets an assertion for this slot.

No action is taken.


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