ooRexx
4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
![]() ![]() |
#include <ListClass.hpp>
Static Public Member Functions | |
static void | createInstance () |
![]() | |
static void | decodeMessageName (RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope) |
static void | createInstance () |
![]() | |
static size_t | getObjectHeaderSize () |
Static Public Attributes | |
static RexxClass * | classInstance = OREF_NULL |
![]() | |
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 | |
![]() | |
ObjectHeader | header |
RexxBehaviour * | behaviour |
![]() | |
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 380 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 485 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 454 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(), RexxQueue::section(), section(), and RexxActivation::trap().
RexxArray * RexxList::allIndexes | ( | void | ) |
Return an array containing all elements contained in the list, in sorted order.
Definition at line 937 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 887 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 537 of file ListClass.cpp.
References ARG_ONE, insert(), OREF_NULL, and requiredArgument().
Referenced by ProtectedSet::add(), ClassDirective::addInherits(), RexxSource::addPackage(), SysInterpreterInstance::addSearchExtension(), InterpreterInstance::attachThread(), RexxSource::classDirective(), ActivityManager::createCurrentActivity(), RexxMemory::createImage(), Interpreter::createInterpreterInstance(), ActivityManager::createNewActivity(), 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 | ||
) |
Definition at line 1238 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 RexxInternalObject.
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 907 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(), InterpreterInstance::haltAllActivities(), Interpreter::haltAllActivities(), ClassDirective::install(), RexxSource::processInstall(), RexxClass::removeSubclass(), RexxSource::resolveDependencies(), SysInterpreterInstance::resolveProgramName(), RexxMessage::sendNotification(), InterpreterInstance::traceAllActivities(), and weakReferenceArray().
RexxObject * RexxList::firstItem | ( | void | ) |
Definition at line 681 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 711 of file ListClass.cpp.
References first, LIST_END, new_integer(), and TheNilObject.
Referenced by RexxMemory::createImage(), and indexOfValue().
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 170 of file ListClass.cpp.
References cleanUpFlatten, flatten_reference, and setUpFlatten.
LISTENTRY * RexxList::getEntry | ( | RexxObject * | _index, |
RexxObject * | position | ||
) |
Definition at line 183 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 229 of file ListClass.cpp.
References ENTRY_POINTER, NOT_ACTIVE, listentry::previous, and size.
size_t RexxList::getFree | ( | void | ) |
Definition at line 114 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(), RexxQueue::insert(), and 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 275 of file ListClass.cpp.
References getEntry(), OREF_NULL, and listentry::value.
Referenced by ClassDirective::addDependencies(), ActivityManager::findActivity(), InterpreterInstance::findActivity(), InterpreterInstance::haltAllActivities(), Interpreter::haltAllActivities(), ClassDirective::install(), RexxSource::processInstall(), RexxClass::removeSubclass(), RexxSource::resolveDependencies(), SysInterpreterInstance::resolveProgramName(), RexxMessage::sendNotification(), and InterpreterInstance::traceAllActivities().
RexxObject * RexxList::hasIndex | ( | RexxObject * | _index | ) |
Definition at line 844 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 993 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(), 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 963 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 1081 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 RexxQueue::operator new(), and operator new().
RexxObject * RexxList::insert | ( | RexxObject * | _value, |
RexxObject * | _index | ||
) |
Definition at line 545 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 517 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 925 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 1145 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 ActivityManager::findActivity(), and InterpreterInstance::findActivity().
RexxObject * RexxList::lastItem | ( | void | ) |
Definition at line 696 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 727 of file ListClass.cpp.
References last, LIST_END, new_integer(), and TheNilObject.
Referenced by RexxMemory::createImage(), and indexOfValue().
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 152 of file ListClass.cpp.
References memory_mark, and table.
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 161 of file ListClass.cpp.
References memory_mark_general, and table.
|
virtual |
Reimplemented from RexxInternalObject.
Definition at line 872 of file ListClass.cpp.
References allItems().
Referenced by RexxActivity::display(), PackageClass::getImportedPackages(), StringUtil::makearray(), requestArray(), RexxQueue::supplier(), and supplier().
RexxArray * RexxList::makeArrayIndices | ( | ) |
Definition at line 1111 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 | ||
) |
Definition at line 1212 of file ListClass.cpp.
References RexxInternalObject::hasUninit(), RexxList(), RexxObject::sendMessage(), and RexxInternalObject::setBehaviour().
Referenced by RexxMemory::createImage().
RexxObject * RexxList::next | ( | RexxObject * | _index | ) |
Definition at line 743 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 803 of file ListClass.cpp.
References getEntry(), LIST_END, and listentry::next.
Referenced by ClassDirective::addDependencies(), InterpreterInstance::haltAllActivities(), Interpreter::haltAllActivities(), ClassDirective::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 1199 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 91 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 768 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 829 of file ListClass.cpp.
References getEntry(), LIST_END, and listentry::previous.
Referenced by ActivityManager::findActivity(), and InterpreterInstance::findActivity().
RexxObject * RexxList::primitiveRemove | ( | LISTENTRY * | element | ) |
Definition at line 639 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(), RexxQueue::remove(), remove(), removeFirst(), removeFirstItem(), removeIndex(), removeItem(), removeLast(), removeLastItem(), removeObject(), and weakReferenceArray().
RexxObject * RexxList::put | ( | RexxObject * | _value, |
RexxObject * | _index | ||
) |
Definition at line 288 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 629 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(), and RexxSource::translateBlock().
|
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 1022 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 1057 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 856 of file ListClass.cpp.
References isOfClass, makeArray(), and RexxObject::sendMessage().
RexxObject * RexxList::section | ( | RexxObject * | _index, |
RexxObject * | _count | ||
) |
Definition at line 308 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 353 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 1130 of file ListClass.cpp.
References makeArray(), makeArrayIndices(), and new_supplier().
Referenced by RexxMemory::createImage().
RexxObject * RexxList::value | ( | RexxObject * | _index | ) |
Definition at line 245 of file ListClass.cpp.
References getEntry(), IntegerOne, OREF_NULL, TheNilObject, and listentry::value.
Referenced by RexxMemory::createImage(), and indexOfValue().
RexxArray * RexxList::weakReferenceArray | ( | ) |
Definition at line 1155 of file ListClass.cpp.
References count, ENTRY_POINTER, firstIndex(), WeakReference::get(), if(), new_array(), listentry::next, OREF_NULL, primitiveRemove(), RexxArray::put(), 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(), RexxQueue::index(), index(), RexxQueue::insert(), 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(), RexxQueue::firstRexx(), firstRexx(), hasItem(), RexxQueue::index(), index(), init(), RexxQueue::insert(), 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(), RexxQueue::insert(), insert(), lastIndex(), lastItem(), RexxQueue::lastRexx(), 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(), RexxQueue::insert(), insert(), live(), liveGeneral(), RexxListTable::operator new(), partitionBuffer(), RexxQueue::put(), and put().