rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rexlib::const_array_ref Class Reference

Non-owning read-only reference to an array. More...

#include <rexlib/core/ndarray/const_array_ref.hpp>

Public Member Functions

 const_array_ref () noexcept
 Construct an uninitialized const_array_ref.
 
 const_array_ref (const array_implementation *implementation) noexcept
 Construct a const_array_ref from an implementation pointer.
 
 const_array_ref (const array &other) noexcept
 Construct a const_array_ref referencing an array.
 
 const_array_ref (const const_array &other) noexcept
 Construct a const_array_ref referencing a const_array.
 
 const_array_ref (array_ref other) noexcept
 Construct a const_array_ref from an array_ref.
 
 const_array_ref (const const_array_ref &other) noexcept=default
 
 const_array_ref (const_array_ref &&other) noexcept=default
 
const_array_ref & operator= (const const_array_ref &other) noexcept=default
 
const_array_ref & operator= (const_array_ref &&other) noexcept=default
 
const array_descriptor & get_descriptor () const noexcept
 Get the descriptor of this array.
 
const buffer * get_storage () const noexcept
 Get the storage of this array.
 
std::shared_ptr< const buffer > share_storage () const noexcept
 Get a shared pointer to the storage of this array.
 
access_hazard_tracker * get_access_hazard_tracker () const noexcept
 Get the tracker of the commands that access the memory of this array.
 
const array_implementation * get_implementation () const noexcept
 Get a pointer to the implementation.
 

Detailed Description

Non-owning read-only reference to an array.

A const_array_ref refers to the contents of an array without sharing its ownership and only allows read-only semantics with it. It is intended to be used as a parameter type at interface boundaries where ownership does not need to be extended, analogously to std::string_view. The referenced array must outlive the const_array_ref; do not store const_array_ref objects.

See also
const_array
array_ref

Constructor & Destructor Documentation

◆ const_array_ref() [1/4]

rexlib::const_array_ref::const_array_ref ( const array_implementation *  implementation)
explicitnoexcept

Construct a const_array_ref from an implementation pointer.

Parameters
implementationThe implementation referenced by this.
Note
This function is not part of the public API and shall only be used internally or for testing purposes.

◆ const_array_ref() [2/4]

rexlib::const_array_ref::const_array_ref ( const array &  other)
noexcept

Construct a const_array_ref referencing an array.

Parameters
otherThe array to be referenced. Must outlive this const_array_ref.

◆ const_array_ref() [3/4]

rexlib::const_array_ref::const_array_ref ( const const_array &  other)
noexcept

Construct a const_array_ref referencing a const_array.

Parameters
otherThe const_array to be referenced. Must outlive this const_array_ref.

◆ const_array_ref() [4/4]

rexlib::const_array_ref::const_array_ref ( array_ref  other)
noexcept

Construct a const_array_ref from an array_ref.

Parameters
otherThe array_ref whose referenced array is to be referenced.

Member Function Documentation

◆ get_access_hazard_tracker()

access_hazard_tracker * rexlib::const_array_ref::get_access_hazard_tracker ( ) const
noexcept

Get the tracker of the commands that access the memory of this array.

Arrays obtained from one another share one tracker. Arrays built separately over the same storage do not.

Returns
access_hazard_tracker* The tracker. nullptr if the const_array_ref is not initialized.

◆ get_descriptor()

const array_descriptor & rexlib::const_array_ref::get_descriptor ( ) const
noexcept

Get the descriptor of this array.

Returns
array_descriptor The descriptor.

◆ get_implementation()

const array_implementation * rexlib::const_array_ref::get_implementation ( ) const
noexcept

Get a pointer to the implementation.

Returns
const array_implementation* Pointer to the implementation. nullptr if the const_array_ref is not initialized.
Note
This method is meant to be used internally and for testing purposes, as the array_implementation is not publicly available.

◆ get_storage()

const buffer * rexlib::const_array_ref::get_storage ( ) const
noexcept

Get the storage of this array.

Returns
const buffer* The storage. nullptr if the const_array_ref is not initialized.

◆ share_storage()

std::shared_ptr< const buffer > rexlib::const_array_ref::share_storage ( ) const
noexcept

Get a shared pointer to the storage of this array.

Returns
std::shared_ptr<const buffer> The storage. nullptr if the const_array_ref is not initialized.

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