87 if(ptr!=src.ptr){
no(src.num);
copyElms(ptr,src.ptr,src.num); }
96 TYPE&
at(
FXint i){
return ptr[i]; }
97 const TYPE&
at(
FXint i)
const {
return ptr[i]; }
100 TYPE*
data()
const {
return ptr; }
105 ptr=src.ptr; src.ptr=
NULL;
106 num=src.num; src.num=0;
112 if(
no(1)){ ptr[0]=src; }
130 if(
no(src.num)){
copyElms(ptr,src.ptr,src.num); }
136 if(
no(num+1)){
moveElms(ptr+pos+1,ptr+pos,num-pos-1); ptr[pos]=src; }
154 if(
no(num+src.num)){
moveElms(ptr+pos+src.num,ptr+pos,num-pos-src.num);
copyElms(ptr+pos,src.ptr,src.num); }
160 if(
no(num+1)){
moveElms(ptr+1,ptr,num-1); ptr[0]=src; }
178 if(
no(num+src.num)){
moveElms(ptr+src.num,ptr,num-src.num);
copyElms(ptr,src.ptr,src.num); }
184 if(
no(num+1)){ ptr[num-1]=src; }
202 if(
no(num+src.num)){
copyElms(ptr+num-src.num,src.ptr,src.num); }
208 moveElms(ptr+pos,ptr+pos+1,num-pos-1);
no(num-1);
214 moveElms(ptr+pos,ptr+pos+n,num-n-pos);
no(num-n);
void fillElms(TYPE *dst, const TYPE &src, unsigned long n)
Fill array of elements with given element.
Definition: FXElement.h:71
FXArray< TYPE > & assign(const TYPE &src)
Assign object p to list.
Definition: FXArray.h:108
FXArray< TYPE > & adopt(FXArray< TYPE > &src)
Adopt array from source.
Definition: FXArray.h:100
FXArray< TYPE > & prepend(const TYPE &src)
Prepend object.
Definition: FXArray.h:156
FXArray< TYPE > & insert(FXint pos, const TYPE &src)
Insert an object.
Definition: FXArray.h:132
void destructElms(TYPE *ptr, unsigned long n)
Destruct some elements at a location.
Definition: FXElement.h:43
TYPE & at(FXint i)
Index into list.
Definition: FXArray.h:93
Array of some generic type.
Definition: FXArray.h:36
#define NULL
Definition: fxdefs.h:41
FXint no() const
Return number of elements.
Definition: FXArray.h:64
void constructElms(TYPE *ptr, unsigned long n)
Construct some elements at a location.
Definition: FXElement.h:36
void freeElms(TYPE *&ptr)
Free array of elements, without destruction.
Definition: FXElement.h:127
FXint resizeElms(TYPE *&ptr, unsigned long n)
Resize array of elements, without constructor or destructor.
Definition: FXElement.h:120
TYPE & operator[](FXint i)
Index into array.
Definition: FXArray.h:89
int FXint
Definition: fxdefs.h:397
FXArray< TYPE > & clear()
Remove all objects.
Definition: FXArray.h:216
FXArray< TYPE > & operator=(const FXArray< TYPE > &src)
Assign from another list.
Definition: FXArray.h:83
FXint allocElms(TYPE *&ptr, unsigned long n)
Allocate array of elements, uninitialized.
Definition: FXElement.h:99
bool no(FXint n)
Change number of elements to n.
Definition: FXArray.h:67
void copyElms(TYPE *dst, const TYPE *src, unsigned long n)
Copy some elements from one place to another.
Definition: FXElement.h:50
FXArray()
Create as empty.
Definition: FXArray.h:40
~FXArray()
Delete data.
Definition: FXArray.h:222
TYPE * data() const
Return pointer to list.
Definition: FXArray.h:97
FXArray< TYPE > & erase(FXint pos)
Remove object at pos.
Definition: FXArray.h:204
void moveElms(TYPE *dst, const TYPE *src, unsigned long n)
Move some elements from overlapping place to another.
Definition: FXElement.h:57
FXArray< TYPE > & append(const TYPE &src)
Append object.
Definition: FXArray.h:180