Fork me on GitHub
Library for MQL5 (MetaTrader) with support for Spark
ArrayList_macros.mqh File Reference

Macros

#define CArrayListInit(Type)
 
#define CArrayListClassInit(Type)
 

Functions

bool add (const Type element)
 Appends the specified element to the end of this list. More...
 
bool add (int index, const Type element)
 Inserts the specified element at the specified position in this list. More...
 
bool addAll (const Type &list[])
 Appends all of the elements in the specified collection to the end of this list. More...
 
bool addAll (const CArrayList_##Type &list)
 
bool addAll (int index, const Type &list[])
 Inserts all of the elements in the specified collection into this list,. More...
 
bool addAll (int index, const CArrayList_##Type &list)
 
void clear ()
 Removes all of the elements from this list. More...
 
bool contains (const Type o)
 Returns a shallow copy of this ArrayList instance. More...
 
Type get (int index)
 Increases the capacity of this ArrayList instance, if necessary,. More...
 
Type operator[] (int index)
 
Type set (int index, const Type element)
 Replaces the element at the specified position in this list with the specified element. More...
 
int indexOf (const Type o)
 Returns the index of the first occurrence of the specified element in this list,. More...
 
int lastIndexOf (const Type o)
 Returns the index of the last occurrence of the specified element in this list,. More...
 
bool isEmpty ()
 Returns true if this list contains no elements. More...
 
Type remove (int index)
 Removes the element at the specified position in this list. More...
 
bool removeFirst (const Type o)
 Removes the first occurrence of the specified element from this list, if it is present. More...
 
bool removeAll (const Type &list[])
 Removes from this list all of its elements that are contained in the specified collection. More...
 
bool retainAll (const Type &list[])
 Retains only the elements in this list that are contained in the specified collection. More...
 
int size ()
 Removes all of the elements of this collection that satisfy the given predicate. More...
 
int subList (Type &dst_array[], int dst_start=0, int src_start=0, int count=WHOLE_ARRAY)
 Sorts this list according to the order induced by the specified Comparator. More...
 
void toArray (Type &dst_array[])
 Returns an array containing all of the elements in this list in proper sequence. More...
 
int getReserve ()
 
void setReserve (int _reserve)
 
bool getUseDelete ()
 
void setUseDelete (bool _use_delete)
 
bool add (Type *element)
 Appends the specified element to the end of this list. More...
 
bool add (int index, Type *element)
 Inserts the specified element at the specified position in this list. More...
 
bool addAll (const Type *&list[])
 Appends all of the elements in the specified collection to the end of this list. More...
 
bool addAll (const CArrayListClass_##Type &list)
 
bool addAll (int index, const Type *&list[])
 Inserts all of the elements in the specified collection into this list,. More...
 
bool addAll (int index, const CArrayListClass_##Type &list)
 
void set (int index, Type *element)
 Replaces the element at the specified position in this list with the specified element. More...
 
int subList (Type *&dst_array[], int dst_start=0, int src_start=0, int count=WHOLE_ARRAY)
 
void toArray (Type *&dst_array[])
 Returns an array containing all of the elements in this list in proper sequence. More...
 

Variables

 CArrayListClass_
 
 use_delete = _use_delete
 
 ~CArrayListClass_
 

Macro Definition Documentation

◆ CArrayListClassInit

#define CArrayListClassInit (   Type)
Value:
class CArrayListClass_##Type \
{ \
protected: \
Type *elements[]; \
int reserve; \
bool use_delete; \
\
\
CArrayListClass_
Definition: ArrayList_macros.mqh:293
use_delete
Definition: ArrayList_macros.mqh:295

◆ CArrayListInit

#define CArrayListInit (   Type)

Function Documentation

◆ add() [1/4]

bool add ( const Type  element)

Appends the specified element to the end of this list.

◆ add() [2/4]

bool add ( int  index,
const Type  element 
)

Inserts the specified element at the specified position in this list.

◆ add() [3/4]

bool add ( Type *  element)

Appends the specified element to the end of this list.

◆ add() [4/4]

bool add ( int  index,
Type *  element 
)

Inserts the specified element at the specified position in this list.

◆ addAll() [1/8]

bool addAll ( const Type &  list[])

Appends all of the elements in the specified collection to the end of this list.

◆ addAll() [2/8]

bool addAll ( const CArrayList_##Type &  list)

◆ addAll() [3/8]

bool addAll ( int  index,
const Type &  list[] 
)

Inserts all of the elements in the specified collection into this list,.

starting at the specified position.

◆ addAll() [4/8]

bool addAll ( int  index,
const CArrayList_##Type &  list 
)

◆ addAll() [5/8]

bool addAll ( const Type *&  list[])

Appends all of the elements in the specified collection to the end of this list.

◆ addAll() [6/8]

bool addAll ( const CArrayListClass_##Type &  list)

◆ addAll() [7/8]

bool addAll ( int  index,
const Type *&  list[] 
)

Inserts all of the elements in the specified collection into this list,.

starting at the specified position.

◆ addAll() [8/8]

bool addAll ( int  index,
const CArrayListClass_##Type &  list 
)

◆ clear()

void clear ( )

Removes all of the elements from this list.

◆ contains()

bool contains ( const Type  o)

Returns a shallow copy of this ArrayList instance.

Returns true if this list contains the specified element.

◆ get()

Type * get ( int  index)

Increases the capacity of this ArrayList instance, if necessary,.

Returns a shallow copy of this ArrayList instance.

to ensure that it can hold at least the number of elements specified by the minimum capacity argument. Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception. Returns the element at the specified position in this list.

Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument. Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception. Returns the element at the specified position in this list.

◆ getReserve()

int getReserve ( )

◆ getUseDelete()

bool getUseDelete ( )

◆ indexOf()

int indexOf ( const Type  o)

Returns the index of the first occurrence of the specified element in this list,.

or -1 if this list does not contain the element.

◆ isEmpty()

bool isEmpty ( )

Returns true if this list contains no elements.

◆ lastIndexOf()

int lastIndexOf ( const Type  o)

Returns the index of the last occurrence of the specified element in this list,.

or -1 if this list does not contain the element.

◆ operator[]()

Type * operator[] ( int  index)

◆ remove()

void remove ( int  index)

Removes the element at the specified position in this list.

◆ removeAll()

bool removeAll ( const Type &  list[])

Removes from this list all of its elements that are contained in the specified collection.

◆ removeFirst()

bool removeFirst ( const Type  o)

Removes the first occurrence of the specified element from this list, if it is present.

◆ retainAll()

bool retainAll ( const Type &  list[])

Retains only the elements in this list that are contained in the specified collection.

◆ set() [1/2]

Type set ( int  index,
const Type  element 
)

Replaces the element at the specified position in this list with the specified element.

◆ set() [2/2]

void set ( int  index,
Type *  element 
)

Replaces the element at the specified position in this list with the specified element.

◆ setReserve()

void setReserve ( int  _reserve)

◆ setUseDelete()

void setUseDelete ( bool  _use_delete)

◆ size()

int size ( )

Removes all of the elements of this collection that satisfy the given predicate.

Returns the number of elements in this list.

Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive. Replaces each element of this list with the result of applying the operator to that element. Returns the number of elements in this list.

◆ subList() [1/2]

int subList ( Type &  dst_array[],
int  dst_start = 0,
int  src_start = 0,
int  count = WHOLE_ARRAY 
)

Sorts this list according to the order induced by the specified Comparator.

◆ subList() [2/2]

int subList ( Type *&  dst_array[],
int  dst_start = 0,
int  src_start = 0,
int  count = WHOLE_ARRAY 
)

◆ toArray() [1/2]

void toArray ( Type &  dst_array[])

Returns an array containing all of the elements in this list in proper sequence.

(from first to last element).

◆ toArray() [2/2]

void toArray ( Type *&  dst_array[])

Returns an array containing all of the elements in this list in proper sequence.

(from first to last element).

Variable Documentation

◆ CArrayListClass_

CArrayListClass_
Initial value:
{
reserve = _reserve

◆ use_delete

use_delete = _use_delete

◆ ~CArrayListClass_

Initial value:
{
void clear()
Removes all of the elements from this list.
Definition: ArrayList_macros.mqh:134