SALOME - SMESH
|
Purpose: The class Array2 represents bi-dimensional arrays of fixed size known at run time. More...
#include <SMESH_Array2.hxx>
Data Structures | |
class | Iterator |
Public Member Functions | |
SMESH_Array2 (const Standard_Integer theRowLower, const Standard_Integer theRowUpper, const Standard_Integer theColLower, const Standard_Integer theColUpper) | |
Constructor. More... | |
SMESH_Array2 (const SMESH_Array2 &theOther) | |
Copy constructor. More... | |
SMESH_Array2 (const TheItemType &theBegin, const Standard_Integer theRowLower, const Standard_Integer theRowUpper, const Standard_Integer theColLower, const Standard_Integer theColUpper) | |
C array-based constructor. More... | |
void | Init (const TheItemType &theValue) |
Initialise the values. More... | |
virtual Standard_Integer | Size (void) const |
Size (number of items) More... | |
Standard_Integer | Length (void) const |
Length (number of items) More... | |
Standard_Integer | RowLength (void) const |
RowLength. More... | |
Standard_Integer | ColLength (void) const |
ColLength. More... | |
Standard_Integer | LowerRow (void) const |
LowerRow. More... | |
Standard_Integer | UpperRow (void) const |
UpperRow. More... | |
Standard_Integer | LowerCol (void) const |
LowerCol. More... | |
Standard_Integer | UpperCol (void) const |
UpperCol. More... | |
Standard_Boolean | IsDeletable (void) const |
myDeletable flag More... | |
virtual void | Assign (const NCollection_Array2< TheItemType > &theOther) |
Assign. More... | |
SMESH_Array2 & | operator= (const SMESH_Array2 &theOther) |
operator= (array to array) More... | |
const TheItemType & | Value (const Standard_Integer theRow, const Standard_Integer theCol) const |
Constant value access. More... | |
const TheItemType & | operator() (const Standard_Integer theRow, const Standard_Integer theCol) const |
operator() - alias to ChangeValue More... | |
TheItemType & | ChangeValue (const Standard_Integer theRow, const Standard_Integer theCol) |
Variable value access. More... | |
TheItemType & | operator() (const Standard_Integer theRow, const Standard_Integer theCol) |
operator() - alias to ChangeValue More... | |
void | SetValue (const Standard_Integer theRow, const Standard_Integer theCol, const TheItemType &theItem) |
SetValue. More... | |
~SMESH_Array2 (void) | |
Destructor - releases the memory. More... | |
Protected Attributes | |
Standard_Integer | myLowerRow |
Standard_Integer | myUpperRow |
Standard_Integer | myLowerCol |
Standard_Integer | myUpperCol |
TheItemType ** | myData |
Pointer to the row pointers table. More... | |
TheItemType * | myStart |
Pointer to the memory array. More... | |
Standard_Boolean | myDeletable |
Flag showing who allocated the array. More... | |
Private Member Functions | |
void | Allocate (void) |
Allocate memory for the array, set up indirection table. More... | |
virtual TYPENAME NCollection_Array2< TheItemType >::Iterator & | CreateIterator (void) const |
Creates Iterator for use on BaseCollection. More... | |
Friends | |
class | Iterator |
Purpose: The class Array2 represents bi-dimensional arrays of fixed size known at run time.
The ranges of indices are user defined.
Warning: Programs clients of such class must be independant of the range of the first element. Then, a C++ for loop must be written like this
for (i = A.LowerRow(); i <= A.UpperRow(); i++) for (j = A.LowerCol(); j <= A.UpperCol(); j++)
Definition at line 36 of file SMESH_Array2.hxx.
SMESH_Array2< TheItemType >::SMESH_Array2 | ( | const Standard_Integer | theRowLower, |
const Standard_Integer | theRowUpper, | ||
const Standard_Integer | theColLower, | ||
const Standard_Integer | theColUpper | ||
) |
Constructor.
Definition at line 87 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::Allocate().
SMESH_Array2< TheItemType >::SMESH_Array2 | ( | const SMESH_Array2< TheItemType > & | theOther | ) |
Copy constructor.
Definition at line 100 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::Allocate().
SMESH_Array2< TheItemType >::SMESH_Array2 | ( | const TheItemType & | theBegin, |
const Standard_Integer | theRowLower, | ||
const Standard_Integer | theRowUpper, | ||
const Standard_Integer | theColLower, | ||
const Standard_Integer | theColUpper | ||
) |
C array-based constructor.
Definition at line 113 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::Allocate(), and SMESH_Array2< TheItemType >::myStart.
SMESH_Array2< TheItemType >::~SMESH_Array2 | ( | void | ) |
Destructor - releases the memory.
Definition at line 253 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myData, SMESH_Array2< TheItemType >::myDeletable, SMESH_Array2< TheItemType >::myLowerRow, and SMESH_Array2< TheItemType >::myStart.
void SMESH_Array2< TheItemType >::Init | ( | const TheItemType & | theValue | ) |
Initialise the values.
Definition at line 130 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myStart, and SMESH_Array2< TheItemType >::Size().
|
virtual |
Size (number of items)
Definition at line 138 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::Length().
Referenced by SMESH_Array2< TheItemType >::Init().
Standard_Integer SMESH_Array2< TheItemType >::Length | ( | void | ) | const |
Length (number of items)
Definition at line 141 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::ColLength(), and SMESH_Array2< TheItemType >::RowLength().
Referenced by SMESH_Array2< TheItemType >::Assign(), SMESH_Array2< TheItemType >::Iterator::Init(), SMESH_Array2< TheItemType >::operator=(), and SMESH_Array2< TheItemType >::Size().
Standard_Integer SMESH_Array2< TheItemType >::RowLength | ( | void | ) | const |
RowLength.
Definition at line 145 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myLowerCol, and SMESH_Array2< TheItemType >::myUpperCol.
Referenced by SMESH_Array2< TheItemType >::Length().
Standard_Integer SMESH_Array2< TheItemType >::ColLength | ( | void | ) | const |
ColLength.
Definition at line 148 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myLowerRow, and SMESH_Array2< TheItemType >::myUpperRow.
Referenced by SMESH_Array2< TheItemType >::Length().
Standard_Integer SMESH_Array2< TheItemType >::LowerRow | ( | void | ) | const |
LowerRow.
Definition at line 152 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myLowerRow.
Standard_Integer SMESH_Array2< TheItemType >::UpperRow | ( | void | ) | const |
UpperRow.
Definition at line 155 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myUpperRow.
Standard_Integer SMESH_Array2< TheItemType >::LowerCol | ( | void | ) | const |
LowerCol.
Definition at line 158 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myLowerCol.
Standard_Integer SMESH_Array2< TheItemType >::UpperCol | ( | void | ) | const |
UpperCol.
Definition at line 161 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myUpperCol.
Standard_Boolean SMESH_Array2< TheItemType >::IsDeletable | ( | void | ) | const |
myDeletable flag
Definition at line 165 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myDeletable.
|
virtual |
Assign.
Definition at line 171 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::Length(), and SMESH_Array2< TheItemType >::myStart.
SMESH_Array2& SMESH_Array2< TheItemType >::operator= | ( | const SMESH_Array2< TheItemType > & | theOther | ) |
operator= (array to array)
Definition at line 189 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::Length(), and SMESH_Array2< TheItemType >::myStart.
const TheItemType& SMESH_Array2< TheItemType >::Value | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol | ||
) | const |
Constant value access.
Definition at line 206 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myData, SMESH_Array2< TheItemType >::myUpperCol, and SMESH_Array2< TheItemType >::myUpperRow.
Referenced by SMESH_Array2< TheItemType >::operator()().
const TheItemType& SMESH_Array2< TheItemType >::operator() | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol | ||
) | const |
operator() - alias to ChangeValue
Definition at line 218 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::Value().
TheItemType& SMESH_Array2< TheItemType >::ChangeValue | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol | ||
) |
Variable value access.
Definition at line 223 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myData, SMESH_Array2< TheItemType >::myUpperCol, and SMESH_Array2< TheItemType >::myUpperRow.
Referenced by SMESH_Array2< TheItemType >::operator()().
TheItemType& SMESH_Array2< TheItemType >::operator() | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol | ||
) |
operator() - alias to ChangeValue
Definition at line 235 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::ChangeValue().
void SMESH_Array2< TheItemType >::SetValue | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol, | ||
const TheItemType & | theItem | ||
) |
SetValue.
Definition at line 240 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myData, SMESH_Array2< TheItemType >::myUpperCol, and SMESH_Array2< TheItemType >::myUpperRow.
|
private |
Allocate memory for the array, set up indirection table.
Definition at line 263 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::myData, SMESH_Array2< TheItemType >::myDeletable, SMESH_Array2< TheItemType >::myLowerCol, SMESH_Array2< TheItemType >::myLowerRow, SMESH_Array2< TheItemType >::myStart, SMESH_Array2< TheItemType >::myUpperCol, and SMESH_Array2< TheItemType >::myUpperRow.
Referenced by SMESH_Array2< TheItemType >::SMESH_Array2().
|
privatevirtual |
Creates Iterator for use on BaseCollection.
Definition at line 300 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >::Iterator.
|
friend |
Definition at line 315 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >::CreateIterator().
|
protected |
Definition at line 305 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >::Allocate(), SMESH_Array2< TheItemType >::ColLength(), SMESH_Array2< TheItemType >::LowerRow(), and SMESH_Array2< TheItemType >::~SMESH_Array2().
|
protected |
Definition at line 306 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >::Allocate(), SMESH_Array2< TheItemType >::ChangeValue(), SMESH_Array2< TheItemType >::ColLength(), SMESH_Array2< TheItemType >::SetValue(), SMESH_Array2< TheItemType >::UpperRow(), and SMESH_Array2< TheItemType >::Value().
|
protected |
Definition at line 307 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >::Allocate(), SMESH_Array2< TheItemType >::LowerCol(), and SMESH_Array2< TheItemType >::RowLength().
|
protected |
Definition at line 308 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >::Allocate(), SMESH_Array2< TheItemType >::ChangeValue(), SMESH_Array2< TheItemType >::RowLength(), SMESH_Array2< TheItemType >::SetValue(), SMESH_Array2< TheItemType >::UpperCol(), and SMESH_Array2< TheItemType >::Value().
|
protected |
Pointer to the row pointers table.
Definition at line 310 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >::Allocate(), SMESH_Array2< TheItemType >::ChangeValue(), SMESH_Array2< TheItemType >::SetValue(), SMESH_Array2< TheItemType >::Value(), and SMESH_Array2< TheItemType >::~SMESH_Array2().
|
protected |
Pointer to the memory array.
Definition at line 311 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >::Allocate(), SMESH_Array2< TheItemType >::Assign(), SMESH_Array2< TheItemType >::Iterator::ChangeValue(), SMESH_Array2< TheItemType >::Init(), SMESH_Array2< TheItemType >::operator=(), SMESH_Array2< TheItemType >::SMESH_Array2(), SMESH_Array2< TheItemType >::Iterator::Value(), and SMESH_Array2< TheItemType >::~SMESH_Array2().
|
protected |
Flag showing who allocated the array.
Definition at line 312 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >::Allocate(), SMESH_Array2< TheItemType >::IsDeletable(), and SMESH_Array2< TheItemType >::~SMESH_Array2().