#include <coreslot.h>
Public Member Functions | |
const Item & | assertion () const |
Return the asserted data. | |
virtual FalconData * | clone () 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 String & | name () 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. |
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
Falcon::CoreSlot::CoreSlot | ( | const String & | name | ) | [inline] |
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] |
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.
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).
Reimplemented from Falcon::Sequence.
virtual void Falcon::CoreSlot::gcMark | ( | uint32 | mark | ) | [virtual] |
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.
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.
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().
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.