Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::UniqueArray< T > Class Template Reference

1D data vector with value semantics (STL style). More...

#include <arccore/common/Array.h>

Public Types

typedef AbstractArray< T > BaseClassType
typedef ArrayTraits< T >::ConstReferenceType ConstReferenceType
Public Types inherited from Arcane::Array< T >
typedef AbstractArray< T > BaseClassType
typedef ArrayTraits< T >::ConstReferenceType ConstReferenceType
typedef ArrayIterator< const_pointerconst_iterator
 Type of the constant iterator over an array element.
typedef const value_typeconst_pointer
 Constant pointer type of an array element.
typedef ConstReferenceType const_reference
 Type constant reference of an array element.
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
typedef ptrdiff_t difference_type
 Type of a distance between array element iterators.
typedef ArrayIterator< pointeriterator
 Type of the iterator over an array element.
typedef value_typepointer
 Pointer type of an array element.
typedef value_typereference
 Type reference of an array element.
typedef std::reverse_iterator< iteratorreverse_iterator
typedef Int64 size_type
 Type indexing the array.
typedef T value_type
 Type of the array elements.
Public Types inherited from Arcane::AbstractArray< T >
typedef ArrayTraits< T >::ConstReferenceType ConstReferenceType
typedef ArrayTraits< T >::IsPODType IsPODType
typedef AbstractArray< T > ThatClassType
using TrueImpl = T
typedef T value_type
 Type of the array elements.
typedef value_typepointer
 Pointer type of an array element.
typedef const value_typeconst_pointer
 Constant pointer type of an array element.
typedef ArrayIterator< pointeriterator
 Type of the iterator over an array element.
typedef ArrayIterator< const_pointerconst_iterator
 Type of the constant iterator over an array element.
typedef value_typereference
 Type reference of an array element.
typedef ConstReferenceType const_reference
 Type constant reference of an array element.
typedef Int64 size_type
 Type indexing the array.
typedef ptrdiff_t difference_type
 Type of a distance between array element iterators.
typedef std::reverse_iterator< iteratorreverse_iterator
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator

Public Member Functions

 UniqueArray ()
 Creates an empty array.
 UniqueArray (Int64 req_size, ConstReferenceType value)
 Creates an array of size elements containing the value value.
 UniqueArray (long long asize)
 Creates an array of asize elements containing the default value of type T().
 UniqueArray (long asize)
 Creates an array of asize elements containing the default value of type T().
 UniqueArray (int asize)
 Creates an array of asize elements containing the default value of type T().
 UniqueArray (unsigned long long asize)
 Creates an array of asize elements containing the default value of type T().
 UniqueArray (unsigned long asize)
 Creates an array of asize elements containing the default value of type T().
 UniqueArray (unsigned int asize)
 Creates an array of asize elements containing the default value of type T().
 UniqueArray (const ConstArrayView< T > &aview)
 Creates an array by copying the values from the value aview.
 UniqueArray (const Span< const T > &aview)
 Creates an array by copying the values from the value aview.
 UniqueArray (const ArrayView< T > &aview)
 Creates an array by copying the values from the value aview.
 UniqueArray (const Span< T > &aview)
 Creates an array by copying the values from the value aview.
 UniqueArray (std::initializer_list< T > alist)
 UniqueArray (const Array< T > &rhs)
 Creates an array by copying the values rhs.
 UniqueArray (const UniqueArray< T > &rhs)
 Creates an array by copying the values rhs.
 UniqueArray (const SharedArray< T > &rhs)
 Creates an array by copying the values rhs.
 UniqueArray (UniqueArray< T > &&rhs) ARCCORE_NOEXCEPT
 Move constructor. rhs is invalidated after this call.
 UniqueArray (IMemoryAllocator *allocator)
 Creates an empty array with a specific allocator allocator.
 UniqueArray (MemoryAllocationOptions allocate_options)
 Creates an empty array with a specific allocator allocator.
 UniqueArray (IMemoryAllocator *allocator, Int64 asize)
 Creates an array of asize elements with a specific allocator allocator.
 UniqueArray (MemoryAllocationOptions allocate_options, Int64 asize)
 Creates an array of asize elements with a specific allocator allocator.
 UniqueArray (IMemoryAllocator *allocator, Span< const T > rhs)
 Creates an array with the allocator allocator by copying the values rhs.
 UniqueArray (MemoryAllocationOptions allocate_options, Span< const T > rhs)
 Creates an array with the allocator allocator by copying the values rhs.
