#include <NCollection_Array1.hxx>
Inheritance diagram for NCollection_Array1< TheItemType >:
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 & | 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. | |
Private Member Functions | |
virtual TYPENAME NCollection_BaseCollection< TheItemType >::Iterator & | CreateIterator (void) const |
Method to create iterators for base collections. | |
Data Structures | |
class | Iterator |
Implementation of the Iterator interface. More... |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >. |
|
|
|
|
|
|
|
|
|
|
|
|