Alexandria 2.32.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Euclid::NdArray::NdArray< T >::ContainerWrapper< Container > Struct Template Reference
Inheritance diagram for Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >:
Collaboration diagram for Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >:

Public Member Functions

 ~ContainerWrapper ()=default
 ContainerWrapper (const ContainerWrapper &)=delete
 ContainerWrapper (ContainerWrapper &&)=default
template<typename... Args>
 ContainerWrapper (Args &&... args)
size_t size () const final
template<typename T2>
auto nbytesImpl (int) const -> decltype(std::declval< Container< T2 > >().nbytes())
template<typename T2>
size_t nbytesImpl (...) const
size_t nbytes () const final
 Get the size in bytes.
template<typename T2>
auto resizeImpl (const std::vector< size_t > &shape) -> decltype((void) std::declval< Container< T2 > >().resize(std::vector< size_t >{}), void())
template<typename T2>
auto resizeImpl (const std::vector< size_t > &shape) -> decltype((void) std::declval< Container< T2 > >().resize(size_t{}), void())
void resize (const std::vector< size_t > &shape) final
std::unique_ptr< ContainerInterfacecopy () const final
 Expected to generate a deep copy of the underlying data.
Public Member Functions inherited from Euclid::NdArray::NdArray< T >::ContainerInterface
virtual ~ContainerInterface ()=default
get (size_t offset) const
 Get the element at the given absolute offset (in bytes)
T & get (size_t offset)
 Get a reference to the element at the given absolute offset (in bytes)

Public Attributes

Container< T > m_container
char * m_data_ptr
Public Attributes inherited from Euclid::NdArray::NdArray< T >::ContainerInterface
char * m_data_ptr

Detailed Description

template<typename T>
template<template< class... > class Container>
struct Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >

Definition at line 542 of file NdArray.h.

Constructor & Destructor Documentation

◆ ~ContainerWrapper()

template<typename T>
template<template< class... > class Container>
Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::~ContainerWrapper ( )
default

◆ ContainerWrapper() [1/3]

template<typename T>
template<template< class... > class Container>
Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::ContainerWrapper ( const ContainerWrapper< Container > & )
delete

References ContainerWrapper().

Referenced by ContainerWrapper(), and ContainerWrapper().

Here is the call graph for this function:

◆ ContainerWrapper() [2/3]

template<typename T>
template<template< class... > class Container>
Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::ContainerWrapper ( ContainerWrapper< Container > && )
default

References ContainerWrapper().

Here is the call graph for this function:

◆ ContainerWrapper() [3/3]

template<typename T>
template<template< class... > class Container>
template<typename... Args>
Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::ContainerWrapper ( Args &&... args)
inlineexplicit

Definition at line 554 of file NdArray.h.

References m_container, and m_data_ptr.

Member Function Documentation

◆ copy()

template<typename T>
template<template< class... > class Container>
std::unique_ptr< ContainerInterface > Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::copy ( ) const
inlinefinalvirtual

Expected to generate a deep copy of the underlying data.

Implements Euclid::NdArray::NdArray< T >::ContainerInterface.

Definition at line 601 of file NdArray.h.

References m_container, and Euclid::make_unique().

Here is the call graph for this function:

◆ nbytes()

template<typename T>
template<template< class... > class Container>
size_t Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::nbytes ( ) const
inlinefinalvirtual

Get the size in bytes.

Implements Euclid::NdArray::NdArray< T >::ContainerInterface.

Definition at line 572 of file NdArray.h.

References nbytesImpl().

Here is the call graph for this function:

◆ nbytesImpl() [1/2]

template<typename T>
template<template< class... > class Container>
template<typename T2>
size_t Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::nbytesImpl ( ...) const
inline

Definition at line 568 of file NdArray.h.

References m_container.

◆ nbytesImpl() [2/2]

template<typename T>
template<template< class... > class Container>
template<typename T2>
auto Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::nbytesImpl ( int ) const -> decltype(std::declval<Container<T2>>().nbytes())
inline

Definition at line 563 of file NdArray.h.

References std::declval(), and m_container.

Referenced by nbytes().

Here is the call graph for this function:

◆ resize()

template<typename T>
template<template< class... > class Container>
void Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::resize ( const std::vector< size_t > & shape)
inlinefinalvirtual

Note
This method delegates to resizeImpl, which uses SFINAE to switch at compilation time between an implementation adapted to STL containers [resize(size_t)], and another for containers that need the shape information (i.e. Npy)

Implements Euclid::NdArray::NdArray< T >::ContainerInterface.

Definition at line 596 of file NdArray.h.

References m_container, m_data_ptr, resizeImpl(), and Euclid::NdArray::NdArray< T >::shape().

Here is the call graph for this function:

◆ resizeImpl() [1/2]

template<typename T>
template<template< class... > class Container>
template<typename T2>
auto Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::resizeImpl ( const std::vector< size_t > & shape) -> decltype((void)std::declval<Container<T2>>().resize(size_t{}), void())
inline

Definition at line 583 of file NdArray.h.

References std::declval(), and Euclid::NdArray::NdArray< T >::shape().

Here is the call graph for this function:

◆ resizeImpl() [2/2]

template<typename T>
template<template< class... > class Container>
template<typename T2>
auto Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::resizeImpl ( const std::vector< size_t > & shape) -> decltype((void)std::declval<Container<T2>>().resize(std::vector<size_t>{}), void())
inline

Definition at line 577 of file NdArray.h.

References std::declval(), and Euclid::NdArray::NdArray< T >::shape().

Referenced by resize().

Here is the call graph for this function:

◆ size()

template<typename T>
template<template< class... > class Container>
size_t Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::size ( ) const
inlinefinalvirtual

Implements Euclid::NdArray::NdArray< T >::ContainerInterface.

Definition at line 558 of file NdArray.h.

References m_container.

Member Data Documentation

◆ m_container

template<typename T>
template<template< class... > class Container>
Container<T> Euclid::NdArray::NdArray< T >::ContainerWrapper< Container >::m_container

Definition at line 545 of file NdArray.h.

Referenced by ContainerWrapper(), copy(), nbytesImpl(), nbytesImpl(), resize(), and size().

◆ m_data_ptr

template<typename T>
template<template< class... > class Container>
char* Euclid::NdArray::NdArray< T >::ContainerInterface::m_data_ptr

Owned by the specific implementation ContainerWrapper, but exposed here to avoid indirections

Definition at line 514 of file NdArray.h.

Referenced by ContainerWrapper(), and resize().


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