Open CASCADE Technology 6.6.0
|
#include <NCollection_Array1.hxx>
Data Structures | |
class | Iterator |
Implementation of the Iterator interface. More... | |
Public Member Functions | |
NCollection_Array1 (const Standard_Integer theLower, const Standard_Integer theUpper) | |
Constructor. | |
NCollection_Array1 (const NCollection_Array1 &theOther) | |
Copy constructor. | |
NCollection_Array1 (const TheItemType &theBegin, const Standard_Integer theLower, const Standard_Integer theUpper) | |
C array-based constructor. | |
void | Init (const TheItemType &theValue) |
Initialise the items with theValue. | |
virtual Standard_Integer | Size (void) const |
Size query. | |
Standard_Integer | Length (void) const |
Length query (the same) | |
Standard_Integer | Lower (void) const |
Lower bound. | |
Standard_Integer | Upper (void) const |
Upper bound. | |
Standard_Boolean | IsDeletable (void) const |
myDeletable flag | |
Standard_Boolean | IsAllocated (void) const |
IsAllocated flag - for naming compatibility. | |
virtual void | Assign (const NCollection_BaseCollection< TheItemType > &theOther) |
Assign (any collection to this array) | |
NCollection_Array1 & | operator= (const NCollection_Array1 &theOther) |
operator= (array to array) | |
const TheItemType & | First () const |
TheItemType & | ChangeFirst () |
const TheItemType & | Last () const |
TheItemType & | ChangeLast () |
const TheItemType & | Value (const Standard_Integer theIndex) const |
Constant value access. | |
const TheItemType & | operator() (const Standard_Integer theIndex) const |
operator() - alias to Value | |
TheItemType & | ChangeValue (const Standard_Integer theIndex) |
Variable value access. | |
TheItemType & | operator() (const Standard_Integer theIndex) |
operator() - alias to ChangeValue | |
void | SetValue (const Standard_Integer theIndex, const TheItemType &theItem) |
Set value. | |
~NCollection_Array1 (void) | |
Destructor - releases the memory. | |
Protected Attributes | |
Standard_Integer | myLowerBound |
Standard_Integer | myUpperBound |
Standard_Boolean | myDeletable |
Flag showing who allocated the array. | |
TheItemType * | myData |
Pointer to '0'th array item. |
Purpose: The class Array1 represents unidimensional arrays of fixed size known at run time. The range of the index is user defined. An array1 can be constructed with a "C array". This functionality is useful to call methods expecting an Array1. It allows to carry the bounds inside the arrays.
Examples: Item tab[100]; // An example with a C array Array1OfItem ttab (tab[0],1,100);
Array1OfItem tttab (ttab(10),10,20); // a slice of ttab
If you want to reindex an array from 1 to Length do :
Array1 tab1(tab(tab.Lower()),1,tab.Length());
Warning: Programs client of such a class must be independant of the range of the first element. Then, a C++ for loop must be written like this
for (i = A.Lower(); i <= A.Upper(); i++)
Changes: In comparison to TCollection the flag isAllocated was renamed into myDeletable (alike in the Array2). For naming compatibility the method IsAllocated remained in class along with IsDeletable.
NCollection_Array1< TheItemType >::NCollection_Array1 | ( | const Standard_Integer | theLower, |
const Standard_Integer | theUpper | ||
) | [inline] |
NCollection_Array1< TheItemType >::NCollection_Array1 | ( | const NCollection_Array1< TheItemType > & | theOther | ) | [inline] |
NCollection_Array1< TheItemType >::NCollection_Array1 | ( | const TheItemType & | theBegin, |
const Standard_Integer | theLower, | ||
const Standard_Integer | theUpper | ||
) | [inline] |
NCollection_Array1< TheItemType >::~NCollection_Array1 | ( | void | ) | [inline] |
virtual void NCollection_Array1< TheItemType >::Assign | ( | const NCollection_BaseCollection< TheItemType > & | theOther | ) | [inline, virtual] |
Implements NCollection_BaseCollection< TheItemType >.
TheItemType& NCollection_Array1< TheItemType >::ChangeFirst | ( | ) | [inline] |
TheItemType& NCollection_Array1< TheItemType >::ChangeLast | ( | ) | [inline] |
TheItemType& NCollection_Array1< TheItemType >::ChangeValue | ( | const Standard_Integer | theIndex | ) | [inline] |
const TheItemType& NCollection_Array1< TheItemType >::First | ( | ) | const [inline] |
void NCollection_Array1< TheItemType >::Init | ( | const TheItemType & | theValue | ) | [inline] |
Standard_Boolean NCollection_Array1< TheItemType >::IsAllocated | ( | void | ) | const [inline] |
Standard_Boolean NCollection_Array1< TheItemType >::IsDeletable | ( | void | ) | const [inline] |
const TheItemType& NCollection_Array1< TheItemType >::Last | ( | ) | const [inline] |
Standard_Integer NCollection_Array1< TheItemType >::Length | ( | void | ) | const [inline] |
Standard_Integer NCollection_Array1< TheItemType >::Lower | ( | void | ) | const [inline] |
TheItemType& NCollection_Array1< TheItemType >::operator() | ( | const Standard_Integer | theIndex | ) | [inline] |
const TheItemType& NCollection_Array1< TheItemType >::operator() | ( | const Standard_Integer | theIndex | ) | const [inline] |
NCollection_Array1& NCollection_Array1< TheItemType >::operator= | ( | const NCollection_Array1< TheItemType > & | theOther | ) | [inline] |
void NCollection_Array1< TheItemType >::SetValue | ( | const Standard_Integer | theIndex, |
const TheItemType & | theItem | ||
) | [inline] |
virtual Standard_Integer NCollection_Array1< TheItemType >::Size | ( | void | ) | const [inline, virtual] |
Implements NCollection_BaseCollection< TheItemType >.
Standard_Integer NCollection_Array1< TheItemType >::Upper | ( | void | ) | const [inline] |
const TheItemType& NCollection_Array1< TheItemType >::Value | ( | const Standard_Integer | theIndex | ) | const [inline] |
TheItemType* NCollection_Array1< TheItemType >::myData [protected] |
Standard_Boolean NCollection_Array1< TheItemType >::myDeletable [protected] |
Standard_Integer NCollection_Array1< TheItemType >::myLowerBound [protected] |
Standard_Integer NCollection_Array1< TheItemType >::myUpperBound [protected] |