Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::MutableMemoryView Class Reference

Mutable view on a contiguous memory region containing fixed-size elements. More...

#include <arccore/base/MemoryView.h>

Public Types

using SpanType = Span<std::byte>

Public Member Functions

constexpr MutableMemoryView (SpanType bytes)
template<typename DataType>
constexpr MutableMemoryView (Span< DataType > v)
template<typename DataType>
constexpr MutableMemoryView (ArrayView< DataType > v)
template<typename DataType>
constexpr MutableMemoryView (ArrayView< DataType > v, Int32 nb_component)
template<typename DataType>
constexpr MutableMemoryView (Span< DataType > v, Int32 nb_component)
template<typename DataType>
constexpr MutableMemoryView & operator= (Span< DataType > v)
constexpr operator ConstMemoryView () const
constexpr SpanType bytes () const
 View in byte form.
constexpr std::byte * data () const
 Pointer to the memory region.
constexpr Int64 nbElement () const
 Number of elements.
constexpr Int32 datatypeSize () const
 Size of the associated data type (1 by default).
constexpr MutableMemoryView subView (Int64 begin_index, Int64 nb_element) const
 Sub-view starting from index begin_index.
constexpr SpanType span () const
constexpr Int64 size () const

Friends

MutableMemoryView makeMutableMemoryView (void *ptr, Int32 datatype_size, Int64 nb_element)
 Creates a mutable memory view.

Detailed Description

Mutable view on a contiguous memory region containing fixed-size elements.

The makeMutableMemoryView() functions allow creating instances of this class.

Warning
API is currently under definition. Do not use outside of Arcane.

Definition at line 157 of file arccore/src/base/arccore/base/MemoryView.h.

Member Typedef Documentation

◆ SpanType

using Arcane::MutableMemoryView::SpanType = Span<std::byte>

Definition at line 164 of file arccore/src/base/arccore/base/MemoryView.h.

Constructor & Destructor Documentation

◆ MutableMemoryView() [1/5]

Arcane::MutableMemoryView::MutableMemoryView ( SpanType bytes)
inlineexplicitconstexpr

Definition at line 169 of file arccore/src/base/arccore/base/MemoryView.h.

◆ MutableMemoryView() [2/5]

template<typename DataType>
Arcane::MutableMemoryView::MutableMemoryView ( Span< DataType > v)
inlineexplicitconstexpr

Definition at line 174 of file arccore/src/base/arccore/base/MemoryView.h.

◆ MutableMemoryView() [3/5]

template<typename DataType>
Arcane::MutableMemoryView::MutableMemoryView ( ArrayView< DataType > v)
inlineexplicitconstexpr

Definition at line 177 of file arccore/src/base/arccore/base/MemoryView.h.

◆ MutableMemoryView() [4/5]

template<typename DataType>
Arcane::MutableMemoryView::MutableMemoryView ( ArrayView< DataType > v,
Int32 nb_component )
inlineexplicitconstexpr

Definition at line 180 of file arccore/src/base/arccore/base/MemoryView.h.

◆ MutableMemoryView() [5/5]

template<typename DataType>
Arcane::MutableMemoryView::MutableMemoryView ( Span< DataType > v,
Int32 nb_component )
inlineconstexpr

Definition at line 183 of file arccore/src/base/arccore/base/MemoryView.h.

Member Function Documentation

◆ bytes()

◆ data()

std::byte * Arcane::MutableMemoryView::data ( ) const
inlineconstexpr

Pointer to the memory region.

Definition at line 220 of file arccore/src/base/arccore/base/MemoryView.h.

◆ datatypeSize()

Int32 Arcane::MutableMemoryView::datatypeSize ( ) const
inlineconstexpr

◆ nbElement()

Int64 Arcane::MutableMemoryView::nbElement ( ) const
inlineconstexpr

Number of elements.

Definition at line 223 of file arccore/src/base/arccore/base/MemoryView.h.

◆ operator ConstMemoryView()

Arcane::MutableMemoryView::operator ConstMemoryView ( ) const
inlineconstexpr

Definition at line 212 of file arccore/src/base/arccore/base/MemoryView.h.

◆ operator=()

template<typename DataType>
MutableMemoryView & Arcane::MutableMemoryView::operator= ( Span< DataType > v)
inlineconstexpr

Definition at line 194 of file arccore/src/base/arccore/base/MemoryView.h.

◆ size()

Int64 Arcane::MutableMemoryView::size ( ) const
inlineconstexpr

Definition at line 242 of file arccore/src/base/arccore/base/MemoryView.h.

◆ span()

SpanType Arcane::MutableMemoryView::span ( ) const
inlineconstexpr

Definition at line 239 of file arccore/src/base/arccore/base/MemoryView.h.

◆ subView()

MutableMemoryView Arcane::MutableMemoryView::subView ( Int64 begin_index,
Int64 nb_element ) const
inlineconstexpr

Sub-view starting from index begin_index.

Definition at line 229 of file arccore/src/base/arccore/base/MemoryView.h.

◆ makeMutableMemoryView

MutableMemoryView makeMutableMemoryView ( void * ptr,
Int32 datatype_size,
Int64 nb_element )
friend

Creates a mutable memory view.

Parameters
ptraddress of the memory region.
datatype_sizesize (in bytes) of the data type.
nb_elementnumber of elements in the view.

The memory region will have a size of datatype_size * nb_element bytes.

Definition at line 26 of file MemoryView.cc.

References bytes().


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