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. | |
SMESH_Array2 (const SMESH_Array2 &theOther) | |
Copy constructor. | |
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. | |
void | Init (const TheItemType &theValue) |
Initialise the values. | |
virtual Standard_Integer | Size (void) const |
Size (number of items) | |
Standard_Integer | Length (void) const |
Length (number of items) | |
Standard_Integer | RowLength (void) const |
RowLength. | |
Standard_Integer | ColLength (void) const |
ColLength. | |
Standard_Integer | LowerRow (void) const |
LowerRow. | |
Standard_Integer | UpperRow (void) const |
UpperRow. | |
Standard_Integer | LowerCol (void) const |
LowerCol. | |
Standard_Integer | UpperCol (void) const |
UpperCol. | |
Standard_Boolean | IsDeletable (void) const |
myDeletable flag | |
virtual void | Assign (const NCollection_BaseCollection< TheItemType > &theOther) |
Assign. | |
SMESH_Array2 & | operator= (const SMESH_Array2 &theOther) |
operator= (array to array) | |
const TheItemType & | Value (const Standard_Integer theRow, const Standard_Integer theCol) const |
Constant value access. | |
const TheItemType & | operator() (const Standard_Integer theRow, const Standard_Integer theCol) const |
operator() - alias to ChangeValue | |
TheItemType & | ChangeValue (const Standard_Integer theRow, const Standard_Integer theCol) |
Variable value access. | |
TheItemType & | operator() (const Standard_Integer theRow, const Standard_Integer theCol) |
operator() - alias to ChangeValue | |
void | SetValue (const Standard_Integer theRow, const Standard_Integer theCol, const TheItemType &theItem) |
SetValue. | |
~SMESH_Array2 (void) | |
Destructor - releases the memory. | |
Protected Attributes | |
Standard_Integer | myLowerRow |
Standard_Integer | myUpperRow |
Standard_Integer | myLowerCol |
Standard_Integer | myUpperCol |
TheItemType ** | myData |
Pointer to the row pointers table. | |
TheItemType * | myStart |
Pointer to the memory array. | |
Standard_Boolean | myDeletable |
Flag showing who allocated the array. | |
Private Member Functions | |
void | Allocate (void) |
Allocate memory for the array, set up indirection table. | |
virtual TYPENAME NCollection_BaseCollection < TheItemType >::Iterator & | CreateIterator (void) const |
Creates Iterator for use on BaseCollection. | |
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 Standard_Integer SMESH_Array2< TheItemType >.Size | ( | void | ) | const [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 void SMESH_Array2< TheItemType >.Assign | ( | const NCollection_BaseCollection< TheItemType > & | theOther | ) | [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.
void SMESH_Array2< TheItemType >.Allocate | ( | void | ) | [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().
virtual TYPENAME NCollection_BaseCollection<TheItemType>::Iterator& SMESH_Array2< TheItemType >.CreateIterator | ( | void | ) | const [private, virtual] |
Creates Iterator for use on BaseCollection.
Definition at line 300 of file SMESH_Array2.hxx.
References SMESH_Array2< TheItemType >.Iterator.
friend class Iterator [friend] |
Definition at line 315 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2< TheItemType >.CreateIterator().
Standard_Integer SMESH_Array2< TheItemType >.myLowerRow [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().
Standard_Integer SMESH_Array2< TheItemType >.myUpperRow [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().
Standard_Integer SMESH_Array2< TheItemType >.myLowerCol [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().
Standard_Integer SMESH_Array2< TheItemType >.myUpperCol [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().
TheItemType** SMESH_Array2< TheItemType >.myData [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().
TheItemType* SMESH_Array2< TheItemType >.myStart [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().
Standard_Boolean SMESH_Array2< TheItemType >.myDeletable [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().