1 #ifndef CORE_ArrayList_HPP 2 #define CORE_ArrayList_HPP 17 const tFlag& capF=getCapacityFactor();
40 const T *pI=&(*this)[0];
82 T *pI=&(*this)[index];
83 const T *pS=&(*this)[index+1];
106 const T *v=&(*this)[s-n];
136 const tFlag& capF=getCapacityFactor();
145 const T* vs=&(*this)[s-1];
187 insertAtIndex(0,obj);
206 insertAtIndex(sf,obj);
217 const tFlag& order) {
261 for (i=0;i<mid;i++) {
287 if (compare(obj,values[0],order)) {
292 if (compare(values[sf],obj,order)) {
313 }
else if (compare(values[i],obj,order)) {
339 const tFlag& capF=getCapacityFactor();
347 const T* as=&array[0];
void reverse()
reverse the array
Definition: CORE_ArrayList.hpp:248
const tUIndex & getSize() const
return the size of the array for reading
Definition: CORE_Array.h:1018
virtual void clear()
clear the array : desallocate the array
Definition: CORE_Array.h:300
void reserve(const tUIndex &cap)
reserve the capacity
Definition: CORE_Array.h:147
void contractToLastElements(const tUIndex &n)
keep only the last n elements of the array and set its capacity also to n
Definition: CORE_ArrayList.hpp:94
#define tBoolean
Definition: types.h:139
static tBoolean search(const T *values, const tUIndex &n, const tFlag &order, const T &value, tUIndex &index)
search the value in values array ordered in order
Definition: CORE_ArrayList.hpp:273
void insertAtIndex(const tUIndex &i, const T &v)
insert the object at index i
Definition: CORE_ArrayList.hpp:122
static tFlag reverse(const tFlag &oder)
return the reverse order
Definition: CORE_List.cpp:17
void setSize(const tUIndex &n)
set the size
Definition: CORE_Array.h:292
static const tFlag EQ
Definition: CORE_List.h:21
void push_back(const Q &v)
Definition: CORE_ArrayList.hpp:11
void append(const CORE_ArrayList< T > &array)
add the arry list at the end
Definition: CORE_ArrayList.hpp:328
void removeAtIndex(const tUIndex &i)
remove the element at index
Definition: CORE_ArrayList.hpp:66
tBoolean remove(const T &v)
remove all the element with the value
Definition: CORE_ArrayList.hpp:32
#define tIndex
Definition: types.h:129
const T * getValues() const
get the values of the array for reading
Definition: CORE_Array.h:930
virtual void fitToSize()
fit the array alocation exactly to size fit the allocation of the array to its size ...
Definition: CORE_Array.hpp:128
#define tUIndex
Definition: types.h:126
void sort()
sort the array in an increasing order obj[i-1] is obj[i] with respect to getOrder ...
Definition: CORE_ArrayList.h:264
tUIndex insert(const T &v)
insert the element in the array with respect to the order of the list
Definition: CORE_ArrayList.hpp:166
Definition: CORE_ArrayList.h:12
const tUIndex & getCapacity() const
get the capacity
Definition: CORE_Array.h:1012
static tBoolean compare(const Q &a, const Q &b, const tFlag &order)
compare 2 object a & b
Definition: CORE_List.h:55
#define tFlag
Definition: types.h:74