SMESH_Array2< TheItemType > Class Template Reference

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

#include <SMESH_Array2.hxx>

Classes

class  Iterator
 

Public Member Functions

virtual void Assign (const NCollection_BaseCollection< TheItemType > &theOther)
 Assign. More...
 
TheItemType & ChangeValue (const Standard_Integer theRow, const Standard_Integer theCol)
 Variable value access. More...
 
Standard_Integer ColLength (void) const
 ColLength. More...
 
void Init (const TheItemType &theValue)
 Initialise the values. More...
 
Standard_Boolean IsDeletable (void) const
 myDeletable flag More...
 
Standard_Integer Length (void) const
 Length (number of items) More...
 
Standard_Integer LowerCol (void) const
 LowerCol. More...
 
Standard_Integer LowerRow (void) const
 LowerRow. More...
 
TheItemType & operator() (const Standard_Integer theRow, const Standard_Integer theCol)
 operator() - alias to ChangeValue More...
 
const TheItemType & operator() (const Standard_Integer theRow, const Standard_Integer theCol) const
 operator() - alias to ChangeValue More...
 
SMESH_Array2operator= (const SMESH_Array2 &theOther)
 operator= (array to array) More...
 
Standard_Integer RowLength (void) const
 RowLength. More...
 
void SetValue (const Standard_Integer theRow, const Standard_Integer theCol, const TheItemType &theItem)
 SetValue. More...
 
virtual Standard_Integer Size (void) const
 Size (number of items) More...
 
 SMESH_Array2 (const SMESH_Array2 &theOther)
 Copy constructor. More...
 
 SMESH_Array2 (const Standard_Integer theRowLower, const Standard_Integer theRowUpper, const Standard_Integer theColLower, const Standard_Integer theColUpper)
 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...
 
Standard_Integer UpperCol (void) const
 UpperCol. More...
 
Standard_Integer UpperRow (void) const
 UpperRow. More...
 
const TheItemType & Value (const Standard_Integer theRow, const Standard_Integer theCol) const
 Constant value access. More...
 
 ~SMESH_Array2 (void)
 Destructor - releases the memory. More...
 

Protected Attributes

TheItemType ** myData
 Pointer to the row pointers table. More...
 
Standard_Boolean myDeletable
 Flag showing who allocated the array. More...
 
Standard_Integer myLowerCol
 
Standard_Integer myLowerRow
 
TheItemType * myStart
 Pointer to the memory array. More...
 
Standard_Integer myUpperCol
 
Standard_Integer myUpperRow
 

Friends

class Iterator
 

Detailed Description

template<class TheItemType>
class SMESH_Array2< TheItemType >

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 independent 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() [1/3]

template<class TheItemType >
SMESH_Array2< TheItemType >::SMESH_Array2 ( const Standard_Integer  theRowLower,
const Standard_Integer  theRowUpper,
const Standard_Integer  theColLower,
const Standard_Integer  theColUpper 
)

Constructor.

◆ SMESH_Array2() [2/3]

template<class TheItemType >
SMESH_Array2< TheItemType >::SMESH_Array2 ( const SMESH_Array2< TheItemType > &  theOther)

Copy constructor.

◆ SMESH_Array2() [3/3]

template<class TheItemType >
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.

References SMESH_Array2< TheItemType >::myStart.

◆ ~SMESH_Array2()

template<class TheItemType >
SMESH_Array2< TheItemType >::~SMESH_Array2 ( void  )

Member Function Documentation

◆ Assign()

template<class TheItemType >
virtual void SMESH_Array2< TheItemType >::Assign ( const NCollection_BaseCollection< TheItemType > &  theOther)
virtual

◆ ChangeValue()

template<class TheItemType >
TheItemType & SMESH_Array2< TheItemType >::ChangeValue ( const Standard_Integer  theRow,
const Standard_Integer  theCol 
)

◆ ColLength()

template<class TheItemType >
Standard_Integer SMESH_Array2< TheItemType >::ColLength ( void  ) const

◆ Init()

template<class TheItemType >
void SMESH_Array2< TheItemType >::Init ( const TheItemType &  theValue)

◆ IsDeletable()

template<class TheItemType >
Standard_Boolean SMESH_Array2< TheItemType >::IsDeletable ( void  ) const

myDeletable flag

References SMESH_Array2< TheItemType >::myDeletable.

◆ Length()

◆ LowerCol()

template<class TheItemType >
Standard_Integer SMESH_Array2< TheItemType >::LowerCol ( void  ) const

◆ LowerRow()

template<class TheItemType >
Standard_Integer SMESH_Array2< TheItemType >::LowerRow ( void  ) const

◆ operator()() [1/2]

template<class TheItemType >
TheItemType & SMESH_Array2< TheItemType >::operator() ( const Standard_Integer  theRow,
const Standard_Integer  theCol 
)

operator() - alias to ChangeValue

References SMESH_Array2< TheItemType >::ChangeValue().

◆ operator()() [2/2]

template<class TheItemType >
const TheItemType & SMESH_Array2< TheItemType >::operator() ( const Standard_Integer  theRow,
const Standard_Integer  theCol 
) const

operator() - alias to ChangeValue

References SMESH_Array2< TheItemType >::Value().

◆ operator=()

template<class TheItemType >
SMESH_Array2 & SMESH_Array2< TheItemType >::operator= ( const SMESH_Array2< TheItemType > &  theOther)

◆ RowLength()

template<class TheItemType >
Standard_Integer SMESH_Array2< TheItemType >::RowLength ( void  ) const

◆ SetValue()

template<class TheItemType >
void SMESH_Array2< TheItemType >::SetValue ( const Standard_Integer  theRow,
const Standard_Integer  theCol,
const TheItemType &  theItem 
)

◆ Size()

template<class TheItemType >
virtual Standard_Integer SMESH_Array2< TheItemType >::Size ( void  ) const
virtual

Size (number of items)

References SMESH_Array2< TheItemType >::Length().

Referenced by SMESH_Array2< TheItemType >::Init().

◆ UpperCol()

template<class TheItemType >
Standard_Integer SMESH_Array2< TheItemType >::UpperCol ( void  ) const

◆ UpperRow()

template<class TheItemType >
Standard_Integer SMESH_Array2< TheItemType >::UpperRow ( void  ) const

◆ Value()

template<class TheItemType >
const TheItemType & SMESH_Array2< TheItemType >::Value ( const Standard_Integer  theRow,
const Standard_Integer  theCol 
) const

Friends And Related Function Documentation

◆ Iterator

template<class TheItemType >
friend class Iterator
friend

Member Data Documentation

◆ myData

template<class TheItemType >
TheItemType** SMESH_Array2< TheItemType >::myData
protected

◆ myDeletable

template<class TheItemType >
Standard_Boolean SMESH_Array2< TheItemType >::myDeletable
protected

Flag showing who allocated the array.

Referenced by SMESH_Array2< TheItemType >::IsDeletable(), and SMESH_Array2< TheItemType >::~SMESH_Array2().

◆ myLowerCol

template<class TheItemType >
Standard_Integer SMESH_Array2< TheItemType >::myLowerCol
protected

◆ myLowerRow

template<class TheItemType >
Standard_Integer SMESH_Array2< TheItemType >::myLowerRow
protected

◆ myStart

◆ myUpperCol

◆ myUpperRow


The documentation for this class was generated from the following file: