Open CASCADE Technology  7.3.0
Data Structures | Public Types | Public Member Functions | Protected Attributes

NCollection_Array2< TheItemType > Class Template Reference

#include <NCollection_Array2.hxx>

Data Structures

class  Iterator
 

Public Types

typedef TheItemType value_type
 STL-compliant typedef for value type. More...
 

Public Member Functions

 NCollection_Array2 (const Standard_Integer theRowLower, const Standard_Integer theRowUpper, const Standard_Integer theColLower, const Standard_Integer theColUpper)
 Constructor. More...
 
 NCollection_Array2 (const NCollection_Array2 &theOther)
 Copy constructor. More...
 
 NCollection_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...
 
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
 Returns length of the row, i.e. number of columns. More...
 
Standard_Integer ColLength (void) const
 Returns length of the column, i.e. number of rows. 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...
 
NCollection_Array2Assign (const NCollection_Array2 &theOther)
 Assignment. More...
 
NCollection_Array2operator= (const NCollection_Array2 &theOther)
 Assignment operator. 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...
 
 ~NCollection_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...
 

Detailed Description

template<class TheItemType>
class NCollection_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 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++)

Member Typedef Documentation

◆ value_type

template<class TheItemType>
typedef TheItemType NCollection_Array2< TheItemType >::value_type

STL-compliant typedef for value type.

Constructor & Destructor Documentation

◆ NCollection_Array2() [1/3]

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

Constructor.

◆ NCollection_Array2() [2/3]

template<class TheItemType>
NCollection_Array2< TheItemType >::NCollection_Array2 ( const NCollection_Array2< TheItemType > &  theOther)
inline

Copy constructor.

◆ NCollection_Array2() [3/3]

template<class TheItemType>
NCollection_Array2< TheItemType >::NCollection_Array2 ( const TheItemType &  theBegin,
const Standard_Integer  theRowLower,
const Standard_Integer  theRowUpper,
const Standard_Integer  theColLower,
const Standard_Integer  theColUpper 
)
inline

C array-based constructor.

◆ ~NCollection_Array2()

template<class TheItemType>
NCollection_Array2< TheItemType >::~NCollection_Array2 ( void  )
inline

Destructor - releases the memory.

Member Function Documentation

◆ Assign()

template<class TheItemType>
NCollection_Array2& NCollection_Array2< TheItemType >::Assign ( const NCollection_Array2< TheItemType > &  theOther)
inline

Assignment.

◆ ChangeValue()

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

Variable value access.

◆ ColLength()

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

Returns length of the column, i.e. number of rows.

◆ Init()

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

Initialise the values.

◆ IsDeletable()

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

myDeletable flag

◆ Length()

template<class TheItemType>
Standard_Integer NCollection_Array2< TheItemType >::Length ( void  ) const
inline

Length (number of items)

◆ LowerCol()

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

LowerCol.

◆ LowerRow()

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

LowerRow.

◆ operator()() [1/2]

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

operator() - alias to ChangeValue

◆ operator()() [2/2]

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

operator() - alias to ChangeValue

◆ operator=()

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

Assignment operator.

◆ RowLength()

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

Returns length of the row, i.e. number of columns.

◆ SetValue()

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

SetValue.

◆ Size()

template<class TheItemType>
Standard_Integer NCollection_Array2< TheItemType >::Size ( void  ) const
inline

Size (number of items)

◆ UpperCol()

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

UpperCol.

◆ UpperRow()

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

UpperRow.

◆ Value()

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

Constant value access.

Field Documentation

◆ myData

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

Pointer to the row pointers table.

◆ myDeletable

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

Flag showing who allocated the array.

◆ myLowerCol

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

◆ myLowerRow

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

◆ myStart

template<class TheItemType>
TheItemType* NCollection_Array2< TheItemType >::myStart
protected

Pointer to the memory array.

◆ myUpperCol

template<class TheItemType>
Standard_Integer NCollection_Array2< TheItemType >::myUpperCol
protected

◆ myUpperRow

template<class TheItemType>
Standard_Integer NCollection_Array2< TheItemType >::myUpperRow
protected

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