Open CASCADE Technology 7.8.0
|
The class NCollection_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. More...
#include <NCollection_Array1.hxx>
Public Types | |
typedef NCollection_Allocator< TheItemType > | allocator_type |
Memory allocation. | |
using | value_type = TheItemType |
using | size_type = size_t |
using | difference_type = size_t |
using | pointer = TheItemType * |
using | const_pointer = const TheItemType * |
using | reference = TheItemType & |
using | const_reference = const TheItemType & |
using | iterator = NCollection_IndexedIterator< std::random_access_iterator_tag, NCollection_Array1, value_type, false > |
using | const_iterator = NCollection_IndexedIterator< std::random_access_iterator_tag, NCollection_Array1, value_type, true > |
using | Iterator = NCollection_Iterator< NCollection_Array1< TheItemType > > |
Data Fields | |
friend | iterator |
friend | const_iterator |
Protected Member Functions | |
const_reference | at (const size_t theIndex) const |
reference | at (const size_t theIndex) |
template<typename U = TheItemType> | |
std::enable_if< std::is_arithmetic< U >::value, void >::type | construct () |
template<typename U = TheItemType> | |
std::enable_if<!std::is_arithmetic< U >::value, void >::type | construct () |
template<typename U = TheItemType> | |
std::enable_if< std::is_arithmetic< U >::value, void >::type | construct (const size_t, const size_t) |
template<typename U = TheItemType> | |
std::enable_if<!std::is_arithmetic< U >::value, void >::type | construct (const size_t theFrom, const size_t theTo) |
template<typename U = TheItemType> | |
std::enable_if< std::is_arithmetic< U >::value, void >::type | destroy () |
template<typename U = TheItemType> | |
std::enable_if<!std::is_arithmetic< U >::value, void >::type | destroy () |
template<typename U = TheItemType> | |
std::enable_if< std::is_arithmetic< U >::value, void >::type | destroy (pointer, const size_t, const size_t) |
template<typename U = TheItemType> | |
std::enable_if<!std::is_arithmetic< U >::value, void >::type | destroy (pointer theWhat, const size_t theFrom, const size_t theTo) |
void | copyConstruct (const pointer theFrom, const size_t theCount) |
Protected Attributes | |
Standard_Integer | myLowerBound |
size_t | mySize |
pointer | myPointer = nullptr |
bool | myIsOwner = false |
allocator_type | myAllocator |
The class NCollection_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:
If you want to reindex an array from 1 to Length do:
Warning: Programs client of such a class must be independent of the range of the first element. Then, a C++ for loop must be written like this
typedef NCollection_Allocator<TheItemType> NCollection_Array1< TheItemType >::allocator_type |
Memory allocation.
using NCollection_Array1< TheItemType >::const_iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_Array1, value_type, true> |
using NCollection_Array1< TheItemType >::const_pointer = const TheItemType* |
using NCollection_Array1< TheItemType >::const_reference = const TheItemType& |
using NCollection_Array1< TheItemType >::difference_type = size_t |
using NCollection_Array1< TheItemType >::iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_Array1, value_type, false> |
using NCollection_Array1< TheItemType >::Iterator = NCollection_Iterator<NCollection_Array1<TheItemType> > |
using NCollection_Array1< TheItemType >::pointer = TheItemType* |
using NCollection_Array1< TheItemType >::reference = TheItemType& |
using NCollection_Array1< TheItemType >::size_type = size_t |
using NCollection_Array1< TheItemType >::value_type = TheItemType |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
Copy constructor.
|
inlinenoexcept |
Move constructor.
|
inlinevirtual |
|
inline |
Copies data of theOther array to this. This array should be pre-allocated and have the same length as theOther; otherwise exception Standard_DimensionMismatch is thrown.
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Variable value access.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
Initialise the items with theValue.
|
inline |
|
inline |
Return TRUE if array has zero length.
|
inline |
|
inline |
Length query (the same)
|
inline |
Lower bound.
|
inlinenoexcept |
Move assignment. This array will borrow all the data from theOther. The moved object will keep pointer to the memory buffer and range, but it will not free the buffer on destruction.
|
inline |
|
inline |
operator() - alias to ChangeValue
|
inline |
operator() - alias to Value
|
inline |
Assignment operator;.
|
inlinenoexcept |
Move assignment operator;.
|
inline |
operator[] - alias to ChangeValue
|
inline |
operator[] - alias to Value
|
inline |
Resizes the array to specified bounds. No re-allocation will be done if length of array does not change, but existing values will not be discarded if theToCopyData set to FALSE.
theLower | new lower bound of array |
theUpper | new upper bound of array |
theToCopyData | flag to copy existing data into new array |
|
inline |
Set value.
|
inline |
Set value.
|
inline |
Size query.
|
inline |
Changes the lowest bound. Do not move data.
|
inline |
Changes the upper bound. Do not move data.
|
inline |
Upper bound.
|
inline |
Constant value access.
friend NCollection_Array1< TheItemType >::const_iterator |
friend NCollection_Array1< TheItemType >::iterator |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |