#include <array.h>
Classes | |
class | IteratorTemplate |
Public Types | |
using | ValueType = TYPE |
using | NonConstValueType = ValueType |
using | TYPE_FOR_SIZEOF = typename std::conditional< GENERIC, Char, TYPE >::type |
using | Iterator = IteratorTemplate< StaticArrayInterface > |
using | ConstIterator = IteratorTemplate< const StaticArrayInterface > |
Public Attributes | |
MAXON_METHOD_RESERVE | |
Static Public Attributes | |
static const Bool | GENERIC |
Private Member Functions | |
MAXON_INTERFACE_SIMPLE_VIRTUAL_DERIVED (StaticArrayInterface, MAXON_REFERENCE_COPY_ON_WRITE) | |
Static Private Member Functions | |
static StaticArrayInterface * | Alloc (MAXON_SOURCE_LOCATION_DECLARATION) |
Friends | |
class | StrongCOWRefHandler |
using ValueType = TYPE |
using NonConstValueType = ValueType |
using TYPE_FOR_SIZEOF = typename std::conditional<GENERIC, Char, TYPE>::type |
using Iterator = IteratorTemplate<StaticArrayInterface> |
using ConstIterator = IteratorTemplate<const StaticArrayInterface> |
|
private |
MAXON_METHOD const TYPE& operator[] | ( | Int | index | ) | const |
MAXON_METHOD ResultRef<TYPE> GetWritable | ( | Int | index | ) |
MAXON_FUNCTION ResultMem Set | ( | Int | index, |
A && | value | ||
) |
MAXON_METHOD Int GetBlock | ( | Int | index, |
SimdBlock< const TYPE > & | block | ||
) | const |
Determines a contiguous, possibly strided block of array elements which contains the element at index
. The returned blocks are guaranteed to form a partition of the array, i.e., no two blocks overlap, and they cover the whole array.
Using this method can greatly reduce the performance penalty of virtual method invocations of the Array interface as only one such invocation has to happen per block, and a block may consist of a relatively large number of elements which can then be accessed directly.
index
- start index. Int GetBlock | ( | Int | index, |
StridedBlock< const TYPE > & | block | ||
) | const |
MAXON_METHOD Result<Int> GetBlock | ( | Int | index, |
SimdBlock< NonConstValueType > & | block | ||
) |
Determines a contiguous, possibly strided writable block of array elements which contains the element at index
. The returned blocks are guaranteed to form a partition of the array, i.e., no two blocks overlap, and they cover the whole array.
Using this method can greatly reduce the performance penalty of virtual method invocations of the Array interface as only one such invocation has to happen per block, and a block may consist of a relatively large number of elements which can then be accessed directly.
index
- start index. @MAXON_ANNOTATION{cowName=GetWritableBlock} Int GetBlock | ( | Int | index, |
StridedBlock< NonConstValueType > & | block | ||
) |
MAXON_METHOD const DataType& GetValueDataType | ( | ) | const |
MAXON_METHOD const PersistentIdGenerator& GetPersistentIdGenerator | ( | ) | const |
MAXON_METHOD Result<void> MakeAllElementsWritable | ( | Bool | copyElements = true | ) |
Will ensure that all elements of the array are writable for multithreaded access. Besides parallel write use case, MakeAllElementsWritable is not required as GetWritable(Int index) method does all the work. This is useful mostly for paged arrays (GenericContainerInterface::INTERFACES::PAGED_ARRAY).
[in] | copyElements | Clone all the elements. |
MAXON_METHOD Result<void> MakeElementsWritable | ( | Int | start, |
Int | end, | ||
Bool | copyElements = true |
||
) |
Will ensure that all required elements of the array ([start, end]) are writable for multithreaded access. Elements before and after the given range [start, end], will always get copied so that the rest of the target page(s) are still valid after the write operations. I.e. use #copyElements = false when the range will get overwritten without reading current value. Besides parallel write use case, MakeElementsWritable is not required as GetWritable(Int index) method does all the work. This is useful mostly for paged arrays (GenericContainerInterface::INTERFACES::PAGED_ARRAY).
[in] | start | Start index (inclusive). |
[in] | end | End index (exclusive). |
[in] | copyElements | Clone elements of the given range. |
BlockIterator<StaticArrayInterface, TYPE, true, false> GetBlocks | ( | ) | const |
BlockIterator<StaticArrayInterface, TYPE, true, true> GetStridedBlocks | ( | ) | const |
Int GetValueSize | ( | ) | const |
MAXON_ADD_TO_CONST_REFERENCE_CLASS | ( | using | Iterator = typename StaticArrayInterface< TYPE >::ConstIterator;using ConstIterator=typename StaticArrayInterface< TYPE >::ConstIterator; | ) |
MAXON_FUNCTION StaticArrayInterface<TYPE>::ConstIterator Begin | ( | ) | const |
Returns an iterator pointing to the first array element.
Iterator Begin | ( | ) |
Returns an iterator pointing to the first array element.
MAXON_FUNCTION StaticArrayInterface<TYPE>::ConstIterator End | ( | ) | const |
Returns an iterator pointing one behind the last array element.
Iterator End | ( | ) |
Returns an iterator pointing one behind the last array element.
|
staticprivate |
|
friend |
MAXON_METHOD_RESERVE |
|
static |