NonConstArray< TYPE > Class Template Reference

#include <string.h>

Detailed Description

template<typename TYPE>
class maxon::NonConstArray< TYPE >

Helper class for the WritableArrayInterface macro. A WritableArrayInterface& parameter is actually a const NonConstArray& parameter, so temporary objects resulting from a conversion of some array to the NonConstArray interface may be bound to such a parameter (this wouldn't be possible if the parameter was non-const). To be able to invoke modifying functions on such a parameter, those functions are implemented as const functions in this class.

Public Types

using Super = ArrayInterface< TYPE >
 
using ConstIterator = typename Super::Iterator
 

Public Member Functions

const NonConstArrayToArray () const
 
NonConstArrayToArray ()
 
 operator const NonConstArray< typename std::conditional< STD_IS_REPLACEMENT (same, TYPE, Generic)
 
Generic ::type &const TYPE & operator[] (Int index) const
 
Int GetBlock (Int index, Block< TYPE, false > &block) const
 
Int GetBlock (Int index, Block< TYPE, true > &block) const
 
ResultMem Resize (Int count, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::DEFAULT) const
 
ResultMem SetCapacityHint (Int requestedCapacity, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY) const
 
ResultRef< TYPE > Insert (Int index) const
 
ResultMem Insert (Int index, const Block< const TYPE > &values) const
 
ResultMem Insert (Int index, const MoveBlock< TYPE > &values) const
 
ResultRef< TYPE > Append () const
 
ResultRef< TYPE > Append (const TYPE &value) const
 
ResultRef< TYPE > Append (TYPE &&value) const
 
template<typename T >
ResultRef< TYPE > Append (T &&value) const
 
ResultMem Erase (Int index, Int count=1) const
 
ResultMem SwapErase (Int index, Int count=1) const
 
void Reset () const
 
void Flush () const
 
Result< void > CopyFrom (const Super &other) const
 
ConstIterator Begin () const
 
ConstIterator End () const
 
template<typename COLLECTION2 >
Result< void > AppendAll (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY) const
 
template<typename COLLECTION2 >
Result< void > CopyFrom (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE) const
 

Public Attributes

 DummyReturnType
 

Protected Member Functions

 NonConstArray (const typename Super::MTable &vtable)
 
 ~NonConstArray ()
 

Private Member Functions

 MAXON_DISALLOW_COPY_AND_ASSIGN (NonConstArray)
 

Member Typedef Documentation

◆ Super

using Super = ArrayInterface<TYPE>

◆ ConstIterator

using ConstIterator = typename Super::Iterator

Constructor & Destructor Documentation

◆ NonConstArray()

NonConstArray ( const typename Super::MTable &  vtable)
explicitprotected

◆ ~NonConstArray()

~NonConstArray ( )
protected

Member Function Documentation

◆ ToArray() [1/2]

const NonConstArray& ToArray ( ) const

◆ ToArray() [2/2]

NonConstArray& ToArray ( )

◆ operator const NonConstArray< typename std::conditional< STD_IS_REPLACEMENT()

operator const NonConstArray< typename std::conditional< STD_IS_REPLACEMENT ( same  ,
TYPE  ,
Generic   
)

◆ operator[]()

Generic ::type& const TYPE& operator[] ( Int  index) const

◆ GetBlock() [1/2]

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

◆ GetBlock() [2/2]

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

◆ Resize()

ResultMem Resize ( Int  count,
COLLECTION_RESIZE_FLAGS  resizeFlags = COLLECTION_RESIZE_FLAGS::DEFAULT 
) const

◆ SetCapacityHint()

ResultMem SetCapacityHint ( Int  requestedCapacity,
COLLECTION_RESIZE_FLAGS  resizeFlags = COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY 
) const

◆ Insert() [1/3]

ResultRef<TYPE> Insert ( Int  index) const

◆ Insert() [2/3]

ResultMem Insert ( Int  index,
const Block< const TYPE > &  values 
) const

◆ Insert() [3/3]

ResultMem Insert ( Int  index,
const MoveBlock< TYPE > &  values 
) const

◆ Append() [1/4]

ResultRef<TYPE> Append ( ) const

◆ Append() [2/4]

ResultRef<TYPE> Append ( const TYPE &  value) const

◆ Append() [3/4]

ResultRef<TYPE> Append ( TYPE &&  value) const

◆ Append() [4/4]

ResultRef<TYPE> Append ( T &&  value) const

◆ Erase()

ResultMem Erase ( Int  index,
Int  count = 1 
) const

◆ SwapErase()

ResultMem SwapErase ( Int  index,
Int  count = 1 
) const

◆ Reset()

void Reset ( ) const

◆ Flush()

void Flush ( ) const

◆ CopyFrom() [1/2]

Result<void> CopyFrom ( const Super other) const

◆ Begin()

ConstIterator Begin ( ) const

◆ End()

ConstIterator End ( ) const

◆ AppendAll()

Result<void> AppendAll ( COLLECTION2 &&  other,
COLLECTION_RESIZE_FLAGS  resizeFlags = COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY 
) const

◆ CopyFrom() [2/2]

Result<void> CopyFrom ( COLLECTION2 &&  other,
COLLECTION_RESIZE_FLAGS  resizeFlags = COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE 
) const

◆ MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( NonConstArray< TYPE >  )
private

Member Data Documentation

◆ DummyReturnType

DummyReturnType