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++)
SMESH_Array2::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 Allocate().
SMESH_Array2::SMESH_Array2 | ( | const SMESH_Array2 & | theOther | ) |
Copy constructor.
Definition at line 100 of file SMESH_Array2.hxx.
References Allocate().
SMESH_Array2::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 myStart, and Allocate().
SMESH_Array2::~SMESH_Array2 | ( | void | ) |
Destructor - releases the memory.
Definition at line 253 of file SMESH_Array2.hxx.
References myDeletable, myStart, myData, and myLowerRow.
void SMESH_Array2::Init | ( | const TheItemType & | theValue | ) |
Initialise the values.
Definition at line 130 of file SMESH_Array2.hxx.
References myStart, and Size().
virtual Standard_Integer SMESH_Array2::Size | ( | void | ) | const [virtual] |
Size (number of items)
Definition at line 138 of file SMESH_Array2.hxx.
References Length().
Referenced by Init().
Standard_Integer SMESH_Array2::Length | ( | void | ) | const |
Length (number of items)
Definition at line 141 of file SMESH_Array2.hxx.
References RowLength(), and ColLength().
Referenced by SMESH_Array2::Iterator::Init(), Size(), Assign(), and operator=().
Standard_Integer SMESH_Array2::RowLength | ( | void | ) | const |
RowLength.
Definition at line 145 of file SMESH_Array2.hxx.
References myUpperCol, and myLowerCol.
Referenced by Length().
Standard_Integer SMESH_Array2::ColLength | ( | void | ) | const |
ColLength.
Definition at line 148 of file SMESH_Array2.hxx.
References myUpperRow, and myLowerRow.
Referenced by Length().
Standard_Integer SMESH_Array2::LowerRow | ( | void | ) | const |
Standard_Integer SMESH_Array2::UpperRow | ( | void | ) | const |
Standard_Integer SMESH_Array2::LowerCol | ( | void | ) | const |
Standard_Integer SMESH_Array2::UpperCol | ( | void | ) | const |
Standard_Boolean SMESH_Array2::IsDeletable | ( | void | ) | const |
virtual void SMESH_Array2::Assign | ( | const NCollection_BaseCollection< TheItemType > & | theOther | ) | [virtual] |
Assign.
Definition at line 171 of file SMESH_Array2.hxx.
References Length(), and myStart.
SMESH_Array2& SMESH_Array2::operator= | ( | const SMESH_Array2 & | theOther | ) |
operator= (array to array)
Definition at line 189 of file SMESH_Array2.hxx.
References Length(), and myStart.
const TheItemType& SMESH_Array2::Value | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol | ||
) | const |
Constant value access.
Definition at line 206 of file SMESH_Array2.hxx.
References myUpperRow, myUpperCol, and myData.
Referenced by operator()().
const TheItemType& SMESH_Array2::operator() | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol | ||
) | const |
operator() - alias to ChangeValue
Definition at line 218 of file SMESH_Array2.hxx.
References Value().
TheItemType& SMESH_Array2::ChangeValue | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol | ||
) |
Variable value access.
Definition at line 223 of file SMESH_Array2.hxx.
References myUpperRow, myUpperCol, and myData.
Referenced by operator()().
TheItemType& SMESH_Array2::operator() | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol | ||
) |
operator() - alias to ChangeValue
Definition at line 235 of file SMESH_Array2.hxx.
References ChangeValue().
void SMESH_Array2::SetValue | ( | const Standard_Integer | theRow, |
const Standard_Integer | theCol, | ||
const TheItemType & | theItem | ||
) |
SetValue.
Definition at line 240 of file SMESH_Array2.hxx.
References myUpperRow, myUpperCol, and myData.
void SMESH_Array2::Allocate | ( | void | ) | [private] |
Allocate memory for the array, set up indirection table.
Definition at line 263 of file SMESH_Array2.hxx.
References myUpperCol, myLowerCol, myUpperRow, myLowerRow, myDeletable, myStart, and myData.
Referenced by SMESH_Array2().
virtual TYPENAME NCollection_BaseCollection<TheItemType>::Iterator& SMESH_Array2::CreateIterator | ( | void | ) | const [private, virtual] |
Creates Iterator for use on BaseCollection.
Definition at line 300 of file SMESH_Array2.hxx.
References Iterator.
friend class Iterator [friend] |
Definition at line 315 of file SMESH_Array2.hxx.
Referenced by CreateIterator().
Standard_Integer SMESH_Array2::myLowerRow [protected] |
Definition at line 305 of file SMESH_Array2.hxx.
Referenced by ColLength(), LowerRow(), ~SMESH_Array2(), and Allocate().
Standard_Integer SMESH_Array2::myUpperRow [protected] |
Definition at line 306 of file SMESH_Array2.hxx.
Referenced by ColLength(), UpperRow(), Value(), ChangeValue(), SetValue(), and Allocate().
Standard_Integer SMESH_Array2::myLowerCol [protected] |
Definition at line 307 of file SMESH_Array2.hxx.
Referenced by RowLength(), LowerCol(), and Allocate().
Standard_Integer SMESH_Array2::myUpperCol [protected] |
Definition at line 308 of file SMESH_Array2.hxx.
Referenced by RowLength(), UpperCol(), Value(), ChangeValue(), SetValue(), and Allocate().
TheItemType** SMESH_Array2::myData [protected] |
Pointer to the row pointers table.
Definition at line 310 of file SMESH_Array2.hxx.
Referenced by Value(), ChangeValue(), SetValue(), ~SMESH_Array2(), and Allocate().
TheItemType* SMESH_Array2::myStart [protected] |
Pointer to the memory array.
Definition at line 311 of file SMESH_Array2.hxx.
Referenced by SMESH_Array2::Iterator::Value(), SMESH_Array2::Iterator::ChangeValue(), SMESH_Array2(), Init(), Assign(), operator=(), ~SMESH_Array2(), and Allocate().
Standard_Boolean SMESH_Array2::myDeletable [protected] |
Flag showing who allocated the array.
Definition at line 312 of file SMESH_Array2.hxx.
Referenced by IsDeletable(), ~SMESH_Array2(), and Allocate().