void operator= (const Array< T > &rhs)
 Copies the values of rhs into this instance.
void operator= (const SharedArray< T > &rhs)
 Copies the values of rhs into this instance.
void operator= (const UniqueArray< T > &rhs)
 Copies the values of rhs into this instance.
void operator= (UniqueArray< T > &&rhs) ARCCORE_NOEXCEPT
 Move assignment operator. rhs is invalidated after this call.
void operator= (const ArrayView< T > &rhs)
 Copies the values of the view rhs into this instance.
void operator= (const Span< T > &rhs)
 Copies the values of the view rhs into this instance.
void operator= (const SmallSpan< T > &rhs)
 Copies the values of the view rhs into this instance.
void operator= (const ConstArrayView< T > &rhs)
 Copies the values of the view rhs into this instance.
void operator= (const Span< const T > &rhs)
 Copies the values of the view rhs into this instance.
void operator= (const SmallSpan< const T > &rhs)
 Copies the values of the view rhs into this instance.
void operator= (std::initializer_list< T > alist)
 Copies the values of the view alist into this instance.
 ~UniqueArray () override
 Destroys the instance.
void swap (UniqueArray< T > &rhs)
 Swaps the values of the instance with those of rhs.
UniqueArray< T > clone () const
 Clones the array.
Public Member Functions inherited from Arcane::Array< T >
 operator ConstArrayView< T > () const
 operator ArrayView< T > ()
 operator Span< const T > () const
 operator Span< T > ()
ConstArrayView< T > constView () const
 Constant view of this array.
Span< const T > constSpan () const
 Constant view of this array.
ConstArrayView< T > subConstView (Int64 abegin, Int32 asize) const
 Sub-view starting from element abegin and containing asize elements.
ArrayView< T > view () const
 Mutable view of this array.
Span< const T > span () const
 Immutable view of this array.
Span< T > span ()
 Mutable view of this array.
SmallSpan< const T > smallSpan () const
 Immutable view of this array.
SmallSpan< const T > constSmallSpan () const
 Immutable view of this array.
SmallSpan< T > smallSpan ()
 Mutable view of this array.
ArrayView< T > subView (Int64 abegin, Integer asize)
 Sub-view starting from element abegin and containing asize elements.
void sample (ConstArrayView< Integer > indexes, ArrayView< T > result) const
 Extracts a sub-array from a list of indices.
void add (ConstReferenceType val)
 Adds element val to the end of the array.
void addRange (ConstReferenceType val, Int64 n)
 Adds n elements of value val to the end of the array.
void addRange (ConstArrayView< T > val)
 Adds n elements of value val to the end of the array.
void addRange (Span< const T > val)
 Adds n elements of value val to the end of the array.
void addRange (ArrayView< T > val)
 Adds n elements of value val to the end of the array.
void addRange (Span< T > val)
 Adds n elements of value val to the end of the array.
void addRange (const Array< T > &val)
 Adds n elements of value val to the end of the array.
void resize (Int64 s)
 Changes the number of elements in the array to s.
void resize (Int64 s, ConstReferenceType fill_value)
 Changes the number of elements in the array to s.
void resizeNoInit (Int64 s)
 Resizes without initializing new values.
void reserve (Int64 new_capacity)
 Reserves memory for new_capacity elements.
void shrink ()
 Reallocates to free unused memory.
void shrink (Int64 new_capacity)
 Reallocates memory to have a capacity close to new_capacity.
void shrink_to_fit ()
 Reallocates to free unused memory.
void remove (Int64 index)
 Removes the entity at index index.
void popBack ()
 Removes the last entity from the array.
T & at (Int64 i)
 Element at index i. Always checks for overflows.
ConstReferenceType at (Int64 i) const
 Element at index i. Always checks for overflows.
void setAt (Int64 i, ConstReferenceType value)
 Sets the element at index i. Always checks for overflows.
