1 #ifndef CORE_SharedPointersList_CPP
2 #define CORE_SharedPointersList_CPP
29 typename vector<boost::shared_ptr<T> >::iterator iVector=mVector.begin();
30 typename vector<boost::shared_ptr<Q> >::const_iterator iCpy=cpy.
getIterator();
31 typename vector<boost::shared_ptr<Q> >::const_iterator eCpy=cpy.
getEndIterator();
42 typename vector<boost::shared_ptr<T> >::const_iterator iVector=mVector.begin();
43 while (iVector!=mVector.end()) {
44 if ((*iVector).get()==&obj)
return true;
53 typename vector<boost::shared_ptr<T> >::iterator iVector=mVector.begin();
54 while (iVector!=mVector.end()){
55 if ((*iVector).get()==&obj) {
56 iVector=mVector.erase(iVector);
67 if (index>=size())
return false;
68 if (index<0)
return false;
69 typename vector<boost::shared_ptr<T> >::iterator p=mVector.begin()+index;
76 typename vector<boost::shared_ptr<T> >::iterator pi=mVector.begin()+i;
77 typename vector<boost::shared_ptr<T> >::iterator pj=mVector.begin()+j;
79 boost::shared_ptr<T> temp=*pi;
87 if (mVector.size()==index) add(obj);
89 typename vector<boost::shared_ptr<T> >::iterator p=mVector.begin()+index;
90 if (index>size())
return false;
91 mVector.insert(p,obj);
99 mVector.resize(index+1);
108 typename vector<boost::shared_ptr<T> >::iterator pE=mVector.end();
109 typename vector<boost::shared_ptr<T> >::iterator pB=mVector.begin();
111 for (i=0;i<n/2;i++) {
113 boost::shared_ptr<T> &temp=*pB;
126 typename vector<boost::shared_ptr<T> >::iterator p=mVector.begin()+oldSize;
127 typename vector<boost::shared_ptr<Q> >::const_iterator q=array.
getIterator();
128 typename vector<boost::shared_ptr<Q> >::const_iterator eq=array.
getEndIterator();
141 typename vector<T*>::iterator ivs=vs.begin();
142 typename vector<boost::shared_ptr<T> >::iterator p=mVector.begin();
143 while (p!=mVector.end()) {
155 typename vector<const T*>::iterator ivs=vs.begin();
156 typename vector<boost::shared_ptr<T> >::const_iterator p=mVector.begin();
157 while (p!=mVector.end()) {
void copy(const CORE_SharedPointersList< Q > &cpy)
New copy constructor of a shared pointers list.
Definition: CORE_SharedPointersList.hpp:26
class CORE_SharedPointersList is a list of shared pointers
Definition: CORE_SharedPointersList.h:11
tBoolean set(const tVectorIndex &i, boost::shared_ptr< T > obj)
set the pointer at the index i
Definition: CORE_SharedPointersList.hpp:97
#define tVectorIndex
Definition: types.h:42
#define tBoolean
Definition: types.h:48
void merge(const CORE_SharedPointersList< Q > &array)
merge the array in this
Definition: CORE_SharedPointersList.hpp:122
virtual ~CORE_SharedPointersList()
destroy an array of T*
Definition: CORE_SharedPointersList.hpp:19
void reverse()
reverse the vector
Definition: CORE_SharedPointersList.hpp:107
tBoolean removeAtIndex(const tVectorIndex &i)
remove the pointer at index i
Definition: CORE_SharedPointersList.hpp:66
void getValues(vector< T * > &vs)
get values
Definition: CORE_SharedPointersList.hpp:137
CORE_SharedPointersList()
internal constructor of a shared pointers list
Definition: CORE_SharedPointersList.hpp:7
vector< boost::shared_ptr< T > >::const_iterator getIterator() const
get iterator
Definition: CORE_SharedPointersList.h:287
tBoolean insert(const tVectorIndex &i, boost::shared_ptr< T > obj)
insert the pointer at index i the old element i become the element i+1
Definition: CORE_SharedPointersList.hpp:86
tBoolean remove()
remove the last pointer
Definition: CORE_SharedPointersList.h:199
abstract base class for most classes.
Definition: CORE_Object.h:30
void permute(const tVectorIndex &i, const tVectorIndex &j)
permute
Definition: CORE_SharedPointersList.hpp:75
vector< boost::shared_ptr< T > >::const_iterator getEndIterator() const
get iterator
Definition: CORE_SharedPointersList.h:297
tBoolean exists(boost::shared_ptr< T > obj) const
exists
Definition: CORE_SharedPointersList.h:250
tVectorIndex size() const
return the size of the array
Definition: CORE_SharedPointersList.h:242
tVectorIndex getSize() const
return the size of the array
Definition: CORE_SharedPointersList.h:245