37 while(n--){ ::new ((
void*)ptr) TYPE; ptr++; }
44 while(n--){ ptr->~TYPE(); ptr++; }
50 inline void copyElms(TYPE* dst,
const TYPE* src,
unsigned long n){
51 while(n--){ *dst++ = *src++; }
57 inline void moveElms(TYPE* dst,
const TYPE* src,
unsigned long n){
59 while(n--){ *dst++ = *src++; }
64 while(n--){ *--dst = *--src; }
71 inline void fillElms(TYPE* dst,
const TYPE& src,
unsigned long n){
72 while(n--){ *dst++ = src; }
79 memset(dst,0,
sizeof(TYPE)*n);
86 while(n--){ store << *ptr; ptr++; }
93 while(n--){ store >> *ptr; ptr++; }
100 return fxmalloc((
void**)&ptr,
sizeof(TYPE)*n);
107 return fxcalloc((
void**)&ptr,
sizeof(TYPE)*n);
114 return fxmemdup((
void**)&ptr,src,
sizeof(TYPE)*n);
121 return fxresize((
void**)&ptr,
sizeof(TYPE)*n);
168 template<
class TYPE>
inline void copyElms(TYPE** dst,
const TYPE** src,
unsigned long n){ memcpy(dst,src,n*
sizeof(
void*)); }
181 template<
class TYPE>
inline void moveElms(TYPE** dst,
const TYPE** src,
unsigned long n){ memmove(dst,src,n*
sizeof(
void*)); }
void fillElms(TYPE *dst, const TYPE &src, unsigned long n)
Fill array of elements with given element.
Definition: FXElement.h:71
unsigned short FXushort
Definition: fxdefs.h:394
void saveElms(FXStream &store, const TYPE *ptr, unsigned long n)
Save some elements to persistent store.
Definition: FXElement.h:85
char FXchar
Definition: fxdefs.h:387
FXint dupElms(TYPE *&ptr, const TYPE *src, unsigned long n)
Allocate array of elements, initialized with bit-wise copy of src array.
Definition: FXElement.h:113
short FXshort
Definition: fxdefs.h:395
FXStream & save(const FXuchar *p, FXuval n)
Save arrays of items to stream.
unsigned int FXuint
Definition: fxdefs.h:396
void destructElms(TYPE *ptr, unsigned long n)
Destruct some elements at a location.
Definition: FXElement.h:43
FXint fxcalloc(void **ptr, unsigned long size)
Allocate cleaned memory.
void clearElms(TYPE *dst, unsigned long n)
Zero out array of elements.
Definition: FXElement.h:78
FXint callocElms(TYPE *&ptr, unsigned long n)
Allocate array of elements, initialized with zero.
Definition: FXElement.h:106
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
void constructElms(TYPE *ptr, unsigned long n)
Construct some elements at a location.
Definition: FXElement.h:36
void loadElms(FXStream &store, TYPE *ptr, unsigned long n)
Load some elements from persistent store.
Definition: FXElement.h:92
double FXdouble
Definition: fxdefs.h:399
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
FXint fxmemdup(void **ptr, const void *src, unsigned long size)
Duplicate memory.
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:397
FXint fxmalloc(void **ptr, unsigned long size)
Allocate memory.
FXint allocElms(TYPE *&ptr, unsigned long n)
Allocate array of elements, uninitialized.
Definition: FXElement.h:99
void copyElms(TYPE *dst, const TYPE *src, unsigned long n)
Copy some elements from one place to another.
Definition: FXElement.h:50
unsigned char FXuchar
Definition: fxdefs.h:392
void fxfree(void **ptr)
Free memory, resets ptr to NULL afterward.
float FXfloat
Definition: fxdefs.h:398
FXStream & load(FXuchar *p, FXuval n)
Load arrays of items from stream.
FXint fxresize(void **ptr, unsigned long size)
Resize memory.
void moveElms(TYPE *dst, const TYPE *src, unsigned long n)
Move some elements from overlapping place to another.
Definition: FXElement.h:57