ConstReferenceType item (Int64 i) const
 Element at index i.
void setItem (Int64 i, ConstReferenceType v)
 Element at index i.
ConstReferenceType operator[] (Int64 i) const
 Element at index i.
T & operator[] (Int64 i)
 Element at index i.
ConstReferenceType operator() (Int64 i) const
T & operator() (Int64 i)
 Element at index i.
T & back ()
 Last element of the array.
ConstReferenceType back () const
 Last element of the array (const).
T & front ()
 First element of the array.
ConstReferenceType front () const
 First element of the array (const).
void clear ()
 Removes the elements from the array.
void fill (ConstReferenceType value)
 Fills the array with the value value.
void copy (Span< const T > rhs)
 Copies the values from rhs into the instance.
Array< T > clone () const
 Clones the array.
const T * unguardedBasePointer () const
T * unguardedBasePointer ()
const T * data () const
 Access to the root of the array without any protection.
T * data ()
iterator begin ()
 Iterator over the first element of the array.
const_iterator begin () const
 Constant iterator over the first element of the array.
iterator end ()
 Iterator over the first element after the end of the array.
const_iterator end () const
 Constant iterator over the first element after the end of the array.
reverse_iterator rbegin ()
 Reverse iterator over the first element of the array.
const_reverse_iterator rbegin () const
 Reverse iterator over the first element of the array.
reverse_iterator rend ()
 Reverse iterator over the first element after the end of the array.
const_reverse_iterator rend () const
 Reverse iterator over the first element after the end of the array.
ArrayRange< pointerrange ()
 Iteration range from the first to the last element.
ArrayRange< const_pointerrange () const
 Iteration range from the first to the last element.
void push_back (ConstReferenceType val)
 Adds the element val to the end of the array.
Public Member Functions inherited from Arcane::AbstractArray< T >
 AbstractArray (const AbstractArray< T > &rhs)=delete
AbstractArray< T > & operator= (const AbstractArray< T > &rhs)=delete
void dispose ()
 Frees the memory used by the array.
 operator ConstArrayView< T > () const
 operator Span< const T > () const
 operator SmallSpan< const T > () const
Integer size () const
 Number of elements in the vector.
Integer length () const
 Number of elements in the vector.
Integer capacity () const
 Capacity (number of allocated elements) of the vector.
Int64 largeSize () const
 Number of elements in the vector (in 64 bits).
Int64 largeLength () const
 Number of elements in the vector (in 64 bits).
Int64 largeCapacity () const
 Capacity (number of allocated elements) of the vector (in 64 bits).
bool empty () const
 Capacity (number of allocated elements) of the vector.
bool contains (ConstReferenceType v) const
 True if the array contains the value element v.
ConstReferenceType operator[] (Int64 i) const
 Element at index i.
ConstReferenceType operator() (Int64 i) const
 Element at index i.
void setMemoryLocationHint (eMemoryLocationHint new_hint)
 Modifies the memory location information.
void _internalSetHostDeviceMemoryLocation (eHostDeviceMemoryLocation location)
 Sets the physical location of the memory region.
eHostDeviceMemoryLocation hostDeviceMemoryLocation () const
 Sets the physical location of the memory region.
void changeAllocator (const MemoryAllocationOptions &options, RunQueue *queue)
void changeAllocator (const MemoryAllocationOptions &options)
void printInfos (std::ostream &o)
Public Member Functions inherited from Arcane::AbstractArrayBase
IMemoryAllocatorallocator () const
MemoryAllocationOptions allocationOptions () const
void setDebugName (const String &name)
 Sets the array name for debug information.
String debugName () const
 Debug name (null if no name specified).

Additional Inherited Members

Protected Member Functions inherited from Arcane::Array< T >
 Array (Array< T > &&rhs) ARCCORE_NOEXCEPT
 Move constructor (only for UniqueArray).
void _initFromInitializerList (std::initializer_list< T > alist)
Protected Member Functions inherited from Arcane::AbstractArray< T >
 AbstractArray ()
 Constructs an empty vector with the default allocator.
 AbstractArray (ThatClassType &&rhs) ARCCORE_NOEXCEPT
 Move constructor. Should only be used by UniqueArray.
