1 #ifndef CORE_SharedPointersMatrix_H 2 #define CORE_SharedPointersMatrix_H 12 vector<CORE_SharedPointersList<T> >
mVector;
38 inline boost::shared_ptr<CORE_SharedPointersMatrix<T> >
New() {
53 return mVector[(int)i];
60 return mVector[(int)i];
88 mVector[i].setSize(r);
94 const boost::shared_ptr<T>& obj) {
95 return mVector[i].set(j,obj);
102 const boost::shared_ptr<T>& obj) {
103 return mVector[i].insert(j,obj);
110 const boost::shared_ptr<T>& obj) {
126 if (j<n)
return mVector[i].removeAtIndex(j);
135 inline tBoolean remove(
const boost::shared_ptr<T>& obj) {
138 for (
tUIndex i=0;i<n;i++)
if (mVector[i].
remove(obj)) ret=
true;
150 for (
tUIndex i=0;i<n;i++)
if (mVector[i].
remove(obj)) ret=
true;
162 for (
tUIndex i=0;i<n;i++)
if (mVector[i].
remove(obj)) ret=
true;
193 return mVector[i][j].get();
202 return mVector[i][j].get();
219 for (
tUIndex i=0;i<n;i++)
if (mVector[i].
exists(obj))
return true;
226 for (
tUIndex i=0;i<n;i++)
if (mVector[i].
exists(obj))
return true;
234 for (
tUIndex i=0;i<n;i++)
if (mVector[i].
exists(obj))
return true;
CORE_SharedPointersList< T > & operator[](const tUIndex &i)
get the share pointers list of line i
Definition: CORE_SharedPointersMatrix.h:58
class CORE_SharedPointersList is a list of shared pointers
Definition: CORE_SharedPointersList.h:11
void add(const tUIndex &i, const boost::shared_ptr< T > &obj)
add an element at the end
Definition: CORE_SharedPointersMatrix.h:109
void setSize(const tUIndex &n, const tUIndex &p)
set the size of an rectangular matrix
Definition: CORE_SharedPointersMatrix.h:80
tBoolean exists(const boost::shared_ptr< T > &obj) const
exists
Definition: CORE_SharedPointersMatrix.h:217
boost::shared_ptr< CORE_SharedPointersMatrix< T > > New()
create a shared pointer of CORE_SharedPointersMatrix
Definition: CORE_SharedPointersMatrix.h:38
tBoolean insert(const tUIndex &i, const tUIndex &j, const boost::shared_ptr< T > &obj)
insert the pointer at index i the old element i become the element i+1
Definition: CORE_SharedPointersMatrix.h:101
#define tBoolean
Definition: types.h:139
tUIndex getRowSize(const tUIndex &i) const
return the size of row at index i
Definition: CORE_SharedPointersMatrix.h:209
tBoolean exists(const T &obj) const
exists
Definition: CORE_SharedPointersMatrix.h:224
vector< CORE_SharedPointersList< T > > mVector
Definition: CORE_SharedPointersMatrix.h:12
void clear()
clear the array
Definition: CORE_SharedPointersMatrix.h:177
void setSize(const tUIndex &n)
set the size of the matrix of shared pointers
Definition: CORE_SharedPointersMatrix.h:74
tUIndex rows() const
return the number of rows
Definition: CORE_SharedPointersMatrix.h:206
CORE_SharedPointersMatrix()
create the shared pointers matrix
Definition: CORE_SharedPointersMatrix.hpp:7
tBoolean removeAtIndex(const tUIndex &i, const tUIndex &j)
remove the element at index i and j
Definition: CORE_SharedPointersMatrix.h:123
#define tUIndex
Definition: types.h:126
void removeLine(const tUIndex &i)
remove the line at index i
Definition: CORE_SharedPointersMatrix.h:169
abstract base class for most classes.
Definition: CORE_Object.h:53
class CORE_SharedPointersMatrix is a matrix of shared pointers Matrix is a vector of shared pointer o...
Definition: CORE_SharedPointersMatrix.h:9
tUIndex getSize() const
return the size of the array
Definition: CORE_SharedPointersMatrix.h:212
tBoolean exists(const T *obj) const
exists
Definition: CORE_SharedPointersMatrix.h:232
const CORE_SharedPointersList< T > & operator[](const tUIndex &i) const
get the i-th line
Definition: CORE_SharedPointersMatrix.h:51
virtual ~CORE_SharedPointersMatrix()
destroy an array of T*
Definition: CORE_SharedPointersMatrix.hpp:18
void copy(const CORE_SharedPointersMatrix< Q > &cpy)
copy the shared pointers matrix cpy
Definition: CORE_SharedPointersMatrix.hpp:25
#define ASSERT_IN(a)
Definition: types.h:196
void setRowSize(const tUIndex &i, const tUIndex &r)
set size of the row
Definition: CORE_SharedPointersMatrix.h:87
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141