Open CASCADE Technology  7.0.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

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

STL-compliant typedef for value type.

Constructor & Destructor Documentation

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.

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

Copy constructor.

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.

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

Destructor - releases the memory.

Member Function Documentation

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

Assignment.

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

Variable value access.

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

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

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

Initialise the values.

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

myDeletable flag

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

Length (number of items)

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

LowerCol.

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

LowerRow.

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

operator() - alias to ChangeValue

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

operator() - alias to ChangeValue

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

Assignment operator.

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

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

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

SetValue.

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

Size (number of items)

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

UpperCol.

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

UpperRow.

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

Constant value access.

Field Documentation

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

Pointer to the row pointers table.

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

Flag showing who allocated the array.

template<class TheItemType>
Standard_Integer NCollection_Array2< TheItemType >::myLowerCol
protected
template<class TheItemType>
Standard_Integer NCollection_Array2< TheItemType >::myLowerRow
protected
template<class TheItemType>
TheItemType* NCollection_Array2< TheItemType >::myStart
protected

Pointer to the memory array.

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

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