AllocatedMemoryInfo _currentMemoryInfo () const
void _initFromSpan (const Span< const T > &view)
 Initializes the array with the view view.
void _initFromAllocator (MemoryAllocationOptions o, Int64 acapacity, void *pre_allocated_buffer=nullptr)
 Constructs an empty vector with a specific allocator a.
void _reserve (Int64 new_capacity)
 Reserves memory for new_capacity elements.
void _internalRealloc (Int64 new_capacity, bool compute_capacity, RunQueue *queue=nullptr)
 Reallocates the array for a new capacity equal to new_capacity.
void _internalReallocate (Int64 new_capacity, RunQueue *queue)
void _internalDeallocate (RunQueue *queue=nullptr)
void _internalAllocate (Int64 new_capacity, RunQueue *queue)
void _copyFromMemory (const T *source)
virtual void _updateReferences ()
 Update references.
virtual Integer _getNbRef ()
 Update references.
void _addRange (ConstReferenceType val, Int64 n)
 Adds n elements of value val to the end of the array.
void _addRange (Span< const T > val)
 Adds n elements of value val to the end of the array.
void _checkFreeMemory ()
 Destroys the instance if no one references it.
void _destroy ()
void _destroyRange (Int64, Int64, TrueType)
void _destroyRange (Int64 abegin, Int64 aend, FalseType)
void _createRangeDefault (Int64, Int64, TrueType)
void _createRangeDefault (Int64 abegin, Int64 aend, FalseType)
void _createRange (Int64 abegin, Int64 aend, ConstReferenceType value, TrueType)
void _createRange (Int64 abegin, Int64 aend, ConstReferenceType value, FalseType)
void _createRange (Int64 abegin, Int64 aend, const T *values)
void _fill (ConstReferenceType value)
void _clone (const ThatClassType &orig_array)
template<typename PodType>
void _resizeHelper (Int64 s, PodType pod_type, RunQueue *queue)
void _resize (Int64 s)
void _resizeNoInit (Int64 s, RunQueue *queue=nullptr)
 Redimensionne sans initialiser les nouvelles valeurs.
void _clear ()
void _resize (Int64 s, ConstReferenceType value)
 Redimensionne et remplit les nouvelles valeurs avec value.
void _copy (const T *rhs_begin, TrueType)
void _copy (const T *rhs_begin, FalseType)
void _copy (const T *rhs_begin)
void _resizeAndCopyView (Span< const T > rhs)
 Redimensionne l'instance et recopie les valeurs de rhs.
void _move (ThatClassType &rhs) ARCCORE_NOEXCEPT
 Implements the move assignment operator.
void _swap (ThatClassType &rhs) ARCCORE_NOEXCEPT
 Swaps the values of the instance with those of rhs.
void _shrink ()
void _shrink (Int64 new_capacity)
void _reset ()
 Resets the array to an empty array.
constexpr Integer _clampSizeOffet (Int64 offset, Int32 asize) const
void _assignFromArray (const AbstractArray< T > &rhs)
void _setMP (TrueImpl *new_mp)
void _setMP2 (TrueImpl *new_mp, ArrayMetaData *new_md)
bool _isSharedNull ()
Protected Member Functions inherited from Arcane::AbstractArrayBase
virtual bool _isUseOwnMetaData () const
 Indicates if m_md refers to m_meta_data.
void _swapMetaData (AbstractArrayBase &rhs)
void _copyMetaData (const AbstractArrayBase &rhs)
void _allocateMetaData ()
void _deallocateMetaData (ArrayMetaData *md)
void _checkValidSharedArray ()
Static Protected Member Functions inherited from Arcane::AbstractArray< T >
static constexpr Int64 typeSize ()
Static Protected Member Functions inherited from Arcane::AbstractArrayBase
static constexpr RunQueue_nullRunQueue ()
 Explicit method for a null RunQueue.
Protected Attributes inherited from Arcane::AbstractArray< T >
T * m_ptr = nullptr
Protected Attributes inherited from Arcane::AbstractArrayBase
ArrayMetaDatam_md = nullptr
ArrayMetaData m_meta_data

Detailed Description

