Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Data Structures | Public Member Functions | Protected Attributes
NCollection_Array2< TheItemType > Class Template Reference

#include <NCollection_Array2.hxx>

Inheritance diagram for NCollection_Array2< TheItemType >:
Inheritance graph
[legend]

Data Structures

class  Iterator

Public Member Functions

 NCollection_Array2 (const Standard_Integer theRowLower, const Standard_Integer theRowUpper, const Standard_Integer theColLower, const Standard_Integer theColUpper)
 Constructor.
 NCollection_Array2 (const NCollection_Array2 &theOther)
 Copy constructor.
 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.
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.
NCollection_Array2operator= (const NCollection_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.
 ~NCollection_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.

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


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]
template<class TheItemType >
NCollection_Array2< TheItemType >::NCollection_Array2 ( const NCollection_Array2< TheItemType > &  theOther) [inline]
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]
template<class TheItemType >
NCollection_Array2< TheItemType >::~NCollection_Array2 ( void  ) [inline]

Member Function Documentation

template<class TheItemType >
virtual void NCollection_Array2< TheItemType >::Assign ( const NCollection_BaseCollection< TheItemType > &  theOther) [inline, virtual]
template<class TheItemType >
TheItemType& NCollection_Array2< TheItemType >::ChangeValue ( const Standard_Integer  theRow,
const Standard_Integer  theCol 
) [inline]
template<class TheItemType >
Standard_Integer NCollection_Array2< TheItemType >::ColLength ( void  ) const [inline]
template<class TheItemType >
void NCollection_Array2< TheItemType >::Init ( const TheItemType &  theValue) [inline]
template<class TheItemType >
Standard_Boolean NCollection_Array2< TheItemType >::IsDeletable ( void  ) const [inline]
template<class TheItemType >
Standard_Integer NCollection_Array2< TheItemType >::Length ( void  ) const [inline]
template<class TheItemType >
Standard_Integer NCollection_Array2< TheItemType >::LowerCol ( void  ) const [inline]
template<class TheItemType >
Standard_Integer NCollection_Array2< TheItemType >::LowerRow ( void  ) const [inline]
template<class TheItemType >
const TheItemType& NCollection_Array2< TheItemType >::operator() ( const Standard_Integer  theRow,
const Standard_Integer  theCol 
) const [inline]
template<class TheItemType >
TheItemType& NCollection_Array2< TheItemType >::operator() ( const Standard_Integer  theRow,
const Standard_Integer  theCol 
) [inline]
template<class TheItemType >
NCollection_Array2& NCollection_Array2< TheItemType >::operator= ( const NCollection_Array2< TheItemType > &  theOther) [inline]
template<class TheItemType >
Standard_Integer NCollection_Array2< TheItemType >::RowLength ( void  ) const [inline]
template<class TheItemType >
void NCollection_Array2< TheItemType >::SetValue ( const Standard_Integer  theRow,
const Standard_Integer  theCol,
const TheItemType &  theItem 
) [inline]
template<class TheItemType >
virtual Standard_Integer NCollection_Array2< TheItemType >::Size ( void  ) const [inline, virtual]
template<class TheItemType >
Standard_Integer NCollection_Array2< TheItemType >::UpperCol ( void  ) const [inline]
template<class TheItemType >
Standard_Integer NCollection_Array2< TheItemType >::UpperRow ( void  ) const [inline]
template<class TheItemType >
const TheItemType& NCollection_Array2< TheItemType >::Value ( const Standard_Integer  theRow,
const Standard_Integer  theCol 
) const [inline]

Field Documentation

template<class TheItemType >
TheItemType** NCollection_Array2< TheItemType >::myData [protected]
template<class TheItemType >
Standard_Boolean NCollection_Array2< TheItemType >::myDeletable [protected]
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]
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: