#include <ArrayClass.hpp>
Static Public Member Functions | |
static RexxArray * | createMultidimensional (RexxObject **dims, size_t count, RexxClass *) |
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 RexxArray * | nullArray = OREF_NULL |
static const size_t | ARRAY_MIN_SIZE = 4 |
static const size_t | ARRAY_DEFAULT_SIZE = 10 |
Static Public Attributes inherited from RexxObject | |
static PCPPM | operatorMethods [] |
static RexxClass * | classInstance = OREF_NULL |
Protected Member Functions | |
void | mergeSort (BaseSortComparator &comparator, RexxArray *working, size_t left, size_t right) |
void | merge (BaseSortComparator &comparator, RexxArray *working, size_t left, size_t mid, size_t right) |
size_t | find (BaseSortComparator &comparator, RexxObject *val, int bnd, size_t left, size_t right) |
void | openGap (size_t index, size_t elements) |
void | closeGap (size_t index, size_t elements) |
RexxObject ** | slotAddress (size_t index) |
size_t | dataSize () |
Protected Member Functions inherited from RexxVirtualBase | |
virtual | ~RexxVirtualBase () |
virtual void | baseVirtual () |
Static Protected Member Functions | |
static void | arraycopy (RexxArray *source, size_t start, RexxArray *target, size_t index, size_t count) |
Protected Attributes | |
size_t | arraySize |
size_t | maximumSize |
size_t | lastElement |
RexxArray * | dimensions |
RexxArray * | expansionArray |
RexxObject * | objects [1] |
Static Protected Attributes | |
static const size_t | MAX_FIXEDARRAY_SIZE = (Numerics::MAX_WHOLENUMBER/10) + 1 |
Additional Inherited Members | |
Public Attributes inherited from RexxInternalObject | |
ObjectHeader | header |
RexxBehaviour * | behaviour |
Definition at line 100 of file ArrayClass.hpp.
|
inline |
Definition at line 125 of file ArrayClass.hpp.
|
inline |
Definition at line 126 of file ArrayClass.hpp.
Referenced by newRexx().
|
inline |
Definition at line 127 of file ArrayClass.hpp.
|
inline |
Definition at line 199 of file ArrayClass.hpp.
References insert().
Referenced by RexxClass::newRexx(), RexxClass::setMetaClass(), and RexxClass::subclass().
|
inline |
Definition at line 198 of file ArrayClass.hpp.
References insert(), and size().
Referenced by RexxClass::inherit(), and RexxClass::subClassable().
RexxArray * RexxArray::allIndexes | ( | RexxObject * | maxIndexes = OREF_NULL | ) |
Return an array of all indices of real array items contained in the collection.
Definition at line 1505 of file ArrayClass.cpp.
References ARG_ONE, arraySize, convertIndex(), data(), items(), min, new_array(), OREF_NULL, put(), RexxObject::requiredNonNegative(), and size().
Referenced by RexxMemory::createImage().
RexxArray * RexxArray::allItems | ( | RexxObject * | maxItems = OREF_NULL | ) |
Return an array of all real items contained in the collection.
Definition at line 1470 of file ArrayClass.cpp.
References ARG_ONE, arraySize, data(), items(), min, new_array(), OREF_NULL, put(), RexxObject::requiredNonNegative(), and size().
Referenced by RexxMemory::createImage(), and makeArray().
size_t RexxArray::append | ( | RexxObject * | value | ) |
Append an item after the last item in the array.
value | The value to append. |
Definition at line 485 of file ArrayClass.cpp.
References ensureSpace(), lastElement, and put().
Referenced by RexxInstructionForward::execute(), RexxActivity::generateStackFrames(), StringUtil::subWords(), RexxList::weakReferenceArray(), and StringUtil::words().
RexxObject * RexxArray::appendRexx | ( | RexxObject * | value | ) |
Append an item after the last item in the array.
value | The value to append. |
Definition at line 314 of file ArrayClass.cpp.
References ARG_ONE, ensureSpace(), Error_Incorrect_method_array_dimension, isMultiDimensional(), lastElement, new_integer(), put(), reportException(), and requiredArgument().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 201 of file ArrayClass.hpp.
References makeArray().
|
staticprotected |
copy segments of one array into another.
source | The source array |
start | The starting index of the source copy |
target | The target array |
index | The target copy index |
count | The number of items to count. |
Definition at line 2508 of file ArrayClass.cpp.
References get(), index(), put(), and RexxObject::start().
Referenced by merge().
RexxInteger * RexxArray::available | ( | size_t | position | ) |
Definition at line 834 of file ArrayClass.cpp.
References size(), TheFalseObject, and TheTrueObject.
|
protected |
Close a gap in the array item.
index | The gap to close. |
elements | The size of the gap to close. |
Definition at line 447 of file ArrayClass.cpp.
References index(), lastElement, Numerics::minVal(), OREF_NULL, put(), shrink(), size(), and slotAddress().
Referenced by deleteItem().
RexxObject * RexxArray::convertIndex | ( | size_t | idx | ) |
Convert an internal index item into "external" form. Handles both single- and multi-dimensional arrays.
idx | The internal index to convert. |
Definition at line 1814 of file ArrayClass.cpp.
References indexToArray(), isSingleDimensional(), and new_integer().
Referenced by allIndexes(), firstRexx(), index(), lastRexx(), nextRexx(), previousRexx(), and supplier().
|
virtual |
Copy the array (and the expansion array, if necessary)
Reimplemented from RexxObject.
Definition at line 122 of file ArrayClass.cpp.
References copy(), RexxObject::copy(), expansionArray, OREF_NULL, and setExpansion().
Referenced by RoutineClass::callWithRexx(), copy(), RexxNativeActivation::forwardMessage(), getDimensions(), RexxBlock::getSource(), RexxClass::getSuperClasses(), RexxClass::newRexx(), RexxSourceLiteral::RexxSourceLiteral(), RexxObject::run(), RexxObject::sendMessage(), RexxObject::sendWith(), RexxActivation::setArguments(), RexxObject::startWith(), and RexxStem::unknown().
|
static |
Create initial class object at bootstrap time.
Definition at line 95 of file ArrayClass.cpp.
References CLASS_CREATE, new_array(), and nullArray.
Referenced by RexxMemory::createImage().
|
static |
Helper routine for creating a multidimensional array.
dims | Pointer to an array of pointers to dimension objects. |
count | the number of dimensions to create |
Definition at line 2339 of file ArrayClass.cpp.
References dimensions, Error_Incorrect_method_array_too_big, MAX_FIXEDARRAY_SIZE, missingArgument(), new_array(), new_externalArray(), new_integer(), OREF_NULL, OrefSet, put(), reportException(), RexxObject::requiredNonNegative(), and RexxObject::sendMessage().
Referenced by operator new().
|
inline |
Definition at line 204 of file ArrayClass.hpp.
References expansionArray, and objects.
Referenced by allIndexes(), allItems(), RoutineClass::callWithRexx(), dataSize(), empty(), RexxInstructionForward::execute(), extend(), extendMulti(), RexxNativeActivation::forwardMessage(), get(), getRexx(), hasIndexApi(), hasIndexNative(), hasIndexRexx(), join(), RexxMessage::newRexx(), nextRexx(), openGap(), operator new(), put(), remove(), removeRexx(), RexxMemory::restoreStrings(), RexxStartDispatcher::run(), CallRoutineDispatcher::run(), CallProgramDispatcher::run(), RexxObject::run(), section(), RexxObject::sendMessage(), RexxObject::sendWith(), RexxActivation::setArguments(), slotAddress(), RexxStem::sort(), RexxObject::startCommon(), RexxObject::startWith(), RexxStem::unknown(), and validateIndex().
|
inline |
|
inlineprotected |
Definition at line 233 of file ArrayClass.hpp.
References data(), size(), and slotAddress().
Referenced by join().
RexxObject * RexxArray::deleteItem | ( | size_t | _index | ) |
Insert an element into the array, shifting all of the existing elements at the inserted position and adjusting the size accordingly.
value | The value to insert (can be OREF_NULL to just open a new slot) |
_index | The insertion index position. |
Definition at line 2239 of file ArrayClass.cpp.
References closeGap(), get(), OREF_NULL, and TheNilObject.
Referenced by deleteRexx(), and RexxClass::uninherit().
RexxObject * RexxArray::deleteRexx | ( | RexxObject * | index | ) |
Delete an element from the given index location, shifting the item indexes as required.
index | The target index. This can be a single number or an array containing a single number. |
Definition at line 385 of file ArrayClass.cpp.
References deleteItem(), Error_Incorrect_method_array_dimension, isMultiDimensional(), RaiseBoundsInvalid, RaiseBoundsTooMany, reportException(), and validateIndex().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::dimension | ( | RexxObject * | target | ) |
Definition at line 729 of file ArrayClass.cpp.
References ARG_ONE, dimensions, get(), IntegerOne, IntegerZero, isSingleDimensional(), new_integer(), OREF_NULL, RexxObject::requiredPositive(), and size().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::empty | ( | ) |
Empty all of the items from an array.
Definition at line 273 of file ArrayClass.cpp.
References data(), RexxInternalObject::isNewSpace(), lastElement, objects, OREF_NULL, OrefSet, and size().
Referenced by RexxMemory::createImage().
void RexxArray::ensureSpace | ( | size_t | newSize | ) |
Make sure that the array has been expanded to sufficient size for a primitive put operation.
newSize | The new required size. |
Definition at line 1053 of file ArrayClass.cpp.
References Error_Incorrect_method_array_too_big, extend(), MAX_FIXEDARRAY_SIZE, reportException(), and size().
Referenced by append(), appendRexx(), openGap(), and put().
RexxArray * RexxArray::extend | ( | size_t | extension | ) |
Definition at line 1738 of file ArrayClass.cpp.
References arraySize, data(), expansionArray, maximumSize, new_array(), OREF_NULL, OrefSet, resize(), setExpansion(), and size().
Referenced by ensureSpace(), putApi(), and validateIndex().
RexxArray * RexxArray::extendMulti | ( | RexxObject ** | _index, |
size_t | _indexCount, | ||
size_t | _start | ||
) |
Definition at line 2015 of file ArrayClass.cpp.
References copyElements(), copyElementParm::copyElements, data(), copyElementParm::deltaDimSize, dimensions, expansionArray, copyElementParm::firstChangedDimension, get(), RexxInternalObject::getValue(), isSingleDimensional(), maximumSize, new_array(), new_integer(), copyElementParm::newArray, copyElementParm::newDimArray, copyElementParm::oldDimArray, OREF_NULL, OrefSet, put(), RexxObject::requiredPositive(), resize(), setExpansion(), size(), copyElementParm::skipElements, copyElementParm::startNew, copyElementParm::startOld, and TheArrayClass.
Referenced by validateIndex().
RexxObject * RexxArray::fill | ( | RexxObject * | value | ) |
Fill all locations of the array with the given object
Definition at line 253 of file ArrayClass.cpp.
References ARG_ONE, lastElement, objects, OREF_NULL, OrefSet, requiredArgument(), and size().
Referenced by RexxMemory::createImage().
|
protected |
Finds the place in the given range of specified sorted array, where the element should be inserted for getting sorted array. Uses exponential search algorithm.
comparator | The comparator used to compare pairs of elements. |
val | object to be inserted |
limit | possible values 0,-1. "-1" - val is located at index more then elements equals to val. "0" - val is located at index less then elements equals to val. |
left | The left bound of the insert operation. |
right | The right bound for the insert (inclusive) |
Definition at line 2533 of file ArrayClass.cpp.
References BaseSortComparator::compare(), and get().
Referenced by merge().
size_t RexxArray::findSingleIndexItem | ( | RexxObject * | item | ) |
Find the index of a single item in the array.
item | The item to locate. |
Definition at line 1786 of file ArrayClass.cpp.
References RexxObject::equalValue(), get(), OREF_NULL, and size().
Referenced by hasItem(), index(), and removeItem().
RexxObject * RexxArray::firstItem | ( | void | ) |
Return the first item in the array, or .nil if the array is empty.
Definition at line 1283 of file ArrayClass.cpp.
References expansionArray, objects, OREF_NULL, size(), and TheNilObject.
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::firstRexx | ( | void | ) |
Definition at line 1235 of file ArrayClass.cpp.
References convertIndex(), expansionArray, objects, OREF_NULL, size(), and TheNilObject.
Referenced by RexxMemory::createImage().
|
virtual |
Reimplemented from RexxObject.
Definition at line 179 of file ArrayClass.cpp.
References arraySize, cleanUpFlatten, flatten_reference, and setUpFlatten.
|
inline |
Definition at line 203 of file ArrayClass.hpp.
References data().
Referenced by arraycopy(), RexxInstructionDo::checkOver(), copyElements(), RexxClass::createClassBehaviour(), RexxClass::createInstanceBehaviour(), RexxSource::decodeExternalMethod(), RexxObject::decodeMessageName(), RexxClass::defineClassMethod(), deleteItem(), dimension(), RexxActivity::display(), dumpTokensImpl(), RexxInstructionForward::execute(), extendMulti(), find(), findSingleIndexItem(), RexxSource::get(), getApi(), RexxClass::getMetaClass(), RexxClass::getSuperClass(), RexxSupplier::index(), indexOf(), indexToArray(), RexxClass::isCompatibleWith(), lastItem(), RexxMethod::loadExternalMethod(), RoutineClass::loadExternalRoutine(), merge(), mergeSort(), RexxClass::mergeSuperClassScopes(), RexxActivity::messageSubstitution(), RexxMethod::newMethodObject(), RoutineClass::newRoutineObject(), RexxClause::newToken(), RexxClause::next(), operator new(), RexxSource::position(), RexxSource::processInstall(), RexxActivation::processTraps(), RexxClass::removeClassMethod(), PackageManager::restore(), RexxMemory::restoreImage(), RexxInstructionGuard::RexxInstructionGuard(), RexxSource::routineDirective(), sectionRexx(), sectionSubclass(), RexxStem::sort(), stableSortRexx(), stableSortWithRexx(), RexxBehaviour::superMethod(), supplier(), toString(), RexxActivation::trap(), RexxActivation::trapState(), RexxDirectory::unknown(), RexxClass::updateInstanceSubClasses(), RexxClass::updateSubClasses(), Unicode::utf8proc_graphemeBreak(), validateIndex(), and RexxSupplier::value().
RexxObject * RexxArray::getApi | ( | size_t | position | ) |
Get an item from the array, with array size sensitivity.
position | The target position. |
Definition at line 536 of file ArrayClass.cpp.
size_t RexxArray::getDimension | ( | ) |
Definition at line 693 of file ArrayClass.cpp.
References dimensions, OREF_NULL, and size().
Referenced by arrayArgument(), RexxObject::decodeMessageName(), RexxInstructionForward::execute(), RexxSupplier::initRexx(), RexxMethod::newMethodObject(), RexxMessage::newRexx(), RoutineClass::newRoutineObject(), RexxObject::run(), and RexxDirectory::unknown().
RexxObject * RexxArray::getDimensions | ( | ) |
Return an array of the dimensions of this array.
Definition at line 714 of file ArrayClass.cpp.
References copy(), dimensions, isSingleDimensional(), new_array(), new_integer(), and size().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 206 of file ArrayClass.hpp.
References expansionArray.
RexxObject * RexxArray::getRexx | ( | RexxObject ** | arguments, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
The Rexx stub for the Array GET method. This does full checking for the array.
arguments | The array of all arguments sent to the method (variable arguments allowed here.) |
argCount | The number of arguments in the method call. |
Definition at line 506 of file ArrayClass.cpp.
References data(), OREF_NULL, RaiseBoundsInvalid, RaiseBoundsTooMany, TheNilObject, and validateIndex().
Referenced by RexxMemory::createImage().
bool RexxArray::hasIndexApi | ( | size_t | i | ) |
Determine if an item exists for a given index position.
i | The target index. |
Definition at line 576 of file ArrayClass.cpp.
bool RexxArray::hasIndexNative | ( | size_t | _index | ) |
Definition at line 1438 of file ArrayClass.cpp.
RexxObject * RexxArray::hasIndexRexx | ( | RexxObject ** | _index, |
size_t | _indexCount, | ||
size_t | _named_argCount | ||
) |
Definition at line 1406 of file ArrayClass.cpp.
References data(), OREF_NULL, RaiseBoundsInvalid, RaiseBoundsTooMany, TheFalseObject, TheTrueObject, and validateIndex().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::hasItem | ( | RexxObject * | target | ) |
Test if an item is within the array.
target | The target test item. |
Definition at line 1925 of file ArrayClass.cpp.
References ARG_ONE, findSingleIndexItem(), requiredArgument(), TheFalseObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::index | ( | RexxObject * | target | ) |
Return the index for the first occurrence of the target in the array.
target | The target object. |
Definition at line 1875 of file ArrayClass.cpp.
References ARG_ONE, convertIndex(), findSingleIndexItem(), requiredArgument(), and TheNilObject.
Referenced by arraycopy(), closeGap(), RexxMemory::createImage(), insertAfter(), insertRexx(), and openGap().
size_t RexxArray::indexOf | ( | RexxObject * | target | ) |
Definition at line 1719 of file ArrayClass.cpp.
Referenced by RexxClass::inherit(), and RexxClass::uninherit().
RexxObject * RexxArray::indexToArray | ( | size_t | idx | ) |
Convert a multi-dimensional array index into an array of index values for the flattened dimension.
idx | The index to covert. |
Definition at line 1837 of file ArrayClass.cpp.
References dimensions, get(), RexxInternalObject::getValue(), new_array(), new_integer(), put(), and size().
Referenced by convertIndex().
void RexxArray::init | ( | size_t | _size, |
size_t | maxSize | ||
) |
Initialize an array
_size | The initial size of the array. |
maxSize | The maximum size this array can hold (maxSize >= size) |
Definition at line 108 of file ArrayClass.cpp.
References arraySize, expansionArray, lastElement, maximumSize, and OrefSet.
size_t RexxArray::insert | ( | RexxObject * | value, |
size_t | _index | ||
) |
Insert an element into the array, shifting all of the existing elements at the inserted position and adjusting the size accordingly.
value | The value to insert (can be OREF_NULL to just open a new slot) |
_index | The insertion index position. NOTE: Unlike the Rexx version, the index is the position where this value will be inserted, not the index of where it is inserted after. |
Definition at line 2221 of file ArrayClass.cpp.
References openGap(), and put().
Referenced by addFirst(), addLast(), insertAfter(), and insertRexx().
|
inline |
Definition at line 200 of file ArrayClass.hpp.
References index(), and insert().
Referenced by RexxClass::inherit().
RexxObject * RexxArray::insertRexx | ( | RexxObject * | _value, |
RexxObject * | index | ||
) |
Insert an element into the given index location.
_value | The value to insert. This can be omitted, which will insert an empty slot at the indicated position. |
index | The target index. This can be .nil, which will insert at the beginning, omitted, which will insert at the end, or a single-dimensional index of the position where the value will be inserted after. |
Definition at line 344 of file ArrayClass.cpp.
References Error_Incorrect_method_array_dimension, index(), insert(), isMultiDimensional(), new_integer(), OREF_NULL, RaiseBoundsInvalid, RaiseBoundsTooMany, reportException(), size(), TheNilObject, and validateIndex().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::isEmpty | ( | ) |
Test if an array is empty.
Definition at line 301 of file ArrayClass.cpp.
References items(), TheFalseObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 211 of file ArrayClass.hpp.
References dimensions, OREF_NULL, and size().
Referenced by appendRexx(), deleteRexx(), insertRexx(), isSingleDimensional(), and sectionRexx().
|
inline |
Definition at line 212 of file ArrayClass.hpp.
References isMultiDimensional().
Referenced by convertIndex(), dimension(), extendMulti(), getDimensions(), and validateIndex().
size_t RexxArray::items | ( | void | ) |
Definition at line 663 of file ArrayClass.cpp.
References arraySize, expansionArray, objects, and OREF_NULL.
Referenced by allIndexes(), allItems(), isEmpty(), itemsRexx(), stableSortRexx(), stableSortWithRexx(), supplier(), toString(), and validateIndex().
RexxObject * RexxArray::itemsRexx | ( | void | ) |
Definition at line 685 of file ArrayClass.cpp.
References items(), and new_integer().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::join | ( | RexxArray * | other | ) |
Definition at line 1659 of file ArrayClass.cpp.
References data(), dataSize(), new_array(), size(), and slotAddress().
Referenced by RexxClause::newToken().
size_t RexxArray::lastIndex | ( | ) |
Definition at line 1321 of file ArrayClass.cpp.
References lastElement.
RexxObject * RexxArray::lastItem | ( | void | ) |
Return the last item in the array.
Definition at line 1309 of file ArrayClass.cpp.
References get(), lastElement, and TheNilObject.
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::lastRexx | ( | void | ) |
Definition at line 1262 of file ArrayClass.cpp.
References convertIndex(), lastElement, and TheNilObject.
Referenced by RexxMemory::createImage().
|
virtual |
Reimplemented from RexxObject.
Definition at line 146 of file ArrayClass.cpp.
References arraySize, dimensions, expansionArray, memory_mark, and objects.
|
virtual |
Reimplemented from RexxObject.
Definition at line 164 of file ArrayClass.cpp.
References arraySize, dimensions, expansionArray, memory_mark_general, and objects.
|
virtual |
Reimplemented from RexxObject.
Definition at line 1454 of file ArrayClass.cpp.
References allItems().
Referenced by array(), RexxInstructionDo::execute(), and toString().
RexxString * RexxArray::makeString | ( | RexxString * | format, |
RexxString * | separator | ||
) |
Definition at line 1546 of file ArrayClass.cpp.
References toString().
Referenced by RexxMethod::newMethodObject(), and RoutineClass::newRoutineObject().
|
protected |
Perform the merge operation on two partitions.
comparator | The comparator used to produce the ordering. |
working | The temporary working storage. |
left | The left bound of the range. |
mid | The midpoint of the range. This merges the two partitions (left, mid - 1) and (mid, right). |
right | The right bound of the array. |
Definition at line 2430 of file ArrayClass.cpp.
References arraycopy(), BaseSortComparator::compare(), find(), get(), and put().
Referenced by mergeSort().
|
protected |
The merge sort routine. This will partition the data in to two sections, mergesort each partition, then merge the two partitions together.
comparator | The comparator object used for the compares. |
working | The working array (same size as the sorted array). |
left | The left bound of the partition. |
right | The right bounds of the parition (inclusive). |
Definition at line 2394 of file ArrayClass.cpp.
References BaseSortComparator::compare(), get(), merge(), and put().
Referenced by stableSortRexx(), and stableSortWithRexx().
RexxObject * RexxArray::newRexx | ( | RexxObject ** | arguments, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 2777 of file ArrayClass.cpp.
References RexxArray().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::nextRexx | ( | RexxObject ** | arguments, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 1329 of file ArrayClass.cpp.
References convertIndex(), data(), OREF_NULL, RaiseBoundsInvalid, RaiseBoundsTooMany, size(), TheNilObject, and validateIndex().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::of | ( | RexxObject ** | args, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 2785 of file ArrayClass.cpp.
References dimensions, IntegerZero, new_array(), new_integer(), OREF_NULL, OrefSet, RexxObject::sendMessage(), and TheArrayClass.
Referenced by RexxMemory::createImage().
|
protected |
Open a gap in the array by shifting each element to the right starting at the given index.
index | The index of the first item to shift. |
elements | The number of elements to shift. |
Definition at line 412 of file ArrayClass.cpp.
References data(), ensureSpace(), index(), lastElement, OREF_NULL, size(), and slotAddress().
Referenced by insert().
|
inline |
Definition at line 113 of file ArrayClass.hpp.
|
inline |
Definition at line 116 of file ArrayClass.hpp.
|
inline |
Definition at line 123 of file ArrayClass.hpp.
|
inline |
Definition at line 115 of file ArrayClass.hpp.
|
inline |
Definition at line 117 of file ArrayClass.hpp.
|
inline |
Definition at line 118 of file ArrayClass.hpp.
|
inline |
Definition at line 119 of file ArrayClass.hpp.
|
inline |
Definition at line 120 of file ArrayClass.hpp.
|
inline |
Definition at line 121 of file ArrayClass.hpp.
|
inline |
Definition at line 122 of file ArrayClass.hpp.
|
inline |
Definition at line 114 of file ArrayClass.hpp.
|
inline |
Definition at line 103 of file ArrayClass.hpp.
void * RexxArray::operator new | ( | size_t | size, |
RexxObject * | first | ||
) |
Definition at line 2653 of file ArrayClass.cpp.
References new_array(), and put().
void * RexxArray::operator new | ( | size_t | size, |
RexxObject ** | args, | ||
size_t | argCount, | ||
RexxClass * | arrayClass | ||
) |
Definition at line 2274 of file ArrayClass.cpp.
References ARG_ONE, createMultidimensional(), dimensions, Error_Incorrect_method_array, Error_Incorrect_method_array_too_big, IntegerZero, isOfClass, new_array(), new_externalArray(), number_digits(), OREF_NULL, OrefSet, reportException(), RexxObject::requiredNonNegative(), and RexxObject::sendMessage().
void * RexxArray::operator new | ( | size_t | size, |
RexxObject * | first, | ||
RexxObject * | second | ||
) |
Definition at line 2666 of file ArrayClass.cpp.
References new_array(), and put().
void * RexxArray::operator new | ( | size_t | size, |
RexxObject * | first, | ||
RexxObject * | second, | ||
RexxObject * | third | ||
) |
Definition at line 2676 of file ArrayClass.cpp.
References new_array(), and put().
void * RexxArray::operator new | ( | size_t | size, |
RexxObject * | first, | ||
RexxObject * | second, | ||
RexxObject * | third, | ||
RexxObject * | fourth | ||
) |
Definition at line 2694 of file ArrayClass.cpp.
References new_array(), and put().
void * RexxArray::operator new | ( | size_t | size, |
RexxObject * | first, | ||
RexxObject * | second, | ||
RexxObject * | third, | ||
RexxObject * | fourth, | ||
RexxObject * | fifth | ||
) |
Definition at line 2714 of file ArrayClass.cpp.
References new_array(), and put().
void * RexxArray::operator new | ( | size_t | size, |
size_t | items, | ||
RexxObject ** | first | ||
) |
Definition at line 2248 of file ArrayClass.cpp.
References data(), get(), lastElement, new_array(), and OREF_NULL.
void * RexxArray::operator new | ( | size_t | newSize, |
size_t | size, | ||
size_t | maxSize, | ||
RexxClass * | cls = TheArrayClass |
||
) |
Definition at line 2736 of file ArrayClass.cpp.
References arraySize, expansionArray, RexxInternalObject::hasUninit(), maximumSize, new_object(), and RexxInternalObject::setBehaviour().
RexxObject * RexxArray::previousRexx | ( | RexxObject ** | arguments, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 1362 of file ArrayClass.cpp.
References convertIndex(), expansionArray, objects, OREF_NULL, RaiseBoundsInvalid, RaiseBoundsTooMany, size(), TheNilObject, and validateIndex().
Referenced by RexxMemory::createImage().
void RexxArray::put | ( | RexxObject * | eref, |
size_t | pos | ||
) |
Place an object into the array. JLF: ooRexx4 doesn't check if there is sufficient space, it's up to the caller to check that. I added the call 'ensureSpace(pos)' to ensure there is sufficient space. ooRexx5 does the same, so...
eref | The object to add. |
pos | The index of the added item (origin 1) |
Definition at line 208 of file ArrayClass.cpp.
References data(), ensureSpace(), expansionArray, lastElement, and OrefSet.
Referenced by RexxHashTable::allIndex(), RexxDirectory::allIndexes(), RexxList::allIndexes(), RexxQueue::allIndexes(), RexxHashTable::allIndexes(), allIndexes(), RexxDirectory::allIndexesItems(), RexxDirectory::allItems(), RexxList::allItems(), RexxStem::allItems(), RexxHashTable::allItems(), allItems(), append(), RexxDirectory::appendAllIndexesItemsTo(), appendRexx(), RexxSource::argArray(), arraycopy(), closeGap(), createMultidimensional(), RexxExpressionList::evaluate(), extendMulti(), RexxSource::extractSource(), RexxHashTable::getAll(), PackageManager::getImageData(), RexxBehaviour::getMethods(), indexToArray(), insert(), StringUtil::makearray(), RexxList::makeArrayIndices(), merge(), mergeSort(), RexxMethod::newMethodObject(), RexxMemory::newObjects(), RoutineClass::newRoutineObject(), operator new(), RexxHashTable::primitiveGetAll(), RexxSource::processInstall(), RexxObject::processUnknown(), putApi(), putRexx(), RexxHashTable::removeAll(), RexxStartDispatcher::run(), RexxMemory::saveImage(), sectionRexx(), RexxStem::sort(), RexxHashTable::stringGetAll(), RexxStem::supplier(), RexxHashTable::supplier(), RexxRelation::supplier(), supplier(), RexxStem::tailArray(), RexxActivation::trapDelay(), RexxActivation::trapUndelay(), Unicode::utf8proc_graphemeBreak(), RexxNativeActivation::valuesToObject(), and RexxSource::words().
void RexxArray::putApi | ( | RexxObject * | o, |
size_t | position | ||
) |
Put an array item into an array on behalf of an API. This will extend the array, if necessary, to accomodate the put.
o | The inserted object. |
position | The target position. |
Definition at line 554 of file ArrayClass.cpp.
References Error_Incorrect_method_array_too_big, extend(), MAX_FIXEDARRAY_SIZE, put(), reportException(), and size().
RexxObject * RexxArray::putRexx | ( | RexxObject ** | arguments, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
The Rexx stub for the Array PUT method. This does full checking for the array.
arguments | The array of all arguments sent to the method (variable arguments allowed here.) |
argCount | The number of arguments in the method call. |
Definition at line 228 of file ArrayClass.cpp.
References ARG_ONE, ExtendUpper, missingArgument(), OREF_NULL, put(), RaiseBoundsInvalid, RaiseBoundsTooMany, and validateIndex().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::remove | ( | size_t | _index | ) |
Definition at line 593 of file ArrayClass.cpp.
References data(), expansionArray, lastElement, OREF_NULL, OrefSet, and size().
Referenced by removeItem().
RexxObject * RexxArray::removeItem | ( | RexxObject * | target | ) |
Remove the target object from the collection.
target | The target object. |
Definition at line 1899 of file ArrayClass.cpp.
References ARG_ONE, findSingleIndexItem(), remove(), requiredArgument(), and TheNilObject.
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::removeRexx | ( | RexxObject ** | arguments, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 626 of file ArrayClass.cpp.
References data(), expansionArray, lastElement, OREF_NULL, OrefSet, RaiseBoundsInvalid, RaiseBoundsTooMany, TheNilObject, and validateIndex().
Referenced by RexxMemory::createImage().
void RexxArray::resize | ( | void | ) |
Definition at line 1678 of file ArrayClass.cpp.
References arraySize, expansionArray, RexxInternalObject::isOldSpace(), memoryObject, objects, OREF_NULL, OrefSet, and RexxMemory::reSize().
Referenced by extend(), and extendMulti().
RexxArray * RexxArray::section | ( | size_t | _start, |
size_t | _end | ||
) |
Section an array to the given size.
_start | The starting point of the section. |
_end | The end section index |
Definition at line 1086 of file ArrayClass.cpp.
References data(), new_array(), size(), and slotAddress().
RexxObject * RexxArray::sectionRexx | ( | RexxObject * | _start, |
RexxObject * | _end | ||
) |
Extract a section of the array as another array
_start | The starting index position |
_end | The number of items to section. |
Definition at line 1128 of file ArrayClass.cpp.
References ARG_ONE, ARG_TWO, Error_Incorrect_method_section, get(), isMultiDimensional(), isOfClass, new_array(), OREF_NULL, put(), RaiseBoundsInvalid, RaiseBoundsTooMany, reportException(), requiredArgument(), RexxObject::requiredNonNegative(), sectionSubclass(), size(), TheNullArray, and validateIndex().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::sectionSubclass | ( | size_t | _start, |
size_t | _end | ||
) |
Definition at line 1190 of file ArrayClass.cpp.
References RexxInternalObject::behaviour, get(), RexxBehaviour::getOwningClass(), IntegerZero, new_integer(), RexxObject::sendMessage(), and size().
Referenced by sectionRexx().
void RexxArray::setExpansion | ( | RexxObject * | expansion | ) |
Definition at line 826 of file ArrayClass.cpp.
References expansionArray, and OrefSet.
Referenced by copy(), extend(), and extendMulti().
void RexxArray::shrink | ( | size_t | amount | ) |
Definition at line 1706 of file ArrayClass.cpp.
References arraySize, expansionArray, and size().
Referenced by closeGap().
|
inline |
Definition at line 202 of file ArrayClass.hpp.
References arraySize, and expansionArray.
Referenced by addLast(), allIndexes(), allItems(), RexxSupplier::available(), available(), RoutineClass::callWithRexx(), RexxInstructionDo::checkOver(), closeGap(), copyElements(), RexxClass::createClassBehaviour(), RexxClass::createInstanceBehaviour(), dataSize(), RexxSource::decodeExternalMethod(), RexxObject::decodeMessageName(), RexxClass::defineClassMethod(), dimension(), RexxActivity::display(), empty(), ensureSpace(), RexxInstructionForward::execute(), extend(), extendMulti(), fill(), findSingleIndexItem(), firstItem(), firstRexx(), RexxNativeActivation::forwardMessage(), getApi(), getDimension(), getDimensions(), RexxSource::guardNew(), hasIndexApi(), hasIndexNative(), RexxSupplier::index(), indexOf(), indexToArray(), insertRexx(), RexxClass::isCompatibleWith(), isMultiDimensional(), join(), RexxMethod::loadExternalMethod(), RoutineClass::loadExternalRoutine(), RexxClass::mergeSuperClassScopes(), RexxActivity::messageSubstitution(), RexxMethod::newMethodObject(), RexxMessage::newRexx(), RoutineClass::newRoutineObject(), RexxSupplier::next(), nextRexx(), openGap(), previousRexx(), putApi(), remove(), RexxClass::removeClassMethod(), RexxInstructionGuard::RexxInstructionGuard(), RexxSource::RexxSource(), RoutineClass::RoutineClass(), RexxSource::routineDirective(), CallRoutineDispatcher::run(), CallProgramDispatcher::run(), RexxObject::run(), section(), sectionRexx(), sectionSubclass(), RexxObject::sendMessage(), RexxObject::sendWith(), RexxActivation::setArguments(), shrink(), sizeRexx(), RexxObject::startWith(), RexxBehaviour::superMethod(), RexxRelation::supplier(), supplier(), RexxDirectory::unknown(), RexxStem::unknown(), RexxClass::updateInstanceSubClasses(), RexxClass::updateSubClasses(), validateIndex(), and RexxSupplier::value().
RexxInteger * RexxArray::sizeRexx | ( | ) |
Definition at line 1070 of file ArrayClass.cpp.
References new_integer(), and size().
Referenced by RexxMemory::createImage().
|
inlineprotected |
Definition at line 232 of file ArrayClass.hpp.
References data().
Referenced by closeGap(), dataSize(), join(), openGap(), and section().
wholenumber_t RexxArray::sortCompare | ( | RexxObject * | comparator, |
RexxObject * | left, | ||
RexxObject * | right | ||
) |
RexxArray * RexxArray::stableSortRexx | ( | ) |
Sort elements of the array in place, using a stable merge sort.
Definition at line 2585 of file ArrayClass.cpp.
References Error_Execution_sparse_array, get(), items(), mergeSort(), new_array(), OREF_NULL, and reportException().
Referenced by RexxMemory::createImage().
RexxArray * RexxArray::stableSortWithRexx | ( | RexxObject * | comparator | ) |
Sort elements of the array in place, using a stable merge sort.
Definition at line 2621 of file ArrayClass.cpp.
References ARG_ONE, Error_Execution_sparse_array, get(), items(), mergeSort(), new_array(), OREF_NULL, reportException(), and requiredArgument().
Referenced by RexxMemory::createImage().
RexxObject * RexxArray::supplier | ( | RexxObject * | maxItems = OREF_NULL | ) |
Definition at line 786 of file ArrayClass.cpp.
References ARG_ONE, arraySize, convertIndex(), get(), items(), min, new_array(), new_supplier(), OREF_NULL, put(), RexxObject::requiredNonNegative(), and size().
Referenced by RexxMemory::createImage().
RexxString * RexxArray::toString | ( | RexxString * | format, |
RexxString * | separator | ||
) |
Definition at line 1551 of file ArrayClass.cpp.
References RexxMutableBuffer::append(), ARG_ONE, ARG_TWO, Error_Incorrect_method_maxarg, Error_Incorrect_method_option, get(), RexxString::getStringData(), IntegerOne, items(), line_end, makeArray(), RexxMutableBuffer::makeString(), new_string(), RexxObject::newRexx(), OREF_NULL, reportException(), RexxObject::requiredString(), stringArgument(), TheMutableBufferClass, and TheNilObject.
Referenced by RexxMemory::createImage(), and makeString().
bool RexxArray::validateIndex | ( | RexxObject ** | _index, |
size_t | indexCount, | ||
size_t | _start, | ||
size_t | bounds_error, | ||
stringsize_t & | position | ||
) |
Definition at line 843 of file ArrayClass.cpp.
References data(), dimensions, Error_Incorrect_method_array, Error_Incorrect_method_array_too_big, Error_Incorrect_method_maxarg, Error_Incorrect_method_maxsub, Error_Incorrect_method_minarg, Error_Incorrect_method_minsub, Error_Incorrect_method_noarg, extend(), extendMulti(), ExtendUpper, get(), RexxInternalObject::getValue(), IntegerOne, isOfClass, isSingleDimensional(), items(), MAX_FIXEDARRAY_SIZE, OREF_NULL, RaiseBoundsTooMany, RaiseBoundsUpper, reportException(), RexxObject::requiredPositive(), and size().
Referenced by deleteRexx(), getRexx(), hasIndexRexx(), insertRexx(), nextRexx(), previousRexx(), putRexx(), removeRexx(), and sectionRexx().
|
static |
Definition at line 222 of file ArrayClass.hpp.
Referenced by new_externalArray().
|
static |
Definition at line 221 of file ArrayClass.hpp.
Referenced by new_array().
|
protected |
Definition at line 238 of file ArrayClass.hpp.
Referenced by allIndexes(), allItems(), extend(), flatten(), init(), items(), live(), liveGeneral(), operator new(), resize(), shrink(), size(), and supplier().
Definition at line 218 of file ArrayClass.hpp.
|
protected |
Definition at line 241 of file ArrayClass.hpp.
Referenced by createMultidimensional(), dimension(), extendMulti(), getDimension(), getDimensions(), indexToArray(), isMultiDimensional(), live(), liveGeneral(), of(), operator new(), and validateIndex().
|
protected |
Definition at line 242 of file ArrayClass.hpp.
Referenced by copy(), data(), extend(), extendMulti(), firstItem(), firstRexx(), getExpansion(), init(), items(), live(), liveGeneral(), operator new(), previousRexx(), put(), remove(), removeRexx(), resize(), setExpansion(), shrink(), and size().
|
protected |
Definition at line 240 of file ArrayClass.hpp.
Referenced by append(), appendRexx(), closeGap(), empty(), fill(), init(), lastIndex(), lastItem(), lastRexx(), openGap(), operator new(), put(), remove(), and removeRexx().
|
staticprotected |
Definition at line 236 of file ArrayClass.hpp.
Referenced by createMultidimensional(), ensureSpace(), putApi(), and validateIndex().
|
protected |
Definition at line 239 of file ArrayClass.hpp.
Referenced by extend(), extendMulti(), init(), and operator new().
Definition at line 219 of file ArrayClass.hpp.
Referenced by createInstance().
|
protected |
Definition at line 243 of file ArrayClass.hpp.
Referenced by data(), empty(), fill(), firstItem(), firstRexx(), items(), live(), liveGeneral(), previousRexx(), and resize().