template<typename T>
class Arcane::UniqueArray< T >

1D data vector with value semantics (STL style).

This class manages a value array in the same way as the stl::vector class in the STL.

Value semantics work as follows:

a2 = a1; // a2 becomes a copy of a1.
a1[3] = 1;
a2[3] = 2;
std::cout << a1[3]; // prints '1'

It is possible to specify a specific memory allocator via the constructor UniqueArray(IMemoryAllocator*). In this case, the allocator specified as an argument must remain valid as long as this instance is used.

Warning
The allocator is transferred to the destination instance during a call to constructors that take an Array, SharedArray, or UniqueArray as an argument. The same applies to the assignment operator and when calling UniqueArray::swap(). If these calls are considered, it must be guaranteed that the allocator remains valid even after transfer. It is therefore preferable in all cases that the specific allocator used remains valid throughout the application's lifetime.
Note
If the type is a Plain Object Data (POD) type, the data is not initialized upon allocation or reallocation. The template class ArrayTraits allows specifying whether a type is POD based on the value provided by the type ArrayTraits<T>::IsPODType, which can be FalseType or TrueType. The macro ARCCORE_DEFINE_ARRAY_PODTYPE() allows defining such a type. Unless specialized, only C++ base types are POD.
Warning
If ArrayTraits<T>::IsPODType is false, resizing or copying operations always occur on the host. Therefore, the memory returned by the allocator (allocator()) must be accessible on the host.

Definition at line 888 of file arccore/src/common/arccore/common/Array.h.

Member Typedef Documentation

◆ BaseClassType

template<typename T>
typedef AbstractArray<T> Arcane::UniqueArray< T >::BaseClassType

Definition at line 893 of file arccore/src/common/arccore/common/Array.h.

◆ ConstReferenceType

template<typename T>
typedef ArrayTraits<T>::ConstReferenceType Arcane::AbstractArray< T >::ConstReferenceType

Definition at line 174 of file AbstractArray.h.

Constructor & Destructor Documentation

