Open CASCADE Technology 6.6.0
|
#include <IntPolyh_Array.hxx>
Public Types | |
typedef NCollection_Vector< Type > | IntPolyh_VectorOfType |
Public Member Functions | |
IntPolyh_Array (const Standard_Integer aIncrement=256) | |
IntPolyh_Array (const Standard_Integer aN, const Standard_Integer aIncrement=256) | |
IntPolyh_Array & | operator= (const IntPolyh_Array &aOther) |
IntPolyh_Array & | Copy (const IntPolyh_Array &aOther) |
void | Init (const Standard_Integer aN) |
void | IncrementNbItems () |
Standard_Integer | GetN () const |
Standard_Integer | NbItems () const |
void | SetNbItems (const Standard_Integer aNb) |
const Type & | Value (const Standard_Integer aIndex) const |
const Type & | operator[] (const Standard_Integer aIndex) const |
Type & | ChangeValue (const Standard_Integer aIndex) |
Type & | operator[] (const Standard_Integer aIndex) |
void | Dump () const |
Protected Attributes | |
Standard_Integer | myNbAllocated |
Standard_Integer | myNbItems |
Standard_Integer | myIncrement |
IntPolyh_VectorOfType | myVectorOfType |
Class IntPolyh_Array (dynamic array of objects)
1. The Array is dynamic array of objects.
2. The Array uses NCollection_Vector to store objects
3. The Array can be created: 3.1. with initial length Nb=0. In this case Array should be initiated by invoke the method Init(Nb). 3.2. with initial length Nb>0. In this case Array is initiated automatically.
The memory is allocated to store myNbAllocated oblects.
4. The number of items that are stored in the Array (myNbItems) can be increased by calling the method: IncrementNbItems(). The objects are stored in already allocated memory if it is possible. Otherwise the new chunk of memory is allocated to store the objects. The size of chunk <aIncrement> can be defined during the creation of the Array.
5. The start index of the Array is 0, The end index of the Array can be obtained by the method NbItems();
6. The contents of the element with index "i" can be queried or modified by the methods: Value(i), ChangeValue(i), operator[](i)
typedef NCollection_Vector<Type> IntPolyh_Array< Type >::IntPolyh_VectorOfType |
IntPolyh_Array< Type >::IntPolyh_Array | ( | const Standard_Integer | aIncrement = 256 | ) | [inline] |
Constructor.
aIncrement | size of memory (in terms of Items) to expand the array |
IntPolyh_Array< Type >::IntPolyh_Array | ( | const Standard_Integer | aN, |
const Standard_Integer | aIncrement = 256 |
||
) | [inline] |
Constructor.
aN | size of memory (in terms of Items) to allocate |
aIncrement | size of memory (in terms of Items) to expand the array |
Type& IntPolyh_Array< Type >::ChangeValue | ( | const Standard_Integer | aIndex | ) | [inline] |
query the value
aIndex | index |
IntPolyh_Array& IntPolyh_Array< Type >::Copy | ( | const IntPolyh_Array< Type > & | aOther | ) | [inline] |
Copy
aOther | - the array to copy from |
void IntPolyh_Array< Type >::Dump | ( | ) | const [inline] |
dump the contents
Standard_Integer IntPolyh_Array< Type >::GetN | ( | ) | const [inline] |
GetN - returns the number of 'allocated' items
void IntPolyh_Array< Type >::IncrementNbItems | ( | ) | [inline] |
IncrementNbItems - increment the number of stored items
void IntPolyh_Array< Type >::Init | ( | const Standard_Integer | aN | ) | [inline] |
Init - allocate memory for <aN> items
aN | - the number of items to allocate the memory |
Standard_Integer IntPolyh_Array< Type >::NbItems | ( | ) | const [inline] |
NbItems - returns the number of stored items
IntPolyh_Array& IntPolyh_Array< Type >::operator= | ( | const IntPolyh_Array< Type > & | aOther | ) | [inline] |
Assignment operator
aOther | - the array to copy from |
const Type& IntPolyh_Array< Type >::operator[] | ( | const Standard_Integer | aIndex | ) | const [inline] |
query the const value
aIndex | index |
Type& IntPolyh_Array< Type >::operator[] | ( | const Standard_Integer | aIndex | ) | [inline] |
query the value
aIndex | index |
void IntPolyh_Array< Type >::SetNbItems | ( | const Standard_Integer | aNb | ) | [inline] |
set the number of stored items
aNb | the number of stored items |
const Type& IntPolyh_Array< Type >::Value | ( | const Standard_Integer | aIndex | ) | const [inline] |
query the const value
aIndex | index |
Standard_Integer IntPolyh_Array< Type >::myIncrement [protected] |
Standard_Integer IntPolyh_Array< Type >::myNbAllocated [protected] |
Standard_Integer IntPolyh_Array< Type >::myNbItems [protected] |
IntPolyh_VectorOfType IntPolyh_Array< Type >::myVectorOfType [protected] |