StaticArrayInterface< TYPE > Class Template Reference

#include <array.h>

Inheritance diagram for StaticArrayInterface< TYPE >:

Classes

class   IteratorTemplate

Public Types

using  ValueType = TYPE
using  NonConstValueType = typename std::remove_const< TYPE >::type
using  TYPE_FOR_SIZEOF = typename std::conditional< GENERIC , Char , TYPE >::type
using  Iterator = IteratorTemplate < StaticArrayInterface >
using  ConstIterator = IteratorTemplate < const StaticArrayInterface >

公共成员函数

MAXON_METHOD Int   GetCount () const
MAXON_FUNCTION Bool   IsEmpty () const
MAXON_FUNCTION Bool   IsPopulated () const
const MAXON_METHOD TYPE &  operator[] ( Int index) const
MAXON_METHOD ResultRef < TYPE >  GetWritable ( Int index)
template<typename A >
MAXON_FUNCTION ResultMem   Set ( Int index, A &&value)
MAXON_METHOD Int   GetBlock ( Int index, SimdBlock < const TYPE > &block) const
Int   GetBlock ( Int index, StridedBlock < const TYPE > &block) const
Int   GetBlock ( Int index, Block < const TYPE, false > &block) const
MAXON_METHOD Result < Int GetBlock ( Int index, SimdBlock < NonConstValueType > &block)
Int   GetBlock ( Int index, StridedBlock < NonConstValueType > &block)
const MAXON_METHOD DataType GetValueDataType () const
const MAXON_METHOD PersistentIdGenerator &  GetPersistentIdGenerator () const
BlockIterator < StaticArrayInterface , TYPE, true, false >  GetBlocks () const
BlockIterator < StaticArrayInterface , TYPE, true, true >  GetStridedBlocks () const
Int   GetValueSize () const
MAXON_FUNCTION StaticArrayInterface < TYPE >:: ConstIterator   Begin () const
Iterator   Begin ()
MAXON_FUNCTION StaticArrayInterface < TYPE >:: ConstIterator   End () const
Iterator   End ()

Public Attributes

  MAXON_METHOD_RESERVE

静态公共属性

static const Bool   GENERIC

私有成员函数

  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

Member Typedef Documentation

◆  ValueType

using ValueType = TYPE

◆  NonConstValueType

using NonConstValueType = typename std::remove_const<TYPE>::type

◆  TYPE_FOR_SIZEOF

using TYPE_FOR_SIZEOF = typename std::conditional< GENERIC , Char , TYPE>::type

◆  Iterator

using Iterator = IteratorTemplate < StaticArrayInterface >

◆  ConstIterator

using ConstIterator = IteratorTemplate <const StaticArrayInterface >

成员函数文档编制

◆  MAXON_INTERFACE_SIMPLE_VIRTUAL_DERIVED()

MAXON_INTERFACE_SIMPLE_VIRTUAL_DERIVED ( StaticArrayInterface < TYPE >  ,
MAXON_REFERENCE_COPY_ON_WRITE    
)
private

◆  GetCount()

MAXON_METHOD Int GetCount ( ) const

Gets the number of array elements.

返回
Number of array elements.

◆  IsEmpty()

MAXON_FUNCTION Bool IsEmpty ( ) const

@MAXON_ANNOTATION{default=true}

◆  IsPopulated()

MAXON_FUNCTION Bool IsPopulated ( ) const

◆  operator[]()

const MAXON_METHOD TYPE& operator[] ( Int   index ) const

Array (subscript) operator for const objects.

参数
[in] index Element index.
返回
Array element.

◆  GetWritable()

MAXON_METHOD ResultRef <TYPE> GetWritable ( Int   index )

Array (subscript) operator for non-const objects.

参数
[in] index Element index.
返回
Array element.

◆  Set()

MAXON_FUNCTION ResultMem Set ( Int   index ,
A &&  value  
)

◆  GetBlock() [1/5]

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.

参数
[in] index Element index.
[out] block Block which contains the element at index .
返回
Start index of the block. I.e., the requested element can be found within the block at index - start index.

◆  GetBlock() [2/5]

Int GetBlock ( Int   index ,
StridedBlock < const TYPE > &  block  
) const

◆  GetBlock() [3/5]

Int GetBlock ( Int   index ,
Block < const TYPE, false > &  block  
) const

◆  GetBlock() [4/5]

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.

参数
[in] index Element index.
[out] block Block which contains the element at index .
返回
Start index of the block. I.e., the requested element can be found within the block at index - start index. @MAXON_ANNOTATION{cowName=GetWritableBlock}

◆  GetBlock() [5/5]

Int GetBlock ( Int   index ,
StridedBlock < NonConstValueType > &  block  
)

◆  GetValueDataType()

const MAXON_METHOD DataType & GetValueDataType ( ) const

Returns the data type of this array's elements. This may be nullptr if there is no DataType for the template parameter TYPE.

返回
DataType of the elements or nullptr.

◆  GetPersistentIdGenerator()

const MAXON_METHOD PersistentIdGenerator& GetPersistentIdGenerator ( ) const

◆  GetBlocks()

BlockIterator < StaticArrayInterface , TYPE, true, false> GetBlocks ( ) const

◆  GetStridedBlocks()

BlockIterator < StaticArrayInterface , TYPE, true, true> GetStridedBlocks ( ) const

◆  GetValueSize()

Int GetValueSize ( ) const

◆  Begin() [1/2]

MAXON_FUNCTION StaticArrayInterface <TYPE>:: ConstIterator Begin ( ) const

Returns an iterator pointing to the first array element.

返回
Iterator for the first element (equal to End() if the array is empty).

◆  Begin() [2/2]

Iterator Begin ( )

Returns an iterator pointing to the first array element.

返回
Iterator for the first element (equal to End() if the array is empty).

◆  End() [1/2]

MAXON_FUNCTION StaticArrayInterface <TYPE>:: ConstIterator End ( ) const

Returns an iterator pointing one behind the last array element.

返回
Iterator for the array end, this is one behind the last element.

◆  End() [2/2]

Iterator End ( )

Returns an iterator pointing one behind the last array element.

返回
Iterator for the array end, this is one behind the last element.

◆  Alloc()

static StaticArrayInterface * Alloc ( MAXON_SOURCE_LOCATION_DECLARATION   )
static private

Friends And Related Function Documentation

◆  StrongCOWRefHandler

friend class StrongCOWRefHandler
friend

Member Data Documentation

◆  MAXON_METHOD_RESERVE

MAXON_METHOD_RESERVE

◆  GENERIC

const Bool GENERIC static