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

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

#include <arccore/base/MemoryView.h>

Public Types

using SpanType = Span<const std::byte>

Public Member Functions

constexpr ConstMemoryView (Span< const std::byte > bytes)
template<typename DataType>
constexpr ConstMemoryView (Span< DataType > v)
template<typename DataType>
constexpr ConstMemoryView (Span< const DataType > v)
template<typename DataType>
constexpr ConstMemoryView (ConstArrayView< DataType > v)
template<typename DataType>
constexpr ConstMemoryView (ArrayView< DataType > v)
template<typename DataType>
constexpr ConstMemoryView (ConstArrayView< DataType > v, Int32 nb_component)
template<typename DataType>
constexpr ConstMemoryView (ArrayView< DataType > v, Int32 nb_component)
template<typename DataType>
constexpr ConstMemoryView (Span< DataType > v, Int32 nb_component)
template<typename DataType>
constexpr ConstMemoryView (Span< const DataType > v, Int32 nb_component)
template<typename DataType>
constexpr ConstMemoryView & operator= (Span< DataType > v)
constexpr SpanType bytes () const
 View in byte form.
constexpr const 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 ConstMemoryView subView (Int64 begin_index, Int64 nb_element) const
 Sub-view starting from index begin_index and containing nb_element.
SpanType span () const
 View converted to a Span.
constexpr Int64 size () const

Public Attributes

friend MutableMemoryView

Friends

ConstMemoryView makeConstMemoryView (const void *ptr, Int32 datatype_size, Int64 nb_element)
 Creates a read-only memory view.

Detailed Description

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

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

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

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

Member Typedef Documentation

◆ SpanType

using Arcane::ConstMemoryView::SpanType = Span<const std::byte>

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

Constructor & Destructor Documentation

◆ ConstMemoryView() [1/9]

Arcane::ConstMemoryView::ConstMemoryView ( Span< const std::byte > bytes)
inlineexplicitconstexpr

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

◆ ConstMemoryView() [2/9]

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

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

◆ ConstMemoryView() [3/9]

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

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

◆ ConstMemoryView() [4/9]

template<typename DataType>
Arcane::ConstMemoryView::ConstMemoryView ( ConstArrayView< DataType > v)
inlineexplicitconstexpr

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

◆ ConstMemoryView() [5/9]

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

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

◆ ConstMemoryView() [6/9]

template<typename DataType>
Arcane::ConstMemoryView::ConstMemoryView ( ConstArrayView< DataType > v,
Int32 nb_component )
inlineconstexpr

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

◆ ConstMemoryView() [7/9]

template<typename DataType>
Arcane::ConstMemoryView::ConstMemoryView ( ArrayView< DataType > v,
Int32 nb_component )
inlineconstexpr

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

◆ ConstMemoryView() [8/9]

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

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

◆ ConstMemoryView() [9/9]

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

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

Member Function Documentation

◆ bytes()

◆ data()

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

Pointer to the memory region.

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

◆ datatypeSize()

◆ nbElement()

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

Number of elements.

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

◆ operator=()

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

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

◆ size()

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

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

◆ span()

SpanType Arcane::ConstMemoryView::span ( ) const
inline

View converted to a Span.

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

References span().

Referenced by span().

◆ subView()

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

Sub-view starting from index begin_index and containing nb_element.

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

◆ makeConstMemoryView

ConstMemoryView makeConstMemoryView ( const void * ptr,
Int32 datatype_size,
Int64 nb_element )
friend

Creates a read-only 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 36 of file MemoryView.cc.

References bytes().

Member Data Documentation

◆ MutableMemoryView

friend Arcane::ConstMemoryView::MutableMemoryView

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


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