Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Span.h File Reference

Types and functions associated with the classes SpanImpl, SmallSpan and Span. More...

#include "arccore/base/ArrayView.h"
#include <type_traits>
#include <optional>
Include dependency graph for Span.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Arcane::Impl::ViewTypeT< T >
class  Arcane::Impl::ViewTypeT< const T >
class  Arcane::Impl::SpanTypeFromSize< T, Int32 >
class  Arcane::Impl::SpanTypeFromSize< T, Int64 >
class  Arcane::Impl::DynamicExtentStorage< SizeType >
 Class to store the size of a SpanImpl. More...
class  Arcane::Impl::ExtentStorageBase
class  Arcane::Impl::ExtentStorage< SizeType, FixedExtent >
 Specialization for the compile-time known number of elements. More...
class  Arcane::Impl::ExtentStorage< Int32, DynExtent >
 Specialization for the dynamic number of elements. More...
class  Arcane::Impl::ExtentStorage< Int64, DynExtent >
 Specialization for the dynamic number of elements. More...
class  Arcane::SpanImpl< T, SizeType, Extent >
 View of an array of elements of type T. More...
class  Arcane::Span< T, Extent >
 View of an array of elements of type T. More...
class  Arcane::SmallSpan< T, Extent >
 View of an array of elements of type T. More...

Namespaces

namespace  Arcane
 -- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
namespace  Arccore
 Namespace of Arccore.

Functions

template<typename T, typename SizeType>
void Arcane::dumpArray (std::ostream &o, SpanImpl< const T, SizeType > val, int max_print)
 Prints the values of the array val to the stream o.
template<typename DataType, typename IntegerType, typename SizeType>
void Arcane::_sampleSpan (SpanImpl< const DataType, SizeType > values, SpanImpl< const IntegerType, SizeType > indexes, SpanImpl< DataType, SizeType > result)
 Extracts a sub-array from a list of indices.
template<typename DataType>
void Arcane::sampleSpan (Span< const DataType > values, Span< const Int64 > indexes, Span< DataType > result)
 Extracts a sub-array from a list of indices.
template<typename DataType>
void Arcane::sampleSpan (Span< const DataType > values, Span< const Int32 > indexes, Span< DataType > result)
 Extracts a sub-array from a list of indices.
template<typename DataType, typename SizeType, SizeType Extent>
Impl::SpanTypeFromSize< conststd::byte, SizeType >::SpanType Arcane::asBytes (const SpanImpl< DataType, SizeType, Extent > &s)
 Converts the view into an array of non-modifiable bytes.
template<typename DataType>
SmallSpan< const std::byte > Arcane::asBytes (const ArrayView< DataType > &s)
 Converts the view into an array of non-modifiable bytes.
template<typename DataType>
SmallSpan< const std::byte > Arcane::asBytes (const ConstArrayView< DataType > &s)
 Converts the view into an array of non-modifiable bytes.
template<typename DataType, typename SizeType, SizeType Extent, typename std::enable_if_t<!std::is_const< DataType >::value, int > = 0>
Impl::SpanTypeFromSize< std::byte, SizeType >::SpanType Arcane::asWritableBytes (const SpanImpl< DataType, SizeType, Extent > &s)
 Converts the view into an array of modifiable bytes.
template<typename DataType>
SmallSpan< std::byte > Arcane::asWritableBytes (const ArrayView< DataType > &s)
 Converts the view into an array of modifiable bytes.
template<typename ByteType, typename DataType, Int64 Extent>
Span< DataType > Arcane::impl::asSpanInternal (Span< ByteType, Extent > bytes)
template<typename ByteType, typename DataType, Int32 Extent>
SmallSpan< DataType > Arcane::impl::asSmallSpanInternal (SmallSpan< ByteType, Extent > bytes)
template<typename DataType, Int64 Extent>
Span< DataType > Arcane::asSpan (Span< std::byte, Extent > bytes)
 Converts a Span<std::byte> into a Span<DataType>.
template<typename DataType, Int64 Extent>
Span< const DataType > Arcane::asSpan (Span< const std::byte, Extent > bytes)
 Converts a Span<std::byte> into a Span<const DataType>.
template<typename DataType, Int32 Extent>
SmallSpan< DataType > Arcane::asSmallSpan (SmallSpan< std::byte, Extent > bytes)
 Converts a SmallSpan<std::byte> into a SmallSpan<DataType>.
template<typename DataType, Int32 Extent>
SmallSpan< const DataType > Arcane::asSmallSpan (SmallSpan< const std::byte, Extent > bytes)
 Converts a SmallSpan<const std::byte> into a SmallSpan<const DataType>.
template<typename DataType, size_t SizeType>
Span< DataType, SizeType > Arcane::asSpan (std::array< DataType, SizeType > &s)
 Returns a Span associated with std::array.
template<typename DataType, size_t SizeType>
SmallSpan< DataType, SizeType > Arcane::asSmallSpan (std::array< DataType, SizeType > &s)
 Returns a SmallSpan associated with std::array.
void Arcane::binaryWrite (std::ostream &ostr, const Span< const std::byte > &bytes)
 Writes the content of bytes to the stream ostr in binary format.
void Arcane::binaryRead (std::istream &istr, const Span< std::byte > &bytes)
 Reads the content of bytes from the stream istr in binary format.
template<typename DataType, typename SizeType, SizeType Extent>
Impl::SpanTypeFromSize< conststd::byte, SizeType >::SpanType Arccore::asBytes (const SpanImpl< DataType, SizeType, Extent > &s)
 Converts the view into an array of non-modifiable bytes.
template<typename DataType, Int32 Extent>
SmallSpan< DataType > Arccore::asSmallSpan (SmallSpan< std::byte, Extent > bytes)
 Converts a SmallSpan<std::byte> into a SmallSpan<DataType>.
template<typename DataType, Int64 Extent>
Span< DataType > Arccore::asSpan (Span< std::byte, Extent > bytes)
 Converts a Span<std::byte> into a Span<DataType>.
template<typename DataType, typename SizeType, SizeType Extent, typename std::enable_if_t<!std::is_const< DataType >::value, int > = 0>
Impl::SpanTypeFromSize< std::byte, SizeType >::SpanType Arccore::asWritableBytes (const SpanImpl< DataType, SizeType, Extent > &s)
 Converts the view into an array of modifiable bytes.
void Arccore::binaryRead (std::istream &istr, const Span< std::byte > &bytes)
 Reads the content of bytes from the stream istr in binary format.
void Arccore::binaryWrite (std::ostream &ostr, const Span< const std::byte > &bytes)
 Writes the content of bytes to the stream ostr in binary format.
template<typename DataType>
void Arccore::sampleSpan (Span< const DataType > values, Span< const Int64 > indexes, Span< DataType > result)
 Extracts a sub-array from a list of indices.

Detailed Description

Types and functions associated with the classes SpanImpl, SmallSpan and Span.

Definition in file Span.h.

Function Documentation

◆ asSmallSpanInternal()

template<typename ByteType, typename DataType, Int32 Extent>
SmallSpan< DataType > Arcane::impl::asSmallSpanInternal ( SmallSpan< ByteType, Extent > bytes)
inline

Definition at line 1104 of file Span.h.

◆ asSpanInternal()

template<typename ByteType, typename DataType, Int64 Extent>
Span< DataType > Arcane::impl::asSpanInternal ( Span< ByteType, Extent > bytes)
inline

Definition at line 1091 of file Span.h.