MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kakshya::CompositeSlice Class Reference

Borrowed consecutive elements, optionally selected by a Region. More...

#include <CompositeAccess.hpp>

+ Collaboration diagram for MayaFlux::Kakshya::CompositeSlice:

Public Member Functions

std::optional< Composite > at (size_t index) const noexcept
 Borrow a selected element by slice-relative index.
 
const DataVariant & blob_data () const noexcept
 Borrow the full binary store used by selected elements.
 
std::span< const uint8_t > element_bytes () const noexcept
 Borrow the selected contiguous packed bytes.
 
const CompositeLayout & layout () const noexcept
 Shared layout of all selected elements.
 
const Region * region () const noexcept
 Original Region when selected by Region; otherwise nullptr.
 
size_t size () const noexcept
 Number of selected elements.
 
size_t start () const noexcept
 First element index in the source access view.
 
const DataVariant & text_data () const noexcept
 Borrow the full text store used by selected elements.
 
template<typename T >
requires (ArithmeticData<T> && DataVariantElement<T>)
std::optional< CompositeProjection > to_nddata (std::string_view field_name) const
 Materialize one exact-type arithmetic field as homogeneous NDData.
 

Private Member Functions

 CompositeSlice (CompositeAccess access, size_t start, size_t count, std::optional< Region > region=std::nullopt)
 

Private Attributes

CompositeAccess m_access
 
size_t m_count
 
std::optional< Region > m_region
 
size_t m_start
 

Friends

class CompositeAccess
 

Detailed Description

Borrowed consecutive elements, optionally selected by a Region.

A slice retains the original Region and its attributes when created from one. Offset/count slices have no Region. Field access still uses the original CompositeLayout and byte stores, so payload offsets do not need to be rewritten. The slice does not own the stores.

Usage:

auto selection = items.slice(2, 4);
auto first = selection->at(0);
auto packed = selection->element_bytes();
auto scores = selection->to_nddata<double>("score");

Region usage:

Region region(std::vector<uint64_t> { 2 }, std::vector<uint64_t> { 5 });
auto selection = items.slice(region);
const Region* source = selection->region();
const Region * region() const noexcept
Original Region when selected by Region; otherwise nullptr.
Represents a point or span in N-dimensional space.
Definition Region.hpp:73
Note
element_bytes() is a zero-copy view. It is not an independent CompositeArray: text offsets still refer to the original text_data().

Definition at line 159 of file CompositeAccess.hpp.


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