36 if (
sizeof(T)==
sizeof(Q)) {
38 memcpy(vs,pf,
sizeof(T)*n);
53 if ( mIsPrivateAllocated && (mValues!=
null)) {
56 mIsPrivateAllocated=
false;
66 if (s==mCapacity)
return;
76 }
catch(std::exception& e) {
79 "not enought memory for allocation");
81 if (newValues==
null) {
84 "not enought memory for allocation");
89 const T* oldP=mValues;
91 tUIndex m=(mCapacity<s)?mCapacity:s;
94 memcpy(p,oldP,m*
sizeof(T));
105 memset(p,0,
sizeof(T)*(s-m+1));
118 mIsPrivateAllocated=
true;
121 mSize=(oldSize>=mCapacity)?mCapacity:oldSize;
131 if (mCapacity==n)
return;
154 if (
sizeof(T)==
sizeof(Q)) {
159 memcpy(vs,B,
sizeof(T)*p);
275 if ((v[0]!=
'[') && (v[0]!=
'('))
return;
279 tUIndex n=str->getTokensCount();
282 if (newDim>mCapacity) allocate(newDim);
288 T* values=&mValues[from];
289 while (str->hasNextToken()) {
304 const T *vs=&(*this)[0];
305 for (
tUIndex i=0;i<mSize-1;i++) {
const tUIndex & getSize() const
return the size of the array for reading
Definition: CORE_Array.h:1018
void desallocate()
desallocate the memory
Definition: CORE_Array.hpp:52
static void parse(const tString &str, tUChar &c)
parse unsigned char c in str
Definition: CORE_String.h:504
virtual tString toString() const
turn the array into string
Definition: CORE_Array.hpp:301
#define tUSInt
Definition: types.h:28
virtual tString toString() const
return the string associated to the string
Definition: CORE_String.h:223
tString toString() const
return the string associated to the integer
Definition: CORE_Integer.h:106
#define null
Definition: types.h:144
void allocate(const tUIndex &cap)
allocate the memory if the array
Definition: CORE_Array.hpp:64
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
this class describes an array
Definition: CORE_Array.h:19
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
#define tString
Definition: types.h:135
static SP::CORE_String New()
create a class String
Definition: CORE_String.h:96
void initArray(const Q &f)
init the array to uniform value
Definition: CORE_Array.h:316
void copy(const CORE_Array< Q > &f)
copy the array
Definition: CORE_Array.hpp:16