Shared 2D data vector with reference semantics. More...
#include <arccore/collections/Array2.h>
Public Types | |
| typedef SharedArray2< T > | ThatClassType |
| typedef AbstractArray< T > | BaseClassType |
| typedef BaseClassType::ConstReferenceType | ConstReferenceType |
Public Member Functions | |
| SharedArray2 ()=default | |
| Creates an empty array. | |
| SharedArray2 (Int64 size1, Int64 size2) | |
| Creates an array of size1 * size2 elements. | |
| SharedArray2 (const ConstArray2View< T > &view) | |
| Creates an array by copying the values from the view. | |
| SharedArray2 (const Span2< const T > &view) | |
| Creates an array by copying the values from the view. | |
| SharedArray2 (const SharedArray2< T > &rhs) | |
| Creates an array referencing rhs. | |
| SharedArray2 (const UniqueArray2< T > &rhs) | |
| Creates an array by copying the values of rhs. | |
| void | operator= (const SharedArray2< T > &rhs) |
| Changes the reference of this instance to that of rhs. | |
| void | operator= (const UniqueArray2< T > &rhs) |
| Copies the values of rhs into this instance. | |
| void | operator= (const ConstArray2View< T > &rhs) |
| Copies the values of the view rhs into this instance. | |
| void | operator= (const Span2< const T > &rhs) |
| Copies the values of the view rhs into this instance. | |
| ~SharedArray2 () override | |
| Destroys the instance. | |
| SharedArray2< T > | clone () const |
| Clones the array. | |
| Public Member Functions inherited from Arcane::Array2< T > | |
| ArrayView< T > | operator[] (Int64 i) |
| ConstArrayView< T > | operator[] (Int64 i) const |
| ArrayView< T > | operator() (Int64 i) |
| ConstArrayView< T > | operator() (Int64 i) const |
| T & | operator() (Int64 i, Int64 j) |
| ConstReferenceType | operator() (Int64 i, Int64 j) const |
| T | item (Int64 i, Int64 j) |
| void | setItem (Int64 i, Int64 j, ConstReferenceType v) |
| ConstArrayView< T > | at (Int64 i) const |
| Element at index i. Always checks for bounds. | |
| ArrayView< T > | at (Int64 i) |
| Element at index i. Always checks for bounds. | |
| T | at (Int64 i, Int64 j) |
| void | fill (ConstReferenceType v) |
| void | clear () |
| Array2< T > | clone () |
| void | copy (Span2< const T > rhs) |
| Resizes the instance based on the dimensions of rhs and copies the values of rhs into it. | |
| Integer | capacity () const |
| Capacity (number of allocated elements) of the array. | |
| Int64 | largeCapacity () const |
| Capacity (number of allocated elements) of the array. | |
| void | reserve (Int64 new_capacity) |
| Reserves memory for new_capacity elements. | |
| void | shrink () |
| void | shrink (Int64 new_capacity) |
| Reallocates memory to have a capacity close to new_capacity. | |
| void | shrink_to_fit () |
| ArrayView< T > | viewAsArray () |
| View of the array as a 1D array. | |
| ConstArrayView< T > | viewAsArray () const |
| View of the array as a 1D array. | |
| Span< T > | to1DSpan () |
| View of the array as a 1D array. | |
| Span< const T > | to1DSpan () const |
| View of the array as a 1D array. | |
| operator Array2View< T > () | |
| operator ConstArray2View< T > () const | |
| operator Span2< const T > () const | |
| operator Span2< T > () | |
| Array2View< T > | view () |
| ConstArray2View< T > | constView () const |
| Span2< T > | span () |
| Span2< const T > | constSpan () const |
| Integer | dim2Size () const |
| Integer | dim1Size () const |
| Int64 | largeDim2Size () const |
| Int64 | largeDim1Size () const |
| void | add (const T &value) |
| void | resize (Int64 new_size) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | resizeNoInit (Int64 new_size) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | resize (Int64 new_size1, Int64 new_size2) |
| Reallocates both dimensions. | |
| void | resizeNoInit (Int64 new_size1, Int64 new_size2) |
| Reallocates both dimensions. | |
| Integer | totalNbElement () const |
| Total number of elements (dim1Size()*dim2Size()). | |
| Int64 | largeTotalNbElement () const |
| Total number of elements (largeDim1Size()*largeDim2Size()). | |
| MemoryAllocationOptions | allocationOptions () const |
| String | debugName () const |
| Debug name (null if no name specified). | |
| void | setDebugName (const String &name) |
| Sets the array name for debug information. | |
| ArrayView< T > | operator[] (Int64 i) |
| ConstArrayView< T > | operator[] (Int64 i) const |
| ArrayView< T > | operator() (Int64 i) |
| ConstArrayView< T > | operator() (Int64 i) const |
| T & | operator() (Int64 i, Int64 j) |
| ConstReferenceType | operator() (Int64 i, Int64 j) const |
| T | item (Int64 i, Int64 j) |
| void | setItem (Int64 i, Int64 j, ConstReferenceType v) |
| ConstArrayView< T > | at (Int64 i) const |
| Element at index i. Always checks for bounds. | |
| ArrayView< T > | at (Int64 i) |
| Element at index i. Always checks for bounds. | |
| T | at (Int64 i, Int64 j) |
| void | fill (ConstReferenceType v) |
| void | clear () |
| Array2< T > | clone () |
| void | copy (Span2< const T > rhs) |
| Resizes the instance based on the dimensions of rhs and copies the values of rhs into it. | |
| Integer | capacity () const |
| Capacity (number of allocated elements) of the array. | |
| Int64 | largeCapacity () const |
| Capacity (number of allocated elements) of the array. | |
| void | reserve (Int64 new_capacity) |
| Reserves memory for new_capacity elements. | |
| void | shrink () |
| void | shrink (Int64 new_capacity) |
| Reallocates memory to have a capacity close to new_capacity. | |
| void | shrink_to_fit () |
| ArrayView< T > | viewAsArray () |
| View of the array as a 1D array. | |
| ConstArrayView< T > | viewAsArray () const |
| View of the array as a 1D array. | |
| Span< T > | to1DSpan () |
| View of the array as a 1D array. | |
| Span< const T > | to1DSpan () const |
| View of the array as a 1D array. | |
| operator Array2View< T > () | |
| operator ConstArray2View< T > () const | |
| operator Span2< const T > () const | |
| operator Span2< T > () | |
| Array2View< T > | view () |
| ConstArray2View< T > | constView () const |
| Span2< T > | span () |
| Span2< const T > | constSpan () const |
| Integer | dim2Size () const |
| Integer | dim1Size () const |
| Int64 | largeDim2Size () const |
| Int64 | largeDim1Size () const |
| void | add (const T &value) |
| void | resize (Int64 new_size) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | resize (Int64 new_size1, Int64 new_size2) |
| Reallocates both dimensions. | |
| void | resizeNoInit (Int64 new_size) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | resizeNoInit (Int64 new_size1, Int64 new_size2) |
| Reallocates both dimensions. | |
| Integer | totalNbElement () const |
| Total number of elements (dim1Size()*dim2Size()). | |
| Int64 | largeTotalNbElement () const |
| Total number of elements (largeDim1Size()*largeDim2Size()). | |
| MemoryAllocationOptions | allocationOptions () const |
| String | debugName () const |
| Debug name (null if no name specified). | |
| void | setDebugName (const String &name) |
| Sets the array name for debug information. | |
| operator Array2View< T > () | |
| operator ConstArray2View< T > () const | |
| operator Span2< const T > () const | |
| operator Span2< T > () | |
| operator Array2View< T > () | |
| operator ConstArray2View< T > () const | |
| operator Span2< const T > () const | |
| operator Span2< T > () | |
Protected Member Functions | |
| void | _initReference (const ThatClassType &rhs) |
| void | _updateReferences () override final |
| Updates references. | |
| Integer | _getNbRef () override final |
| Updates references. | |
| bool | _isUseOwnMetaData () const final |
| Indicates if m_md refers to m_meta_data. | |
| void | _addReference (const ThatClassType *new_ref) |
| Inserts this instance into the linked list. The instance is inserted at the position of new_ref. | |
| void | _removeReference () |
| Removes this instance from the reference linked list. | |
| void | _checkFreeMemory () |
| Destroys the instance if no one references it anymore. | |
| void | _operatorEqual (const ThatClassType &rhs) |
| Protected Member Functions inherited from Arcane::Array2< T > | |
| Array2 (Int64 size1, Int64 size2) | |
| Creates an array of size1 * size2 elements. | |
| Array2 (ConstArray2View< T > rhs) | |
| Array2 (const Span2< const T > &rhs) | |
| Array2 (IMemoryAllocator *allocator) | |
| Creates an empty array with a specific allocator allocator. | |
| Array2 (IMemoryAllocator *allocator, Int64 size1, Int64 size2) | |
| Creates an array of size1 * size2 elements with a specific allocator allocator. | |
| Array2 (Array2< T > &&rhs) | |
| Move constructor. Only valid for UniqueArray2. | |
| void | _resize (Int64 new_size, InitBehaviour rb) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | _resize (Int64 new_size1, Int64 new_size2, InitBehaviour rb) |
| Reallocates both dimensions. | |
| void | _resizeFromEmpty (Int64 new_size1, Int64 new_size2, InitBehaviour rb) |
| void | _resizeSameDim1ReduceDim2 (Int64 new_size2, InitBehaviour rb) |
| void | _resizeSameDim1IncreaseDim2 (Int64 new_size2, InitBehaviour rb) |
| void | _resize2 (Int64 d1, Int64 d2, InitBehaviour rb) |
| void | _move (Array2< T > &rhs) |
| void | _swap (Array2< T > &rhs) |
| void | _assignFromArray2 (const Array2< T > &rhs) |
| void | _resizeAndCopyView (Span2< const T > rhs) |
| void | _copyMetaData (const Array2< T > &rhs) |
| void | _destroy () |
| void | _initFromAllocator (MemoryAllocationOptions o, Int64 acapacity, void *pre_allocated_buffer=nullptr) |
| Constructs an empty vector with a specific allocator a. | |
| void | _internalDeallocate (RunQueue *queue=nullptr) |
| void | _setMP (TrueImpl *new_mp) |
| void | _setMP2 (TrueImpl *new_mp, ArrayMetaData *new_md) |
| Array2 (Int64 size1, Int64 size2) | |
| Creates an array of size1 * size2 elements. | |
| Array2 (ConstArray2View< T > rhs) | |
| Array2 (const Span2< const T > &rhs) | |
| Array2 (IMemoryAllocator *allocator) | |
| Creates an empty array with a specific allocator allocator. | |
| Array2 (IMemoryAllocator *allocator, Int64 size1, Int64 size2) | |
| Creates an array of size1 * size2 elements with a specific allocator allocator. | |
| Array2 (Array2< T > &&rhs) | |
| Move constructor. Only valid for UniqueArray2. | |
| void | _resize (Int64 new_size, InitBehaviour rb) |
| Resizes only the first dimension, leaving the second dimension unchanged. | |
| void | _resize (Int64 new_size1, Int64 new_size2, InitBehaviour rb) |
| Reallocates both dimensions. | |
| void | _resizeFromEmpty (Int64 new_size1, Int64 new_size2, InitBehaviour rb) |
| void | _resizeSameDim1ReduceDim2 (Int64 new_size2, InitBehaviour rb) |
| void | _resizeSameDim1IncreaseDim2 (Int64 new_size2, InitBehaviour rb) |
| void | _resize2 (Int64 d1, Int64 d2, InitBehaviour rb) |
| void | _move (Array2< T > &rhs) |
| void | _swap (Array2< T > &rhs) |
| void | _assignFromArray2 (const Array2< T > &rhs) |
| void | _resizeAndCopyView (Span2< const T > rhs) |
| void | _copyMetaData (const Array2< T > &rhs) |
| void | _destroy () |
| void | _initFromAllocator (MemoryAllocationOptions o, Int64 acapacity, void *pre_allocated_buffer=nullptr) |
| Constructs an empty vector with a specific allocator a. | |
| void | _internalDeallocate (RunQueue *queue=nullptr) |
| void | _setMP (TrueImpl *new_mp) |
| void | _setMP2 (TrueImpl *new_mp, ArrayMetaData *new_md) |
Additional Inherited Members | |
| Protected Types inherited from Arcane::Array2< T > | |
| enum | CloneBehaviour |
| enum | InitBehaviour |
| Protected Attributes inherited from Arcane::Array2< T > | |
| T * | m_ptr |
| T * | m_ptr |
Shared 2D data vector with reference semantics.
In the previous example, a1 and a2 refer to the same memory area, so a1[3][6] will have the same value as a2[1][2].
To have a vector that copies elements upon assignment, you must use the UniqueArray2 class.
For more information, refer to SharedArray.
Definition at line 551 of file arccore/src/collections/arccore/collections/Array2.h.
| typedef AbstractArray<T> Arcane::SharedArray2< T >::BaseClassType |
Definition at line 562 of file arccore/src/collections/arccore/collections/Array2.h.
| typedef BaseClassType::ConstReferenceType Arcane::SharedArray2< T >::ConstReferenceType |
Definition at line 563 of file arccore/src/collections/arccore/collections/Array2.h.
| typedef SharedArray2<T> Arcane::SharedArray2< T >::ThatClassType |
Definition at line 561 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Creates an array of size1 * size2 elements.
Definition at line 570 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Creates an array by copying the values from the view.
Definition at line 576 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Creates an array by copying the values from the view.
Definition at line 582 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Creates an array referencing rhs.
Definition at line 588 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Creates an array by copying the values of rhs.
Definition at line 861 of file arccore/src/collections/arccore/collections/Array2.h.
References Arcane::Array2< T >::copy().
|
inlineoverride |
Destroys the instance.
Definition at line 617 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Inserts this instance into the linked list. The instance is inserted at the position of new_ref.
Definition at line 667 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Destroys the instance if no one references it anymore.
Definition at line 686 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlinefinaloverrideprotectedvirtual |
Updates references.
Reimplemented from Arcane::AbstractArray< T >.
Definition at line 648 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 632 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlinefinalprotectedvirtual |
Indicates if m_md refers to m_meta_data.
This is the case for UniqueArray and UniqueArray2 but not for SharedArray and SharedArray2.
Reimplemented from Arcane::AbstractArrayBase.
Definition at line 657 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Definition at line 693 of file arccore/src/collections/arccore/collections/Array2.h.
|
inlineprotected |
Removes this instance from the reference linked list.
Definition at line 678 of file arccore/src/collections/arccore/collections/Array2.h.
Referenced by Arcane::SharedArray2< Pointer >::~SharedArray2().
|
inlinefinaloverrideprotectedvirtual |
Updates references.
Reimplemented from Arcane::AbstractArray< T >.
Definition at line 640 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Clones the array.
Definition at line 625 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Copies the values of the view rhs into this instance.
Definition at line 605 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Changes the reference of this instance to that of rhs.
Definition at line 597 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Copies the values of the view rhs into this instance.
Definition at line 611 of file arccore/src/collections/arccore/collections/Array2.h.
|
inline |
Copies the values of rhs into this instance.
Definition at line 871 of file arccore/src/collections/arccore/collections/Array2.h.
References Arcane::Array2< T >::copy().