Open CASCADE Technology  6.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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. 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...
 
virtual 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
 RowLength. More...
 
Standard_Integer ColLength (void) const
 ColLength. 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...
 
virtual void Assign (const NCollection_BaseCollection< TheItemType > &theOther)
 Assign. More...
 
NCollection_Array2operator= (const NCollection_Array2 &theOther)
 operator= (array to array) 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...
 
- Public Member Functions inherited from NCollection_BaseCollection< TheItemType >
 NCollection_BaseCollection (const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Common for all collections constructor takes care of theAllocator. More...
 
virtual ~NCollection_BaseCollection (void)
 Destructor - must be implemented to release the memory. More...
 
const Handle
< NCollection_BaseAllocator > & 
Allocator () const
 Returns attached allocator. 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...
 
- Protected Attributes inherited from NCollection_BaseCollection< TheItemType >
Handle< NCollection_BaseAllocatormyAllocator
 

Additional Inherited Members

- Protected Member Functions inherited from NCollection_BaseCollection< TheItemType >
const Handle
< NCollection_BaseAllocator > & 
IterAllocator (void) const
 
void exchangeAllocators (NCollection_BaseCollection &theOther)
 Exchange allocators of two collections. 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++)

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 >
virtual void NCollection_Array2< TheItemType >::Assign ( const NCollection_BaseCollection< TheItemType > &  theOther)
inlinevirtual
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

ColLength.

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

operator= (array to array)

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

RowLength.

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

SetValue.

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

Size (number of items)

Implements NCollection_BaseCollection< TheItemType >.

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: