SALOME - SMESH
SMESH_Array2 Class Reference

Purpose: The class Array2 represents bi-dimensional arrays of fixed size known at run time. More...

#include <SMESH_Array2.hxx>

Inheritance diagram for SMESH_Array2:
Inheritance graph
Collaboration diagram for SMESH_Array2:
Collaboration graph

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_Array2operator= (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

Detailed Description

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++)


Constructor & Destructor Documentation

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().

Here is the call graph for this function:

SMESH_Array2::SMESH_Array2 ( const SMESH_Array2 theOther)

Copy constructor.

Definition at line 100 of file SMESH_Array2.hxx.

References Allocate().

Here is the call graph for this function:

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().

Here is the call graph for this function:

SMESH_Array2::~SMESH_Array2 ( void  )

Destructor - releases the memory.

Definition at line 253 of file SMESH_Array2.hxx.

References myDeletable, myStart, myData, and myLowerRow.


Member Function Documentation

void SMESH_Array2::Init ( const TheItemType &  theValue)

Initialise the values.

Definition at line 130 of file SMESH_Array2.hxx.

References myStart, and Size().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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=().

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Integer SMESH_Array2::RowLength ( void  ) const

RowLength.

Definition at line 145 of file SMESH_Array2.hxx.

References myUpperCol, and myLowerCol.

Referenced by Length().

Here is the caller graph for this function:

Standard_Integer SMESH_Array2::ColLength ( void  ) const

ColLength.

Definition at line 148 of file SMESH_Array2.hxx.

References myUpperRow, and myLowerRow.

Referenced by Length().

Here is the caller graph for this function:

Standard_Integer SMESH_Array2::LowerRow ( void  ) const

LowerRow.

Definition at line 152 of file SMESH_Array2.hxx.

References myLowerRow.

Standard_Integer SMESH_Array2::UpperRow ( void  ) const

UpperRow.

Definition at line 155 of file SMESH_Array2.hxx.

References myUpperRow.

Standard_Integer SMESH_Array2::LowerCol ( void  ) const

LowerCol.

Definition at line 158 of file SMESH_Array2.hxx.

References myLowerCol.

Standard_Integer SMESH_Array2::UpperCol ( void  ) const

UpperCol.

Definition at line 161 of file SMESH_Array2.hxx.

References myUpperCol.

Standard_Boolean SMESH_Array2::IsDeletable ( void  ) const

myDeletable flag

Definition at line 165 of file SMESH_Array2.hxx.

References myDeletable.

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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()().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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()().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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.


Friends And Related Function Documentation

friend class Iterator [friend]

Definition at line 315 of file SMESH_Array2.hxx.

Referenced by CreateIterator().


Field Documentation

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]
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().