RexxArray Class Reference

#include <ArrayClass.hpp>

Inheritance diagram for RexxArray:
[legend]

Public Member Functions

void * operator new (size_t size, void *objectPtr)
 
void * operator new (size_t, RexxObject **, size_t, RexxClass *)
 
void * operator new (size_t, RexxObject *)
 
void * operator new (size_t, RexxObject *, RexxObject *)
 
void * operator new (size_t, RexxObject *, RexxObject *, RexxObject *)
 
void * operator new (size_t, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
void * operator new (size_t, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
void * operator new (size_t, size_t, RexxObject **)
 
void * operator new (size_t, size_t, size_t, RexxClass *cls=TheArrayClass)
 
void operator delete (void *)
 
void operator delete (void *, void *)
 
void operator delete (void *, RexxObject **, size_t, RexxClass *)
 
void operator delete (void *, RexxObject *)
 
void operator delete (void *, RexxObject *, RexxObject *)
 
void operator delete (void *, RexxObject *, RexxObject *, RexxObject *)
 
void operator delete (void *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
void operator delete (void *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
void operator delete (void *, size_t, RexxObject **)
 
void operator delete (void *, size_t, size_t, RexxClass *cls)
 
void operator delete (void *, RexxObject **)
 
 RexxArray (RESTORETYPE restoreType)
 
 RexxArray ()
 
 ~RexxArray ()
 
void init (size_t, size_t)
 
void live (size_t)
 
void liveGeneral (int reason)
 
void flatten (RexxEnvelope *)
 
RexxObjectcopy ()
 
RexxArraymakeArray ()
 
RexxArrayallItems (RexxObject *maxItems=OREF_NULL)
 
RexxArrayallIndexes (RexxObject *maxIndexes=OREF_NULL)
 
RexxStringtoString (RexxString *, RexxString *)
 
RexxStringmakeString (RexxString *, RexxString *)
 
RexxObjectgetRexx (RexxObject **, size_t, size_t)
 
RexxObjectgetApi (size_t pos)
 
void put (RexxObject *eref, size_t pos)
 
RexxObjectputRexx (RexxObject **, size_t, size_t)
 
void putApi (RexxObject *eref, size_t pos)
 
RexxObjectremove (size_t)
 
RexxObjectremoveRexx (RexxObject **, size_t, size_t)
 
RexxObjectappendRexx (RexxObject *)
 
size_t append (RexxObject *)
 
void setExpansion (RexxObject *expansion)
 
RexxIntegeravailable (size_t position)
 
bool validateIndex (RexxObject **, size_t, size_t, size_t, stringsize_t &)
 
RexxIntegersizeRexx ()
 
RexxObjectfirstRexx ()
 
RexxObjectlastRexx ()
 
RexxObjectfirstItem ()
 
RexxObjectlastItem ()
 
size_t lastIndex ()
 
RexxObjectnextRexx (RexxObject **, size_t, size_t)
 
RexxObjectpreviousRexx (RexxObject **, size_t, size_t)
 
RexxArraysection (size_t, size_t)
 
RexxObjectsectionRexx (RexxObject *, RexxObject *)
 
RexxObjectsectionSubclass (size_t, size_t)
 
bool hasIndexNative (size_t)
 
RexxObjecthasIndexRexx (RexxObject **, size_t, size_t)
 
bool hasIndexApi (size_t)
 
size_t items ()
 
RexxObjectitemsRexx ()
 
RexxObjectdimension (RexxObject *)
 
RexxObjectgetDimensions ()
 
size_t getDimension ()
 
RexxObjectsupplier (RexxObject *maxItems=OREF_NULL)
 
RexxObjectjoin (RexxArray *)
 
RexxArrayextend (size_t)
 
void shrink (size_t)
 
size_t indexOf (RexxObject *)
 
RexxArrayextendMulti (RexxObject **, size_t, size_t)
 
void resize ()
 
void ensureSpace (size_t newSize)
 
RexxObjectnewRexx (RexxObject **, size_t, size_t)
 
RexxObjectof (RexxObject **, size_t, size_t)
 
RexxObjectempty ()
 
RexxObjectisEmpty ()
 
RexxObjectfill (RexxObject *)
 
RexxObjectindex (RexxObject *)
 
RexxObjecthasItem (RexxObject *)
 
RexxObjectremoveItem (RexxObject *)
 
wholenumber_t sortCompare (RexxObject *comparator, RexxObject *left, RexxObject *right)
 
RexxArraystableSortRexx ()
 
RexxArraystableSortWithRexx (RexxObject *comparator)
 
RexxObjectinsertRexx (RexxObject *_value, RexxObject *index)
 
size_t insert (RexxObject *_value, size_t index)
 
RexxObjectdeleteRexx (RexxObject *index)
 
RexxObjectdeleteItem (size_t index)
 
size_t addLast (RexxObject *item)
 
size_t addFirst (RexxObject *item)
 
size_t insertAfter (RexxObject *item, size_t index)
 
RexxArrayarray ()
 
size_t size ()
 
RexxObjectget (size_t pos)
 
RexxObject ** data ()
 
RexxObject ** data (size_t pos)
 
RexxArraygetExpansion ()
 
size_t findSingleIndexItem (RexxObject *item)
 
RexxObjectindexToArray (size_t idx)
 
RexxObjectconvertIndex (size_t idx)
 
bool isMultiDimensional ()
 
bool isSingleDimensional ()
 
- Public Member Functions inherited from RexxObject
void * operator new (size_t, RexxClass *)
 
void * operator new (size_t, RexxClass *, RexxObject **, size_t, size_t)
 
void * operator new (size_t size, void *objectPtr)
 
void operator delete (void *, void *)
 
void operator delete (void *)
 
void operator delete (void *, RexxClass *)
 
void operator delete (void *, RexxClass *, RexxObject **, size_t)
 
RexxObjectnewRexx (RexxObject **arguments, size_t argCount, size_t named_argCount)
 
RexxObjectnewObject ()
 
 operator RexxInternalObject * ()
 
 RexxObject ()
 
 RexxObject (RESTORETYPE restoreType)
 
void initializeNewObject (size_t size, size_t mark, void *vft, RexxBehaviour *b)
 
void initializeNewObject (size_t mark, void *vft, RexxBehaviour *b)
 
virtual ~RexxObject ()
 
virtual RexxObjectdefMethod (RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
 
virtual RexxStringdefaultName ()
 
virtual RexxObjectunknown (RexxString *msg, RexxArray *args, RexxDirectory *named_args)
 
virtual RexxIntegerhasMethod (RexxString *msg)
 
bool hasUninitMethod ()
 
RexxObjectinit ()
 
void uninit ()
 
HashCode hash ()
 
bool truthValue (int)
 
virtual bool logicalValue (logical_t &)
 
virtual bool numberValue (wholenumber_t &result, size_t precision)
 
virtual bool numberValue (wholenumber_t &result)
 
virtual bool unsignedNumberValue (stringsize_t &result, size_t precision)
 
virtual bool unsignedNumberValue (stringsize_t &result)
 
virtual bool doubleValue (double &result)
 
RexxNumberStringnumberString ()
 
RexxIntegerintegerValue (size_t)
 
RexxStringmakeString ()
 
RexxStringprimitiveMakeString ()
 
void copyIntoTail (RexxCompoundTail *buffer)
 
RexxStringstringValue ()
 
RexxStringrequestString ()
 
RexxStringrequestStringNoNOSTRING ()
 
RexxIntegerrequestInteger (size_t)
 
bool requestNumber (wholenumber_t &, size_t)
 
bool requestUnsignedNumber (stringsize_t &, size_t)
 
RexxArrayrequestArray ()
 
RexxDirectoryrequestDirectory ()
 
RexxStringrequiredString (RexxString *kind, size_t)
 
RexxStringrequiredString (RexxString *kind, const char *)
 
RexxStringrequiredString ()
 
RexxIntegerrequiredInteger (RexxString *kind, size_t, size_t)
 
wholenumber_t requiredNumber (RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
 
stringsize_t requiredPositive (RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
 
stringsize_t requiredNonNegative (RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
 
bool isEqual (RexxObject *)
 
bool isInstanceOf (RexxClass *)
 
RexxObjectisInstanceOfRexx (RexxClass *)
 
RexxMethodinstanceMethod (RexxString *)
 
RexxSupplierinstanceMethods (RexxClass *)
 
RexxMethodinstanceMethodRexx (RexxString *)
 
RexxSupplierinstanceMethodsRexx (RexxClass *)
 
RexxStringobjectName ()
 
RexxObjectobjectNameEquals (RexxObject *)
 
RexxClassclassObject ()
 
RexxObjectsetMethod (RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
 
RexxObjectunsetMethod (RexxString *)
 
RexxObjectrequestRexx (RexxString *)
 
RexxMessagestart (RexxObject **, size_t, size_t)
 
RexxMessagestartWith (RexxObject *, RexxArray *, RexxObject **, size_t)
 
RexxObjectsend (RexxObject **, size_t, size_t)
 
RexxObjectsendWith (RexxObject *, RexxArray *, RexxObject **, size_t)
 
RexxMessagestartCommon (RexxObject *message, RexxObject **arguments, size_t argCount, size_t named_argCount)
 
RexxStringoref ()
 
RexxObjectpmdict ()
 
RexxObjectrun (RexxObject **, size_t, size_t)
 
bool messageSend (RexxString *, RexxObject **, size_t, size_t, ProtectedObject &, bool processUnknown=true)
 
bool messageSend (RexxString *, RexxObject **, size_t, size_t, RexxObject *, ProtectedObject &, bool processUnknown=true)
 
RexxMethodcheckPrivate (RexxMethod *)
 
void processUnknown (RexxString *, RexxObject **, size_t, size_t, ProtectedObject &)
 
void processProtectedMethod (RexxString *, RexxMethod *, RexxObject **, size_t, size_t, ProtectedObject &)
 
void sendMessage (RexxString *, RexxArray *, RexxDirectory *, ProtectedObject &)
 
void sendMessage (RexxString *message, RexxObject **args, size_t argCount, size_t named_argCount, ProtectedObject &result)
 
void sendMessage (RexxString *message, ProtectedObject &result)
 
void sendMessage (RexxString *message, RexxObject *argument1, ProtectedObject &result)
 
void sendMessage (RexxString *, RexxObject *, RexxObject *, ProtectedObject &)
 
void sendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, ProtectedObject &)
 
void sendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, ProtectedObject &)
 
void sendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, ProtectedObject &)
 
RexxObjectsendMessage (RexxString *, RexxArray *, RexxDirectory *=OREF_NULL)
 
RexxObjectsendMessage (RexxString *message, RexxObject **args, size_t argCount, size_t named_argCount)
 
RexxObjectsendMessage (RexxString *message)
 
RexxObjectsendMessage (RexxString *message, RexxObject *argument1)
 
RexxObjectsendMessage (RexxString *, RexxObject *, RexxObject *)
 
RexxObjectsendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *)
 
RexxObjectsendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
RexxObjectsendMessage (RexxString *, RexxObject *, RexxObject *, RexxObject *, RexxObject *, RexxObject *)
 
RexxObjectdefMethods (RexxDirectory *)
 
void setObjectVariable (RexxString *, RexxObject *, RexxObject *)
 
RexxObjectgetObjectVariable (RexxString *)
 
RexxObjectgetObjectVariable (RexxString *, RexxObject *)
 
void addObjectVariables (RexxVariableDictionary *)
 
void copyObjectVariables (RexxObject *newObject)
 
RexxObjectsuperScope (RexxObject *)
 
RexxMethodsuperMethod (RexxString *, RexxObject *)
 
RexxObjectmdict ()
 
RexxObjectsetMdict (RexxObject *)
 
RexxBehaviourbehaviourObject ()
 
const char * idString ()
 
RexxStringid ()
 
RexxMethodmethodLookup (RexxString *name)
 
RexxVariableDictionarygetObjectVariables (RexxObject *)
 
void guardOn (RexxActivity *activity, RexxObject *scope)
 
void guardOff (RexxActivity *activity, RexxObject *scope)
 
RexxObjectequal (RexxObject *)
 
RexxObjectnotEqual (RexxObject *other)
 
RexxObjectstrictEqual (RexxObject *)
 
RexxObjectstrictNotEqual (RexxObject *other)
 
RexxIntegeridentityHashRexx ()
 
RexxObjecthashCode ()
 
RexxStringstringRexx ()
 
RexxStringconcatRexx (RexxObject *)
 
RexxStringconcatBlank (RexxObject *)
 
RexxObjectmakeStringRexx ()
 
RexxObjectmakeArrayRexx ()
 
RexxStringdefaultNameRexx ()
 
RexxObjectcopyRexx ()
 
RexxObjectunknownRexx (RexxString *, RexxArray *, RexxObject **, size_t)
 
RexxObjecthasMethodRexx (RexxString *)
 
void * getCSelf ()
 
void * getCSelf (RexxObject *scope)
 
bool equalValue (RexxObject *other)
 
virtual wholenumber_t compareTo (RexxObject *)
 
 koper (operator_plus) koper(operator_minus) koper(operator_multiply) koper(operator_divide) koper(operator_integerDivide) koper(operator_remainder) koper(operator_power) koper(operator_abuttal) koper(operator_concat) koper(operator_concatBlank) koper(operator_equal) koper(operator_notEqual) koper(operator_isGreaterThan) koper(operator_isBackslashGreaterThan) koper(operator_isLessThan) koper(operator_isBackslashLessThan) koper(operator_isGreaterOrEqual) koper(operator_isLessOrEqual) koper(operator_strictEqual) koper(operator_strictNotEqual) koper(operator_strictGreaterThan) koper(operator_strictBackslashGreaterThan) koper(operator_strictLessThan) koper(operator_strictBackslashLessThan) koper(operator_strictGreaterOrEqual) koper(operator_strictLessOrEqual) koper(operator_lessThanGreaterThan) koper(operator_greaterThanLessThan) koper(operator_and) koper(operator_or) koper(operator_xor) koper(operator_not) RexxVariableDictionary *objectVariables
 
- Public Member Functions inherited from RexxInternalObject
void * operator new (size_t, RexxClass *)
 
void * operator new (size_t, RexxClass *, RexxObject **, size_t, size_t)
 
void * operator new (size_t size, void *ptr)
 
void operator delete (void *)
 
void operator delete (void *p, void *ptr)
 
 RexxInternalObject ()
 
 RexxInternalObject (RESTORETYPE restoreType)
 
virtual ~RexxInternalObject ()
 
 operator RexxObject * ()
 
size_t getObjectSize ()
 
void setObjectSize (size_t s)
 
size_t getObjectDataSize ()
 
void * getObjectDataSpace ()
 
void clearObject ()
 
void clearObject (size_t l)
 
void setVirtualFunctions (void *t)
 
void setInitHeader (size_t s, size_t markword)
 
void setInitHeader (size_t markword)
 
void setObjectLive (size_t markword)
 
void setHasReferences ()
 
void setHasNoReferences ()
 
bool hasReferences ()
 
bool hasNoReferences ()
 
void setPrimitive ()
 
void setNonPrimitive ()
 
bool isPrimitive ()
 
bool isNonPrimitive ()
 
bool isObjectMarked (size_t markword)
 
void setObjectMark (size_t markword)
 
void clearObjectMark ()
 
bool isObjectLive (size_t mark)
 
bool isObjectDead (size_t mark)
 
bool isOldSpace ()
 
bool isNewSpace ()
 
void setNewSpace ()
 
void setOldSpace ()
 
void makeProxiedObject ()
 
bool isProxyObject ()
 
bool isSubClassOrEnhanced ()
 
bool isBaseClass ()
 
size_t getObjectTypeNumber ()
 
RexxBehaviourgetObjectType ()
 
bool isObjectType (RexxBehaviour *b)
 
bool isObjectType (size_t t)
 
bool isSameType (RexxInternalObject *o)
 
void setBehaviour (RexxBehaviour *b)
 
virtual RexxObjectmakeProxy (RexxEnvelope *)
 
virtual RexxObjectevaluate (RexxActivation *, RexxExpressionStack *)
 
virtual RexxObjectgetValue (RexxActivation *)
 
virtual RexxObjectgetValue (RexxVariableDictionary *)
 
virtual RexxObjectgetRealValue (RexxActivation *)
 
virtual RexxObjectgetRealValue (RexxVariableDictionary *)
 
virtual HashCode getHashValue ()
 
HashCode identityHash ()
 
void hasUninit ()
 
void removedUninit ()
 
void printObject ()
 
RexxObjectclone ()
 
- Public Member Functions inherited from RexxVirtualBase
virtual RexxObjectunflatten (RexxEnvelope *)
 

Static Public Member Functions

static RexxArraycreateMultidimensional (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 RexxClassclassInstance = OREF_NULL
 
static RexxArraynullArray = 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 RexxClassclassInstance = 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
 
RexxArraydimensions
 
RexxArrayexpansionArray
 
RexxObjectobjects [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
 
RexxBehaviourbehaviour
 

Detailed Description

Definition at line 100 of file ArrayClass.hpp.

Constructor & Destructor Documentation

◆ RexxArray() [1/2]

RexxArray::RexxArray ( RESTORETYPE  restoreType)
inline

Definition at line 125 of file ArrayClass.hpp.

◆ RexxArray() [2/2]

RexxArray::RexxArray ( )
inline

Definition at line 126 of file ArrayClass.hpp.

Referenced by newRexx().

◆ ~RexxArray()

RexxArray::~RexxArray ( )
inline

Definition at line 127 of file ArrayClass.hpp.

Member Function Documentation

◆ addFirst()

size_t RexxArray::addFirst ( RexxObject item)
inline

Definition at line 199 of file ArrayClass.hpp.

References insert().

Referenced by RexxClass::newRexx(), RexxClass::setMetaClass(), and RexxClass::subclass().

◆ addLast()

size_t RexxArray::addLast ( RexxObject item)
inline

Definition at line 198 of file ArrayClass.hpp.

References insert(), and size().

Referenced by RexxClass::inherit(), and RexxClass::subClassable().

◆ allIndexes()

RexxArray * RexxArray::allIndexes ( RexxObject maxIndexes = OREF_NULL)

Return an array of all indices of real array items contained in the collection.

Returns
An array with all of the array indices (non-sparse).

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().

◆ allItems()

RexxArray * RexxArray::allItems ( RexxObject maxItems = OREF_NULL)

Return an array of all real items contained in the collection.

Returns
An array with all of the array items (non-sparse).

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().

◆ append()

size_t RexxArray::append ( RexxObject value)

Append an item after the last item in the array.

Parameters
valueThe value to append.
Returns
The index of the appended item.

Definition at line 485 of file ArrayClass.cpp.

References ensureSpace(), lastElement, and put().

Referenced by RexxInstructionForward::execute(), RexxActivity::generateStackFrames(), StringUtil::subWords(), and StringUtil::words().

◆ appendRexx()

RexxObject * RexxArray::appendRexx ( RexxObject value)

Append an item after the last item in the array.

Parameters
valueThe value to append.
Returns
The index of the appended item.

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().

◆ array()

RexxArray* RexxArray::array ( )
inline

Definition at line 201 of file ArrayClass.hpp.

References makeArray().

◆ arraycopy()

void RexxArray::arraycopy ( RexxArray source,
size_t  start,
RexxArray target,
size_t  index,
size_t  count 
)
staticprotected

copy segments of one array into another.

Parameters
sourceThe source array
startThe starting index of the source copy
targetThe target array
indexThe target copy index
countThe number of items to count.

Definition at line 2508 of file ArrayClass.cpp.

References get(), index(), put(), and RexxObject::start().

Referenced by merge().

◆ available()

RexxInteger * RexxArray::available ( size_t  position)

Definition at line 834 of file ArrayClass.cpp.

References size(), TheFalseObject, and TheTrueObject.

◆ closeGap()

void RexxArray::closeGap ( size_t  index,
size_t  elements 
)
protected

Close a gap in the array item.

Parameters
indexThe gap to close.
elementsThe 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().

◆ convertIndex()

RexxObject * RexxArray::convertIndex ( size_t  idx)

Convert an internal index item into "external" form. Handles both single- and multi-dimensional arrays.

Parameters
idxThe internal index to convert.
Returns
An index object proper for the array type.

Definition at line 1814 of file ArrayClass.cpp.

References indexToArray(), isSingleDimensional(), and new_integer().

Referenced by allIndexes(), firstRexx(), index(), lastRexx(), nextRexx(), previousRexx(), and supplier().

◆ copy()

◆ createInstance()

void RexxArray::createInstance ( )
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().

◆ createMultidimensional()

RexxArray * RexxArray::createMultidimensional ( RexxObject **  dims,
size_t  count,
RexxClass arrayClass 
)
static

Helper routine for creating a multidimensional array.

Parameters
dimsPointer to an array of pointers to dimension objects.
countthe number of dimensions to create
Returns
The created array

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().

◆ data() [1/2]

◆ data() [2/2]

RexxObject** RexxArray::data ( size_t  pos)
inline

Definition at line 205 of file ArrayClass.hpp.

References data().

Referenced by data().

◆ dataSize()

size_t RexxArray::dataSize ( )
inlineprotected

Definition at line 233 of file ArrayClass.hpp.

References data(), size(), and slotAddress().

Referenced by join().

◆ deleteItem()

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.

Parameters
valueThe value to insert (can be OREF_NULL to just open a new slot)
_indexThe insertion index position.
Returns
The index of the inserted item.

Definition at line 2239 of file ArrayClass.cpp.

References closeGap(), get(), OREF_NULL, and TheNilObject.

Referenced by deleteRexx(), and RexxClass::uninherit().

◆ deleteRexx()

RexxObject * RexxArray::deleteRexx ( RexxObject index)

Delete an element from the given index location, shifting the item indexes as required.

Parameters
indexThe target index. This can be a single number or an array containing a single number.
Returns
The object that has been deleted. Returns .nil if the target index does not exist.

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().

◆ dimension()

◆ empty()

RexxObject * RexxArray::empty ( )

Empty all of the items from an array.

Returns
No return value.

Definition at line 273 of file ArrayClass.cpp.

References data(), RexxInternalObject::isNewSpace(), lastElement, objects, OREF_NULL, OrefSet, and size().

Referenced by RexxMemory::createImage().

◆ ensureSpace()

void RexxArray::ensureSpace ( size_t  newSize)

Make sure that the array has been expanded to sufficient size for a primitive put operation.

Parameters
newSizeThe 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().

◆ extend()

RexxArray * RexxArray::extend ( size_t  extension)

◆ extendMulti()

◆ fill()

RexxObject * RexxArray::fill ( RexxObject value)

Fill all locations of the array with the given object

Returns
No return value.

Definition at line 253 of file ArrayClass.cpp.

References ARG_ONE, lastElement, objects, OREF_NULL, OrefSet, requiredArgument(), and size().

Referenced by RexxMemory::createImage().

◆ find()

size_t RexxArray::find ( BaseSortComparator comparator,
RexxObject val,
int  limit,
size_t  left,
size_t  right 
)
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.

Parameters
comparatorThe comparator used to compare pairs of elements.
valobject to be inserted
limitpossible 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.
leftThe left bound of the insert operation.
rightThe right bound for the insert (inclusive)
Returns
The insertion point.

Definition at line 2533 of file ArrayClass.cpp.

References BaseSortComparator::compare(), and get().

Referenced by merge().

◆ findSingleIndexItem()

size_t RexxArray::findSingleIndexItem ( RexxObject item)

Find the index of a single item in the array.

Parameters
itemThe item to locate.
Returns
The numeric index of the item.

Definition at line 1786 of file ArrayClass.cpp.

References RexxObject::equalValue(), get(), OREF_NULL, and size().

Referenced by hasItem(), index(), and removeItem().

◆ firstItem()

RexxObject * RexxArray::firstItem ( void  )

Return the first item in the array, or .nil if the array is empty.

Returns
The first item in the array

Definition at line 1283 of file ArrayClass.cpp.

References expansionArray, objects, OREF_NULL, size(), and TheNilObject.

Referenced by RexxMemory::createImage().

◆ firstRexx()

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().

◆ flatten()

void RexxArray::flatten ( RexxEnvelope envelope)
virtual

Reimplemented from RexxObject.

Definition at line 179 of file ArrayClass.cpp.

References arraySize, cleanUpFlatten, flatten_reference, and setUpFlatten.

◆ get()

RexxObject* RexxArray::get ( size_t  pos)
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(), validateIndex(), and RexxSupplier::value().

◆ getApi()

RexxObject * RexxArray::getApi ( size_t  position)

Get an item from the array, with array size sensitivity.

Parameters
positionThe target position.
Returns
The object at the array position. Returns OREF_NULL if there is not item at that position.

Definition at line 536 of file ArrayClass.cpp.

References get(), OREF_NULL, and size().

◆ getDimension()

◆ getDimensions()

RexxObject * RexxArray::getDimensions ( )

Return an array of the dimensions of this array.

Returns
An array item with one size item for each dimension of the array.

Definition at line 714 of file ArrayClass.cpp.

References copy(), dimensions, isSingleDimensional(), new_array(), new_integer(), and size().

Referenced by RexxMemory::createImage().

◆ getExpansion()

RexxArray* RexxArray::getExpansion ( )
inline

Definition at line 206 of file ArrayClass.hpp.

References expansionArray.

◆ getRexx()

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.

Parameters
argumentsThe array of all arguments sent to the method (variable arguments allowed here.)
argCountThe number of arguments in the method call.
Returns
Value at the provided index or .nil if the item does not exist.

Definition at line 506 of file ArrayClass.cpp.

References data(), OREF_NULL, RaiseBoundsInvalid, RaiseBoundsTooMany, TheNilObject, and validateIndex().

Referenced by RexxMemory::createImage().

◆ hasIndexApi()

bool RexxArray::hasIndexApi ( size_t  i)

Determine if an item exists for a given index position.

Parameters
iThe target index.
Returns
Either true or false, depending on whether the item exists.

Definition at line 576 of file ArrayClass.cpp.

References data(), OREF_NULL, and size().

◆ hasIndexNative()

bool RexxArray::hasIndexNative ( size_t  _index)

Definition at line 1438 of file ArrayClass.cpp.

References data(), OREF_NULL, and size().

◆ hasIndexRexx()

RexxObject * RexxArray::hasIndexRexx ( RexxObject **  _index,
size_t  _indexCount,
size_t  _named_argCount 
)

◆ hasItem()

RexxObject * RexxArray::hasItem ( RexxObject target)

Test if an item is within the array.

Parameters
targetThe target test item.
Returns
.true if this item exists in the array. .false if it does not exist.

Definition at line 1925 of file ArrayClass.cpp.

References ARG_ONE, findSingleIndexItem(), requiredArgument(), TheFalseObject, and TheTrueObject.

Referenced by RexxMemory::createImage().

◆ index()

RexxObject * RexxArray::index ( RexxObject target)

Return the index for the first occurrence of the target in the array.

Parameters
targetThe target object.
Returns
The index for the array. For a multi-dimensional array, this returns an array of indices.

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().

◆ indexOf()

size_t RexxArray::indexOf ( RexxObject target)

Definition at line 1719 of file ArrayClass.cpp.

References get(), and size().

Referenced by RexxClass::inherit(), and RexxClass::uninherit().

◆ indexToArray()

RexxObject * RexxArray::indexToArray ( size_t  idx)

Convert a multi-dimensional array index into an array of index values for the flattened dimension.

Parameters
idxThe index to covert.
Returns
An array of the individual index items.

Definition at line 1837 of file ArrayClass.cpp.

References dimensions, get(), RexxInternalObject::getValue(), new_array(), new_integer(), put(), and size().

Referenced by convertIndex().

◆ init()

void RexxArray::init ( size_t  _size,
size_t  maxSize 
)

Initialize an array

Parameters
_sizeThe initial size of the array.
maxSizeThe maximum size this array can hold (maxSize >= size)

Definition at line 108 of file ArrayClass.cpp.

References arraySize, expansionArray, lastElement, maximumSize, and OrefSet.

◆ insert()

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.

Parameters
valueThe value to insert (can be OREF_NULL to just open a new slot)
_indexThe 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.
Returns
The index of the inserted item.

Definition at line 2221 of file ArrayClass.cpp.

References openGap(), and put().

Referenced by addFirst(), addLast(), insertAfter(), and insertRexx().

◆ insertAfter()

size_t RexxArray::insertAfter ( RexxObject item,
size_t  index 
)
inline

Definition at line 200 of file ArrayClass.hpp.

References index(), and insert().

Referenced by RexxClass::inherit().

◆ insertRexx()

RexxObject * RexxArray::insertRexx ( RexxObject _value,
RexxObject index 
)

Insert an element into the given index location.

Parameters
_valueThe value to insert. This can be omitted, which will insert an empty slot at the indicated position.
indexThe 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.
Returns
The index of the inserted valued.

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().

◆ isEmpty()

RexxObject * RexxArray::isEmpty ( )

Test if an array is empty.

Returns
True if the array is empty, false otherwise

Definition at line 301 of file ArrayClass.cpp.

References items(), TheFalseObject, and TheTrueObject.

Referenced by RexxMemory::createImage().

◆ isMultiDimensional()

bool RexxArray::isMultiDimensional ( )
inline

Definition at line 211 of file ArrayClass.hpp.

References dimensions, OREF_NULL, and size().

Referenced by appendRexx(), deleteRexx(), insertRexx(), isSingleDimensional(), and sectionRexx().

◆ isSingleDimensional()

bool RexxArray::isSingleDimensional ( )
inline

Definition at line 212 of file ArrayClass.hpp.

References isMultiDimensional().

Referenced by convertIndex(), dimension(), extendMulti(), getDimensions(), and validateIndex().

◆ items()

size_t RexxArray::items ( void  )

◆ itemsRexx()

RexxObject * RexxArray::itemsRexx ( void  )

Definition at line 685 of file ArrayClass.cpp.

References items(), and new_integer().

Referenced by RexxMemory::createImage().

◆ join()

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().

◆ lastIndex()

size_t RexxArray::lastIndex ( )

Definition at line 1321 of file ArrayClass.cpp.

References lastElement.

◆ lastItem()

RexxObject * RexxArray::lastItem ( void  )

Return the last item in the array.

Returns
The last item, or .nil if the array is empty.

Definition at line 1309 of file ArrayClass.cpp.

References get(), lastElement, and TheNilObject.

Referenced by RexxMemory::createImage().

◆ lastRexx()

RexxObject * RexxArray::lastRexx ( void  )

Definition at line 1262 of file ArrayClass.cpp.

References convertIndex(), lastElement, and TheNilObject.

Referenced by RexxMemory::createImage().

◆ live()

void RexxArray::live ( size_t  liveMark)
virtual

Reimplemented from RexxObject.

Definition at line 146 of file ArrayClass.cpp.

References arraySize, dimensions, expansionArray, memory_mark, and objects.

◆ liveGeneral()

void RexxArray::liveGeneral ( int  reason)
virtual

Reimplemented from RexxObject.

Definition at line 164 of file ArrayClass.cpp.

References arraySize, dimensions, expansionArray, memory_mark_general, and objects.

◆ makeArray()

RexxArray * RexxArray::makeArray ( void  )
virtual

Reimplemented from RexxObject.

Definition at line 1454 of file ArrayClass.cpp.

References allItems().

Referenced by array(), RexxInstructionDo::execute(), and toString().

◆ makeString()

RexxString * RexxArray::makeString ( RexxString format,
RexxString separator 
)

Definition at line 1546 of file ArrayClass.cpp.

References toString().

Referenced by RexxMethod::newMethodObject(), and RoutineClass::newRoutineObject().

◆ merge()

void RexxArray::merge ( BaseSortComparator comparator,
RexxArray working,
size_t  left,
size_t  mid,
size_t  right 
)
protected

Perform the merge operation on two partitions.

Parameters
comparatorThe comparator used to produce the ordering.
workingThe temporary working storage.
leftThe left bound of the range.
midThe midpoint of the range. This merges the two partitions (left, mid - 1) and (mid, right).
rightThe right bound of the array.

Definition at line 2430 of file ArrayClass.cpp.

References arraycopy(), BaseSortComparator::compare(), find(), get(), and put().

Referenced by mergeSort().

◆ mergeSort()

void RexxArray::mergeSort ( BaseSortComparator comparator,
RexxArray working,
size_t  left,
size_t  right 
)
protected

The merge sort routine. This will partition the data in to two sections, mergesort each partition, then merge the two partitions together.

Parameters
comparatorThe comparator object used for the compares.
workingThe working array (same size as the sorted array).
leftThe left bound of the partition.
rightThe 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().

◆ newRexx()

RexxObject * RexxArray::newRexx ( RexxObject **  arguments,
size_t  argCount,
size_t  named_argCount 
)

Definition at line 2775 of file ArrayClass.cpp.

References RexxArray().

Referenced by RexxMemory::createImage().

◆ nextRexx()

RexxObject * RexxArray::nextRexx ( RexxObject **  arguments,
size_t  argCount,
size_t  named_argCount 
)

◆ of()

RexxObject * RexxArray::of ( RexxObject **  args,
size_t  argCount,
size_t  named_argCount 
)

◆ openGap()

void RexxArray::openGap ( size_t  index,
size_t  elements 
)
protected

Open a gap in the array by shifting each element to the right starting at the given index.

Parameters
indexThe index of the first item to shift.
elementsThe 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().

◆ operator delete() [1/11]

void RexxArray::operator delete ( void *  )
inline

Definition at line 113 of file ArrayClass.hpp.

◆ operator delete() [2/11]

void RexxArray::operator delete ( void *  ,
RexxObject  
)
inline

Definition at line 116 of file ArrayClass.hpp.

◆ operator delete() [3/11]

void RexxArray::operator delete ( void *  ,
RexxObject **   
)
inline

Definition at line 123 of file ArrayClass.hpp.

◆ operator delete() [4/11]

void RexxArray::operator delete ( void *  ,
RexxObject **  ,
size_t  ,
RexxClass  
)
inline

Definition at line 115 of file ArrayClass.hpp.

◆ operator delete() [5/11]

void RexxArray::operator delete ( void *  ,
RexxObject ,
RexxObject  
)
inline

Definition at line 117 of file ArrayClass.hpp.

◆ operator delete() [6/11]

void RexxArray::operator delete ( void *  ,
RexxObject ,
RexxObject ,
RexxObject  
)
inline

Definition at line 118 of file ArrayClass.hpp.

◆ operator delete() [7/11]

void RexxArray::operator delete ( void *  ,
RexxObject ,
RexxObject ,
RexxObject ,
RexxObject  
)
inline

Definition at line 119 of file ArrayClass.hpp.

◆ operator delete() [8/11]

void RexxArray::operator delete ( void *  ,
RexxObject ,
RexxObject ,
RexxObject ,
RexxObject ,
RexxObject  
)
inline

Definition at line 120 of file ArrayClass.hpp.

◆ operator delete() [9/11]

void RexxArray::operator delete ( void *  ,
size_t  ,
RexxObject **   
)
inline

Definition at line 121 of file ArrayClass.hpp.

◆ operator delete() [10/11]

void RexxArray::operator delete ( void *  ,
size_t  ,
size_t  ,
RexxClass cls 
)
inline

Definition at line 122 of file ArrayClass.hpp.

◆ operator delete() [11/11]

void RexxArray::operator delete ( void *  ,
void *   
)
inline

Definition at line 114 of file ArrayClass.hpp.

◆ operator new() [1/9]

void* RexxArray::operator new ( size_t  size,
void *  objectPtr 
)
inline

Definition at line 103 of file ArrayClass.hpp.

◆ operator new() [2/9]

void * RexxArray::operator new ( size_t  size,
RexxObject first 
)

Definition at line 2653 of file ArrayClass.cpp.

References new_array(), and put().

◆ operator new() [3/9]

◆ operator new() [4/9]

void * RexxArray::operator new ( size_t  size,
RexxObject first,
RexxObject second 
)

Definition at line 2666 of file ArrayClass.cpp.

References new_array(), and put().

◆ operator new() [5/9]

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().

◆ operator new() [6/9]

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().

◆ operator new() [7/9]

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().

◆ operator new() [8/9]

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.

◆ operator new() [9/9]

void * RexxArray::operator new ( size_t  newSize,
size_t  size,
size_t  maxSize,
RexxClass cls = TheArrayClass 
)

◆ previousRexx()

RexxObject * RexxArray::previousRexx ( RexxObject **  arguments,
size_t  argCount,
size_t  named_argCount 
)

◆ put()

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...

Parameters
erefThe object to add.
posThe 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(), RexxNativeActivation::valuesToObject(), RexxList::weakReferenceArray(), and RexxSource::words().

◆ putApi()

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.

Parameters
oThe inserted object.
positionThe 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().

◆ putRexx()

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.

Parameters
argumentsThe array of all arguments sent to the method (variable arguments allowed here.)
argCountThe number of arguments in the method call.
Returns
Always return nothing.

Definition at line 228 of file ArrayClass.cpp.

References ARG_ONE, ExtendUpper, missingArgument(), OREF_NULL, put(), RaiseBoundsInvalid, RaiseBoundsTooMany, and validateIndex().

Referenced by RexxMemory::createImage().

◆ remove()

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().

◆ removeItem()

RexxObject * RexxArray::removeItem ( RexxObject target)

Remove the target object from the collection.

Parameters
targetThe target object.
Returns
The removed object (same as target).

Definition at line 1899 of file ArrayClass.cpp.

References ARG_ONE, findSingleIndexItem(), remove(), requiredArgument(), and TheNilObject.

Referenced by RexxMemory::createImage().

◆ removeRexx()

RexxObject * RexxArray::removeRexx ( RexxObject **  arguments,
size_t  argCount,
size_t  named_argCount 
)

◆ resize()

void RexxArray::resize ( void  )

◆ section()

RexxArray * RexxArray::section ( size_t  _start,
size_t  _end 
)

Section an array to the given size.

Parameters
_startThe starting point of the section.
_endThe end section index
Returns
A new array representing the given section.

Definition at line 1086 of file ArrayClass.cpp.

References data(), new_array(), size(), and slotAddress().

◆ sectionRexx()

RexxObject * RexxArray::sectionRexx ( RexxObject _start,
RexxObject _end 
)

Extract a section of the array as another array

Parameters
_startThe starting index position
_endThe number of items to section.
Returns
A new array containing the section elements.

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().

◆ sectionSubclass()

RexxObject * RexxArray::sectionSubclass ( size_t  _start,
size_t  _end 
)

◆ setExpansion()

void RexxArray::setExpansion ( RexxObject expansion)

Definition at line 826 of file ArrayClass.cpp.

References expansionArray, and OrefSet.

Referenced by copy(), extend(), and extendMulti().

◆ shrink()

void RexxArray::shrink ( size_t  amount)

Definition at line 1706 of file ArrayClass.cpp.

References arraySize, expansionArray, and size().

Referenced by closeGap().

◆ size()

size_t RexxArray::size ( )
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().

◆ sizeRexx()

RexxInteger * RexxArray::sizeRexx ( )

Definition at line 1070 of file ArrayClass.cpp.

References new_integer(), and size().

Referenced by RexxMemory::createImage().

◆ slotAddress()

RexxObject** RexxArray::slotAddress ( size_t  index)
inlineprotected

Definition at line 232 of file ArrayClass.hpp.

References data().

Referenced by closeGap(), dataSize(), join(), openGap(), and section().

◆ sortCompare()

wholenumber_t RexxArray::sortCompare ( RexxObject comparator,
RexxObject left,
RexxObject right 
)

◆ stableSortRexx()

RexxArray * RexxArray::stableSortRexx ( )

Sort elements of the array in place, using a stable merge sort.

Returns
Returns the same array, with the elements sorted.

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().

◆ stableSortWithRexx()

RexxArray * RexxArray::stableSortWithRexx ( RexxObject comparator)

Sort elements of the array in place, using a stable merge sort.

Returns
Returns the same array, with the elements sorted.

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().

◆ supplier()

◆ toString()

◆ validateIndex()

Member Data Documentation

◆ ARRAY_DEFAULT_SIZE

const size_t RexxArray::ARRAY_DEFAULT_SIZE = 10
static

Definition at line 222 of file ArrayClass.hpp.

Referenced by new_externalArray().

◆ ARRAY_MIN_SIZE

const size_t RexxArray::ARRAY_MIN_SIZE = 4
static

Definition at line 221 of file ArrayClass.hpp.

Referenced by new_array().

◆ arraySize

size_t RexxArray::arraySize
protected

◆ classInstance

RexxClass * RexxArray::classInstance = OREF_NULL
static

Definition at line 218 of file ArrayClass.hpp.

◆ dimensions

◆ expansionArray

◆ lastElement

size_t RexxArray::lastElement
protected

◆ MAX_FIXEDARRAY_SIZE

const size_t RexxArray::MAX_FIXEDARRAY_SIZE = (Numerics::MAX_WHOLENUMBER/10) + 1
staticprotected

Definition at line 236 of file ArrayClass.hpp.

Referenced by createMultidimensional(), ensureSpace(), putApi(), and validateIndex().

◆ maximumSize

size_t RexxArray::maximumSize
protected

Definition at line 239 of file ArrayClass.hpp.

Referenced by extend(), extendMulti(), init(), and operator new().

◆ nullArray

RexxArray * RexxArray::nullArray = OREF_NULL
static

Definition at line 219 of file ArrayClass.hpp.

Referenced by createInstance().

◆ objects

RexxObject* RexxArray::objects[1]
protected

The documentation for this class was generated from the following files: