#include <ListClass.hpp>
Static Public Member Functions | |
static void | createInstance () |
Static Public Member Functions inherited from RexxObject | |
static void | decodeMessageName (RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope) |
static void | createInstance () |
Static Public Member Functions inherited from RexxInternalObject | |
static size_t | getObjectHeaderSize () |
Static Public Attributes | |
static RexxClass * | classInstance = OREF_NULL |
Static Public Attributes inherited from RexxObject | |
static PCPPM | operatorMethods [] |
static RexxClass * | classInstance = OREF_NULL |
Protected Attributes | |
RexxListTable * | table |
size_t | first |
size_t | last |
size_t | count |
size_t | size |
size_t | free |
Friends | |
class | RexxListTable |
Additional Inherited Members | |
Public Attributes inherited from RexxInternalObject | |
ObjectHeader | header |
RexxBehaviour * | behaviour |
Protected Member Functions inherited from RexxVirtualBase | |
virtual | ~RexxVirtualBase () |
virtual void | baseVirtual () |
Definition at line 63 of file ListClass.hpp.
|
inline |
Definition at line 68 of file ListClass.hpp.
|
inline |
Definition at line 69 of file ListClass.hpp.
RexxObject * RexxList::add | ( | RexxObject * | _value, |
RexxObject * | _index | ||
) |
Definition at line 381 of file ListClass.cpp.
References count, ENTRY_INDEX, ENTRY_POINTER, Error_Incorrect_method_index, first, getEntry(), getFree(), IntegerOne, last, LIST_END, new_integer(), listentry::next, OrefSet, listentry::previous, reportException(), table, TheNilObject, and listentry::value.
void RexxList::addFirst | ( | RexxObject * | value | ) |
Definition at line 486 of file ListClass.cpp.
References count, ENTRY_POINTER, first, getFree(), last, LIST_END, listentry::next, OrefSet, listentry::previous, table, and listentry::value.
Referenced by RexxClass::addSubClass(), RexxQueue::push(), and RexxActivation::pushEnvironment().
void RexxList::addLast | ( | RexxObject * | value | ) |
Definition at line 455 of file ListClass.cpp.
References count, ENTRY_POINTER, first, getFree(), last, LIST_END, listentry::next, OrefSet, listentry::previous, table, and listentry::value.
Referenced by RexxSource::addReference(), classOf(), RexxVariableReference::list(), RexxActivation::mergeTraps(), RexxMessage::notify(), RexxQueue::ofRexx(), RexxActivation::processTraps(), RexxQueue::queue(), RexxVariableDictionary::reserve(), RexxMessage::result(), section(), RexxQueue::section(), and RexxActivation::trap().
RexxArray * RexxList::allIndexes | ( | void | ) |
Return an array containing all elements contained in the list, in sorted order.
Definition at line 938 of file ListClass.cpp.
References count, ENTRY_POINTER, first, new_array(), new_integer(), listentry::next, and RexxArray::put().
Referenced by RexxMemory::createImage().
RexxArray * RexxList::allItems | ( | void | ) |
Return an array containing all elements contained in the list, in sorted order.
Definition at line 888 of file ListClass.cpp.
References count, ENTRY_POINTER, first, new_array(), listentry::next, RexxArray::put(), and listentry::value.
Referenced by RexxMemory::createImage(), and makeArray().
RexxObject * RexxList::append | ( | RexxObject * | _value | ) |
Append an item after the last item in the list.
value | The value to append. |
Definition at line 538 of file ListClass.cpp.
References ARG_ONE, insert(), OREF_NULL, and requiredArgument().
Referenced by ProtectedSet::add(), ClassDirective::addInherits(), ExtensionDirective::addInherits(), RexxSource::addPackage(), SysInterpreterInstance::addSearchExtension(), RexxSource::addText(), InterpreterInstance::attachThread(), RexxSource::classDirective(), ActivityManager::createCurrentActivity(), RexxMemory::createImage(), Interpreter::createInterpreterInstance(), ActivityManager::createNewActivity(), RexxSource::extensionDirective(), RexxActivity::generateProgramInformation(), InterpreterInstance::initialize(), RexxSource::libraryDirective(), ActivityManager::poolActivity(), InterpreterInstance::processOptions(), InterpreterInstance::removeInactiveActivities(), RexxSource::requiresDirective(), RexxSource::resolveDependencies(), InterpreterInstance::spawnActivity(), and InterpreterInstance::terminate().
RexxList * RexxList::classOf | ( | RexxObject ** | args, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 1261 of file ListClass.cpp.
References addLast(), Error_Incorrect_method_noarg, OREF_NULL, reportException(), RexxList(), RexxObject::sendMessage(), and TheListClass.
Referenced by RexxMemory::createImage().
|
virtual |
Reimplemented from RexxObject.
Definition at line 78 of file ListClass.cpp.
References RexxInternalObject::copy(), RexxObject::copy(), OrefSet, and table.
|
static |
Create initial class object at bootstrap time.
Definition at line 60 of file ListClass.cpp.
References CLASS_CREATE.
Referenced by RexxMemory::createImage().
RexxObject * RexxList::empty | ( | ) |
Empty all of the items from a list.
Definition at line 908 of file ListClass.cpp.
References ENTRY_POINTER, first, LIST_END, OREF_NULL, and primitiveRemove().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 84 of file ListClass.hpp.
References first.
Referenced by ClassDirective::addDependencies(), Interpreter::haltAllActivities(), InterpreterInstance::haltAllActivities(), ClassDirective::install(), ExtensionDirective::install(), RexxSource::processInstall(), RexxClass::removeSubclass(), RexxSource::resolveDependencies(), SysInterpreterInstance::resolveProgramName(), RexxMessage::sendNotification(), InterpreterInstance::traceAllActivities(), and weakReferenceArray().
RexxObject * RexxList::firstItem | ( | void | ) |
Definition at line 682 of file ListClass.cpp.
References ENTRY_POINTER, first, LIST_END, and TheNilObject.
Referenced by RexxMemory::createImage(), and RexxQueue::peek().
RexxObject * RexxList::firstRexx | ( | void | ) |
Definition at line 712 of file ListClass.cpp.
References first, LIST_END, new_integer(), and TheNilObject.
Referenced by RexxMemory::createImage(), and indexOfValue().
|
virtual |
Reimplemented from RexxObject.
Definition at line 171 of file ListClass.cpp.
References cleanUpFlatten, flatten_reference, and setUpFlatten.
LISTENTRY * RexxList::getEntry | ( | RexxObject * | _index, |
RexxObject * | position | ||
) |
Definition at line 184 of file ListClass.cpp.
References ENTRY_POINTER, Error_Incorrect_method_index, Error_Incorrect_method_noarg, RexxInteger::getValue(), NOT_ACTIVE, OREF_NULL, listentry::previous, reportException(), REQUEST_INTEGER(), size, and TheNilObject.
Referenced by add(), getValue(), hasIndex(), insert(), next(), nextIndex(), previous(), previousIndex(), put(), remove(), section(), and value().
LISTENTRY * RexxList::getEntry | ( | size_t | item_index | ) |
Resolve a low-level index into a list entry value.
item_index | The target index. |
Definition at line 230 of file ListClass.cpp.
References ENTRY_POINTER, NOT_ACTIVE, listentry::previous, and size.
size_t RexxList::getFree | ( | void | ) |
Definition at line 115 of file ListClass.cpp.
References ENTRY_POINTER, free, RexxListTable::getData(), RexxInternalObject::isOldSpace(), LIST_END, OrefSet, partitionBuffer(), size, table, TABLE_SIZE, and listentry::value.
Referenced by add(), addFirst(), addLast(), insert(), and RexxQueue::insert().
|
inline |
Definition at line 126 of file ListClass.hpp.
References count.
Referenced by build(), RexxVariableDictionary::buildCompoundVariable(), RexxActivation::mergeTraps(), RexxActivation::run(), RexxMessage::sendNotification(), and RexxActivation::termination().
RexxObject * RexxList::getValue | ( | size_t | _index | ) |
Primitive level getValue() for a list item.
_index | The decoded index item. |
Definition at line 276 of file ListClass.cpp.
References getEntry(), OREF_NULL, and listentry::value.
Referenced by ClassDirective::addDependencies(), InterpreterInstance::findActivity(), ActivityManager::findActivity(), Interpreter::haltAllActivities(), InterpreterInstance::haltAllActivities(), ClassDirective::install(), ExtensionDirective::install(), RexxSource::processInstall(), RexxClass::removeSubclass(), RexxSource::resolveDependencies(), SysInterpreterInstance::resolveProgramName(), RexxMessage::sendNotification(), and InterpreterInstance::traceAllActivities().
RexxObject * RexxList::hasIndex | ( | RexxObject * | _index | ) |
Definition at line 845 of file ListClass.cpp.
References getEntry(), IntegerOne, TheFalseObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxObject * RexxList::hasItem | ( | RexxObject * | target | ) |
Tests whether there is an object with the given value in the list.
target | The target value. |
Definition at line 994 of file ListClass.cpp.
References ARG_ONE, count, ENTRY_POINTER, RexxObject::equalValue(), first, listentry::next, requiredArgument(), TheFalseObject, TheTrueObject, and listentry::value.
Referenced by RexxSource::addPackage(), SysInterpreterInstance::addSearchExtension(), RexxSource::argList(), and RexxMemory::createImage().
RexxObject * RexxList::index | ( | RexxObject * | target | ) |
Return the index of the first item with a matching value in the list. Returns .nil if the object is not found.
target | The target object. |
Definition at line 964 of file ListClass.cpp.
References ARG_ONE, count, ENTRY_POINTER, RexxObject::equalValue(), first, new_integer(), listentry::next, requiredArgument(), TheNilObject, and listentry::value.
Referenced by RexxMemory::createImage().
RexxObject * RexxList::indexOfValue | ( | RexxObject * | _value | ) |
Definition at line 1082 of file ListClass.cpp.
References firstRexx(), lastRexx(), next(), OREF_NULL, TheNilObject, and value().
void RexxList::init | ( | void | ) |
Definition at line 66 of file ListClass.cpp.
References first, INITIAL_LIST_SIZE, last, LIST_END, partitionBuffer(), and size.
Referenced by operator new(), and RexxQueue::operator new().
RexxObject * RexxList::insert | ( | RexxObject * | _value, |
RexxObject * | _index | ||
) |
Definition at line 546 of file ListClass.cpp.
References count, ENTRY_INDEX, ENTRY_POINTER, Error_Incorrect_method_index, first, getEntry(), getFree(), IntegerOne, last, LIST_END, new_integer(), listentry::next, OREF_NULL, OrefSet, listentry::previous, reportException(), table, TheNilObject, and listentry::value.
Referenced by append(), and insertRexx().
RexxObject * RexxList::insertRexx | ( | RexxObject * | _value, |
RexxObject * | _index | ||
) |
Definition at line 518 of file ListClass.cpp.
References ARG_ONE, insert(), and requiredArgument().
Referenced by RexxMemory::createImage().
RexxObject * RexxList::isEmpty | ( | ) |
Test if a list is empty.
Definition at line 926 of file ListClass.cpp.
References count, TheFalseObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 97 of file ListClass.hpp.
References count.
Referenced by ActivityManager::activityEnded(), RexxQueue::allIndexes(), InterpreterInstance::detachThread(), Interpreter::lastInstance(), RexxQueue::lastRexx(), ActivityManager::poolActivity(), InterpreterInstance::poolActivity(), RexxSource::processInstall(), InterpreterInstance::removeInactiveActivities(), RexxSource::resolveDependencies(), InterpreterInstance::terminate(), and Interpreter::terminateInterpreter().
RexxObject * RexxList::itemsRexx | ( | void | ) |
Definition at line 1148 of file ListClass.cpp.
References count, and new_integer().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 85 of file ListClass.hpp.
References last.
Referenced by InterpreterInstance::findActivity(), and ActivityManager::findActivity().
RexxObject * RexxList::lastItem | ( | void | ) |
Definition at line 697 of file ListClass.cpp.
References ENTRY_POINTER, last, LIST_END, and TheNilObject.
Referenced by RexxMemory::createImage(), and RexxActivation::termination().
RexxObject * RexxList::lastRexx | ( | void | ) |
Definition at line 728 of file ListClass.cpp.
References last, LIST_END, new_integer(), and TheNilObject.
Referenced by RexxMemory::createImage(), and indexOfValue().
|
virtual |
Reimplemented from RexxObject.
Definition at line 153 of file ListClass.cpp.
References memory_mark, and table.
|
virtual |
Reimplemented from RexxObject.
Definition at line 162 of file ListClass.cpp.
References memory_mark_general, and table.
|
virtual |
Reimplemented from RexxObject.
Definition at line 873 of file ListClass.cpp.
References allItems().
Referenced by RexxActivity::display(), PackageClass::getImportedPackages(), StringUtil::makearray(), requestArray(), supplier(), and RexxQueue::supplier().
RexxArray * RexxList::makeArrayIndices | ( | ) |
Definition at line 1112 of file ListClass.cpp.
References count, ENTRY_POINTER, first, new_array(), new_integer(), listentry::next, and RexxArray::put().
Referenced by supplier().
RexxList * RexxList::newRexx | ( | RexxObject ** | init_args, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 1226 of file ListClass.cpp.
References RexxClass::checkAbstract(), RexxClass::getInstanceBehaviour(), RexxInternalObject::hasUninit(), RexxClass::hasUninitDefined(), RexxList(), RexxObject::sendMessage(), and RexxInternalObject::setBehaviour().
Referenced by RexxMemory::createImage().
RexxObject * RexxList::next | ( | RexxObject * | _index | ) |
Definition at line 744 of file ListClass.cpp.
References Error_Incorrect_method_index, getEntry(), IntegerOne, LIST_END, new_integer(), listentry::next, reportException(), and TheNilObject.
Referenced by RexxMemory::createImage(), and indexOfValue().
size_t RexxList::nextIndex | ( | size_t | _index | ) |
A low-level next() method for internal usage. This works directly off the index values without needing to create object instances. This is critical for some of the internal data structures implemented as lists.
_index | The target item index. |
Definition at line 804 of file ListClass.cpp.
References getEntry(), LIST_END, and listentry::next.
Referenced by ClassDirective::addDependencies(), Interpreter::haltAllActivities(), InterpreterInstance::haltAllActivities(), ClassDirective::install(), ExtensionDirective::install(), RexxSource::processInstall(), RexxClass::removeSubclass(), RexxSource::resolveDependencies(), SysInterpreterInstance::resolveProgramName(), RexxMessage::sendNotification(), and InterpreterInstance::traceAllActivities().
|
inline |
Definition at line 67 of file ListClass.hpp.
void * RexxList::operator new | ( | size_t | size | ) |
Definition at line 1213 of file ListClass.cpp.
References init(), INITIAL_LIST_SIZE, RexxInternalObject::setBehaviour(), and TheListBehaviour.
void RexxList::partitionBuffer | ( | size_t | first_entry, |
size_t | entry_count | ||
) |
Definition at line 92 of file ListClass.cpp.
References ENTRY_POINTER, free, LIST_END, listentry::next, NOT_ACTIVE, OREF_NULL, OrefSet, listentry::previous, table, and listentry::value.
RexxObject * RexxList::previous | ( | RexxObject * | _index | ) |
Definition at line 769 of file ListClass.cpp.
References Error_Incorrect_method_index, getEntry(), IntegerOne, LIST_END, new_integer(), listentry::previous, reportException(), and TheNilObject.
Referenced by RexxMemory::createImage().
size_t RexxList::previousIndex | ( | size_t | _index | ) |
A low-level previous() method for internal usage. This works directly off the index values without needing to create object instances. This is critical for some of the internal data structures implemented as lists.
_index | The target item index. |
Definition at line 830 of file ListClass.cpp.
References getEntry(), LIST_END, and listentry::previous.
Referenced by InterpreterInstance::findActivity(), and ActivityManager::findActivity().
RexxObject * RexxList::primitiveRemove | ( | LISTENTRY * | element | ) |
Definition at line 640 of file ListClass.cpp.
References count, ENTRY_INDEX, ENTRY_POINTER, first, free, last, LIST_END, listentry::next, NOT_ACTIVE, listentry::previous, TheNilObject, and listentry::value.
Referenced by empty(), remove(), RexxQueue::remove(), removeFirst(), removeFirstItem(), removeIndex(), removeItem(), removeLast(), removeLastItem(), removeObject(), and weakReferenceArray().
RexxObject * RexxList::put | ( | RexxObject * | _value, |
RexxObject * | _index | ||
) |
Definition at line 289 of file ListClass.cpp.
References ARG_ONE, Error_Incorrect_method_index, getEntry(), IntegerTwo, OREF_NULL, OrefSet, reportException(), requiredArgument(), table, and listentry::value.
Referenced by RexxMemory::createImage().
RexxObject * RexxList::remove | ( | RexxObject * | _index | ) |
Definition at line 630 of file ListClass.cpp.
References getEntry(), IntegerOne, and primitiveRemove().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 109 of file ListClass.hpp.
References ENTRY_POINTER, first, LIST_END, primitiveRemove(), and TheNilObject.
Referenced by RexxVariableReference::drop(), RexxVariableReference::expose(), RexxQueue::pop(), RexxActivation::popEnvironment(), RexxVariableReference::procedureExpose(), RexxVariableDictionary::release(), RexxMessage::sendNotification(), RexxSource::translateBlock(), and RexxVariableReference::upper().
|
inline |
Definition at line 111 of file ListClass.hpp.
References ENTRY_POINTER, first, LIST_END, OREF_NULL, and primitiveRemove().
Referenced by ActivityManager::clearActivityPool(), ActivityManager::createNewActivity(), and InterpreterInstance::removeInactiveActivities().
|
inline |
Definition at line 113 of file ListClass.hpp.
References ENTRY_POINTER, and primitiveRemove().
Referenced by RexxClass::removeSubclass(), and RexxSource::resolveDependencies().
RexxObject * RexxList::removeItem | ( | RexxObject * | target | ) |
Removes an item from the collection.
target | The target value. |
Definition at line 1023 of file ListClass.cpp.
References ARG_ONE, count, ENTRY_POINTER, RexxObject::equalValue(), first, listentry::next, primitiveRemove(), requiredArgument(), TheNilObject, and listentry::value.
Referenced by ActivityManager::activityEnded(), RexxMemory::createImage(), InterpreterInstance::detachThread(), ActivityManager::poolActivity(), InterpreterInstance::poolActivity(), ActivityManager::returnActivity(), ActivityManager::returnRootActivity(), InterpreterInstance::terminate(), and Interpreter::terminateInterpreterInstance().
|
inline |
Definition at line 110 of file ListClass.hpp.
References ENTRY_POINTER, last, LIST_END, primitiveRemove(), and TheNilObject.
|
inline |
Definition at line 112 of file ListClass.hpp.
References ENTRY_POINTER, last, LIST_END, OREF_NULL, and primitiveRemove().
RexxObject * RexxList::removeObject | ( | RexxObject * | target | ) |
Removes an item from the collection using Object identity comparisons. This is used in some special circumstances when we don't want to have the equals method called, which can cause some exceptions or false positives. This is used primarily for managing the local reference save lists.
target | The target value. |
Definition at line 1058 of file ListClass.cpp.
References ARG_ONE, count, ENTRY_POINTER, first, listentry::next, primitiveRemove(), requiredArgument(), TheNilObject, and listentry::value.
RexxArray * RexxList::requestArray | ( | ) |
Definition at line 857 of file ListClass.cpp.
References isOfClass, makeArray(), and RexxObject::sendMessage().
RexxObject * RexxList::section | ( | RexxObject * | _index, |
RexxObject * | _count | ||
) |
Definition at line 309 of file ListClass.cpp.
References addLast(), ARG_TWO, ENTRY_POINTER, Error_Incorrect_method_index, getEntry(), IntegerOne, isOfClass, LIST_END, listentry::next, OREF_NULL, reportException(), RexxObject::requiredNonNegative(), RexxList(), sectionSubclass(), and listentry::value.
Referenced by RexxMemory::createImage().
RexxObject * RexxList::sectionSubclass | ( | LISTENTRY * | element, |
size_t | counter | ||
) |
Definition at line 354 of file ListClass.cpp.
References RexxInternalObject::behaviour, ENTRY_POINTER, RexxBehaviour::getOwningClass(), LIST_END, listentry::next, RexxObject::sendMessage(), and listentry::value.
Referenced by section().
RexxSupplier * RexxList::supplier | ( | void | ) |
Definition at line 1131 of file ListClass.cpp.
References makeArray(), makeArrayIndices(), and new_supplier().
Referenced by RexxMemory::createImage().
RexxObject * RexxList::value | ( | RexxObject * | _index | ) |
Definition at line 246 of file ListClass.cpp.
References getEntry(), IntegerOne, OREF_NULL, TheNilObject, and listentry::value.
Referenced by RexxMemory::createImage(), and indexOfValue().
RexxArray * RexxList::weakReferenceArray | ( | ) |
Not really part of normal list operation, but classes maintain their subclasses as a list of weak references so that subclasses can get garbage collected when no longer needed. When the class needs to iterate over the subclasses, it needs to resolve which weak references are still valid. This method will check the weak references and remove any stale entries. Then it will return an array of the dereferenced objects.
Definition at line 1170 of file ListClass.cpp.
References RexxArray::append(), count, ENTRY_POINTER, firstIndex(), WeakReference::get(), if(), new_array(), listentry::next, OREF_NULL, primitiveRemove(), and listentry::value.
Referenced by RexxClass::getSubClasses().
|
friend |
Definition at line 64 of file ListClass.hpp.
Definition at line 134 of file ListClass.hpp.
|
protected |
Definition at line 141 of file ListClass.hpp.
Referenced by add(), addFirst(), addLast(), allIndexes(), allItems(), RexxQueue::append(), getSize(), hasItem(), index(), RexxQueue::index(), insert(), RexxQueue::insert(), isEmpty(), items(), itemsRexx(), makeArrayIndices(), primitiveRemove(), removeItem(), removeObject(), and weakReferenceArray().
|
protected |
Definition at line 139 of file ListClass.hpp.
Referenced by add(), addFirst(), addLast(), allIndexes(), allItems(), empty(), RexxQueue::entryToIndex(), firstIndex(), firstItem(), firstRexx(), RexxQueue::firstRexx(), hasItem(), index(), RexxQueue::index(), init(), insert(), RexxQueue::insert(), RexxQueue::locateEntry(), makeArrayIndices(), primitiveRemove(), removeFirst(), removeFirstItem(), removeItem(), and removeObject().
|
protected |
Definition at line 143 of file ListClass.hpp.
Referenced by getFree(), partitionBuffer(), and primitiveRemove().
|
protected |
Definition at line 140 of file ListClass.hpp.
Referenced by add(), addFirst(), addLast(), init(), insert(), RexxQueue::insert(), lastIndex(), lastItem(), lastRexx(), RexxQueue::lastRexx(), primitiveRemove(), removeLast(), and removeLastItem().
|
protected |
Definition at line 142 of file ListClass.hpp.
Referenced by getEntry(), getFree(), and init().
|
protected |
Definition at line 138 of file ListClass.hpp.
Referenced by add(), addFirst(), addLast(), copy(), getFree(), insert(), RexxQueue::insert(), live(), liveGeneral(), RexxListTable::operator new(), partitionBuffer(), put(), and RexxQueue::put().