◆ UniqueArray() [1/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( )
inline

Creates an empty array.

Definition at line 899 of file arccore/src/common/arccore/common/Array.h.

Referenced by Arcane::UniqueArray< CaseOptionEnumValue * >::clone().

◆ UniqueArray() [2/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( Int64 req_size,
ConstReferenceType value )
inline

Creates an array of size elements containing the value value.

Definition at line 901 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [3/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( long long asize)
inlineexplicit

Creates an array of asize elements containing the default value of type T().

Definition at line 906 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [4/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( long asize)
inlineexplicit

Creates an array of asize elements containing the default value of type T().

Definition at line 911 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [5/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( int asize)
inlineexplicit

Creates an array of asize elements containing the default value of type T().

Definition at line 915 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [6/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( unsigned long long asize)
inlineexplicit

Creates an array of asize elements containing the default value of type T().

Definition at line 919 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [7/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( unsigned long asize)
inlineexplicit

Creates an array of asize elements containing the default value of type T().

Definition at line 923 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [8/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( unsigned int asize)
inlineexplicit

Creates an array of asize elements containing the default value of type T().

Definition at line 927 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [9/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( const ConstArrayView< T > & aview)
inline

Creates an array by copying the values from the value aview.

Definition at line 932 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [10/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( const Span< const T > & aview)
inline

Creates an array by copying the values from the value aview.

Definition at line 937 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [11/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( const ArrayView< T > & aview)
inline

Creates an array by copying the values from the value aview.

Definition at line 942 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [12/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( const Span< T > & aview)
inline

Creates an array by copying the values from the value aview.

Definition at line 947 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [13/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( std::initializer_list< T > alist)
inline

Definition at line 951 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [14/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( const Array< T > & rhs)
inline

Creates an array by copying the values rhs.

Definition at line 956 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [15/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( const UniqueArray< T > & rhs)
inline

Creates an array by copying the values rhs.

Definition at line 962 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [16/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( const SharedArray< T > & rhs)
inline

Creates an array by copying the values rhs.

Definition at line 969 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [17/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( UniqueArray< T > && rhs)
inline

Move constructor. rhs is invalidated after this call.

Definition at line 974 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [18/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( IMemoryAllocator * allocator)
inlineexplicit

Creates an empty array with a specific allocator allocator.

Definition at line 976 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [19/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( MemoryAllocationOptions allocate_options)
inlineexplicit

Creates an empty array with a specific allocator allocator.

Definition at line 982 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [20/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( IMemoryAllocator * allocator,
Int64 asize )
inline

Creates an array of asize elements with a specific allocator allocator.

If ArrayTraits<T>::IsPODType is TrueType, the elements are not initialized. Otherwise, the default constructor of T is used.

Warning
Initialization occurs on the host, so the memory returned by the allocator must be accessible on the host.

Definition at line 997 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [21/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( MemoryAllocationOptions allocate_options,
Int64 asize )
inline

Creates an array of asize elements with a specific allocator allocator.

If ArrayTraits<T>::IsPODType is TrueType, the elements are not initialized. Otherwise, the default constructor of T is used.

Warning
Initialization occurs on the host, so the memory returned by the allocator must be accessible on the host.

Definition at line 1013 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [22/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( IMemoryAllocator * allocator,
Span< const T > rhs )
inline

Creates an array with the allocator allocator by copying the values rhs.

Warning
The copying occurs on the host, so the memory returned by the allocator must be accessible on the host.

Definition at line 1026 of file arccore/src/common/arccore/common/Array.h.

◆ UniqueArray() [23/23]

template<typename T>
Arcane::UniqueArray< T >::UniqueArray ( MemoryAllocationOptions allocate_options,
Span< const T > rhs )
inline

Creates an array with the allocator allocator by copying the values rhs.

Warning
The copying occurs on the host, so the memory returned by the allocator must be accessible on the host.

Definition at line 1038 of file arccore/src/common/arccore/common/Array.h.

◆ ~UniqueArray()

template<typename T>
Arcane::UniqueArray< T >::~UniqueArray ( )
inlineoverride

Destroys the instance.

Definition at line 1102 of file arccore/src/common/arccore/common/Array.h.

Member Function Documentation

◆ clone()

template<typename T>
UniqueArray< T > Arcane::UniqueArray< T >::clone ( ) const
inline

Clones the array.

Definition at line 1122 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [1/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const Array< T > & rhs)
inline

Copies the values of rhs into this instance.

Definition at line 1045 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [2/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const ArrayView< T > & rhs)
inline

Copies the values of the view rhs into this instance.

Definition at line 1065 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [3/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const ConstArrayView< T > & rhs)
inline

Copies the values of the view rhs into this instance.

Definition at line 1080 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [4/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const SharedArray< T > & rhs)
inline

Copies the values of rhs into this instance.

Definition at line 1050 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [5/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const SmallSpan< const T > & rhs)
inline

Copies the values of the view rhs into this instance.

Definition at line 1090 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [6/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const SmallSpan< T > & rhs)
inline

Copies the values of the view rhs into this instance.

Definition at line 1075 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [7/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const Span< const T > & rhs)
inline

Copies the values of the view rhs into this instance.

Definition at line 1085 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [8/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const Span< T > & rhs)
inline

Copies the values of the view rhs into this instance.

Definition at line 1070 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [9/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( const UniqueArray< T > & rhs)
inline

Copies the values of rhs into this instance.

Definition at line 1055 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [10/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( std::initializer_list< T > alist)
inline

Copies the values of the view alist into this instance.

Definition at line 1095 of file arccore/src/common/arccore/common/Array.h.

◆ operator=() [11/11]

template<typename T>
void Arcane::UniqueArray< T >::operator= ( UniqueArray< T > && rhs)
inline

Move assignment operator. rhs is invalidated after this call.

Definition at line 1060 of file arccore/src/common/arccore/common/Array.h.

◆ swap()

template<typename T>
void Arcane::UniqueArray< T >::swap ( UniqueArray< T > & rhs)
inline

Swaps the values of the instance with those of rhs.

The swap also includes the associated allocator (allocator()) and any debug information.

The swap is performed in constant time and without reallocation.

Definition at line 1116 of file arccore/src/common/arccore/common/Array.h.

Referenced by Arcane::swap().


The documentation for this class was generated from the following file: