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 Types | Public Member Functions | Friends | List of all members
rexlib::slice Class Reference

Class representing an slice of an array. More...

#include <rexlib/core/layout/slice.hpp>

Public Types

using start_type = std::ptrdiff_t
 
using count_type = std::size_t
 
using step_type = std::ptrdiff_t
 

Public Member Functions

REXLIB_CONSTEXPR slice (start_type start, count_type count, step_type step) noexcept
 Constructor.
 
 slice (const slice &other)=default
 
 slice (slice &&other)=default
 
slice & operator= (const slice &other)=default
 
slice & operator= (slice &&other)=default
 
REXLIB_CONSTEXPR void set_start (start_type start) noexcept
 Set the starting index.
 
REXLIB_CONSTEXPR const start_type & get_start () const noexcept
 Get the starting index.
 
REXLIB_CONSTEXPR void set_count (count_type count) noexcept
 Set the index element count.
 
REXLIB_CONSTEXPR const count_type & get_count () const noexcept
 Get the element count.
 
REXLIB_CONSTEXPR void set_step (step_type step) noexcept
 Set the step.
 
REXLIB_CONSTEXPR const step_type & get_step () const noexcept
 Get the step.
 

Friends

REXLIB_CONSTEXPR bool operator== (const slice &lhs, const slice &rhs) noexcept
 
REXLIB_CONSTEXPR bool operator!= (const slice &lhs, const slice &rhs) noexcept
 
template<typename T >
std::basic_ostream< T > & operator<< (std::basic_ostream< T > &os, const slice &s)
 

Detailed Description

Class representing an slice of an array.

This class is used to represent a slice of an array axis. It consists of a start index, an element count and a step between elements.

Constructor & Destructor Documentation

◆ slice()

REXLIB_CONSTEXPR rexlib::slice::slice ( start_type  start,
count_type  count,
step_type  step 
)
noexcept

Constructor.

Parameters
startIndex of the first element
countNumber of elements.
stepStep between consecutive elements

Member Function Documentation

◆ get_count()

REXLIB_CONSTEXPR const count_type & rexlib::slice::get_count ( ) const
noexcept

Get the element count.

Returns
count_type const& Number of elements referred by this slice.

◆ get_start()

REXLIB_CONSTEXPR const start_type & rexlib::slice::get_start ( ) const
noexcept

Get the starting index.

Returns
start_type const& Index of the first element

◆ get_step()

REXLIB_CONSTEXPR const step_type & rexlib::slice::get_step ( ) const
noexcept

Get the step.

Returns
step_type const& Step between consecutive elements

◆ set_count()

REXLIB_CONSTEXPR void rexlib::slice::set_count ( count_type  count)
noexcept

Set the index element count.

Parameters
countNew number of elements referred by this slice.

◆ set_start()

REXLIB_CONSTEXPR void rexlib::slice::set_start ( start_type  start)
noexcept

Set the starting index.

Parameters
startIndex of the first element

◆ set_step()

REXLIB_CONSTEXPR void rexlib::slice::set_step ( step_type  step)
noexcept

Set the step.

Parameters
stepStep between consecutive elements

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