1 #ifndef CORE_Vector_CPP 2 #define CORE_Vector_CPP 39 if ((v[0]!=
'[') && (v[0]!=
'('))
return *
this;
43 tUIndex n=str->getTokensCount();
49 typename vector<T>::iterator iter=
mVector.begin()+from;
50 while (str->hasNextToken()) {
66 typename vector<T >::iterator p;
81 if (index>=
getSize())
return false;
82 typename vector<T >::iterator p=
mVector.begin()+index;
95 if (index>
getSize())
return false;
99 typename vector<T >::iterator p=
mVector.begin()+index;
172 if (
compare(obj,values[0],order)) {
177 if (
compare(values[sf],obj,order)) {
196 }
else if (
compare(values[i],obj,order)) {
212 typename vector<T>::iterator ei=
mVector.end();
213 typename vector<T>::iterator bi=
mVector.begin();
226 typename vector<T>::iterator it=
mVector.begin()+oldSize;
227 typename vector<T>::iterator ia=array.
begin();
237 typename vector<T>::const_iterator p=find(
mVector.begin(),
mVector.end(),obj);
246 typename vector<T>::iterator it=
mVector.end();
248 for (i=dim-1;i>index+1;i--) {
253 if (
mVector.size()>index+1) *it=v;
259 if (p_indices.get()==
null)
return;
264 tUIndex i,nValues=values.getSize();
268 for (i=0;i<nValues;i++)
269 nValuesToAdd+=values[i]->
getSize();
270 if (nValuesToAdd==0)
return;
274 vector<T> newValues(dim);
277 tIndex cur_newValues=dim-1;
278 tIndex cur_indices=nIndices-1;
282 while (cur_indices>=0) {
283 insertIndex=indices[cur_indices];
287 for (i=cur_mVector;i>insertIndex;i--) {
288 newValues[cur_newValues]=
mVector[i];
292 cur_mVector=insertIndex;
301 newValues[cur_newValues]=vals[i];
315 newValues[cur_newValues]=
mVector[i];
327 const tFlag& order) {
347 while ((j>=h) && (!
compare(items[j-h],
tBoolean remove()
remove the last pointer
Definition: CORE_Vector.h:787
void append(const CORE_Vector< T > &array)
append the array at the end of this
Definition: CORE_Vector.hpp:222
void permute(const tUIndex &i, const tUIndex &j)
permute
Definition: CORE_Vector.hpp:88
tBoolean exists(const T &obj) const
test if the value obj exists
Definition: CORE_Vector.hpp:236
this class describes an array
Definition: CORE_Vector.h:19
class CORE_SharedPointersList is a list of shared pointers
Definition: CORE_SharedPointersList.h:11
tUIndex insertInIncreasingOrder(const T &obj, const tBoolean &evenIfEqual)
insert The value in an increasing order
Definition: CORE_Vector.hpp:106
static void parse(const tString &str, tUChar &c)
parse unsigned char c in str
Definition: CORE_String.h:504
this class describes a list interface
Definition: CORE_List.h:12
void sort()
sort the vector decreasing order < increasing order
Definition: CORE_Vector.h:803
void addAfterIndex(const tUIndex &index, const T &v)
add an element after index
Definition: CORE_Vector.hpp:243
void reverse()
reverse the vector
Definition: CORE_Vector.hpp:211
vector< T > mVector
Definition: CORE_Vector.h:23
#define tBoolean
Definition: types.h:139
CORE_Vector< T > & initValues(const T &v)
init the value to v
Definition: CORE_Vector.h:268
static const tFlag EQ
Definition: CORE_List.h:21
#define null
Definition: types.h:144
CORE_Vector()
build a vector of T
Definition: CORE_Vector.hpp:11
#define tIndex
Definition: types.h:129
void setSize(const tUIndex &n)
set the size of the vector
Definition: CORE_Vector.h:255
tUIndex getSize() const
return the size of the vector
Definition: CORE_Vector.h:391
tBoolean insertAtIndex(const tUIndex &i, const T &obj)
insert the pointer at index i the old element i become the element i+1
Definition: CORE_Vector.h:716
virtual ~CORE_Vector()
destroy an array of T*
Definition: CORE_Vector.hpp:28
void add(const CORE_Vector< T > &u, const CORE_Vector< T > &v)
init the value to this=u-v
Definition: CORE_Vector.h:439
#define tUIndex
Definition: types.h:126
static tUIndex getMaxUIndex()
get the max value for difference the array/vector indexing type
Definition: CORE_Object.h:565
static tUIndex search(const vector< T > &values, const T &value, const tFlag &order)
search the value in values vector ordered in order If it does not existe return getMaxUIndex() ...
Definition: CORE_Vector.hpp:160
abstract base class for most classes.
Definition: CORE_Object.h:53
#define tString
Definition: types.h:135
void copy(const CORE_Vector< Q > &u)
copy
Definition: CORE_Vector.h:217
static SP::CORE_String New()
create a class String
Definition: CORE_String.h:96
const T & get(const tUIndex &i) const
get the value at index i
Definition: CORE_Vector.h:376
vector< T >::const_iterator begin() const
get iterator
Definition: CORE_Vector.h:331
void clear()
clear the array
Definition: CORE_Vector.h:248
void addAfterIndices(boost::shared_ptr< CORE_Vector< tUIndex > > &p_indices, const CORE_SharedPointersList< CORE_Vector< T > > &values)
add alements after indices
Definition: CORE_Vector.hpp:257
tBoolean removeAtIndex(const tUIndex &i)
remove the pointer at index i
Definition: CORE_Vector.hpp:80
static tBoolean compare(const Q &a, const Q &b, const tFlag &order)
compare 2 object a & b
Definition: CORE_List.h:55
tBoolean insert(const tUIndex &i, const T &obj)
insert the pointer at index i the old element i become the element i+1
Definition: CORE_Vector.hpp:94
#define tFlag
Definition: types.h:74