MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kakshya::StreamContainer Class Referenceabstract

Data-driven interface for temporal stream containers with navigable read position. More...

#include <StreamContainer.hpp>

+ Inheritance diagram for MayaFlux::Kakshya::StreamContainer:
+ Collaboration diagram for MayaFlux::Kakshya::StreamContainer:

Public Member Functions

virtual void advance_read_position (const std::vector< uint64_t > &frames)=0
 Advance the read position by a specified amount.
 
virtual Region get_loop_region () const =0
 Get the current loop region.
 
virtual const std::vector< uint64_t > & get_read_position () const =0
 Get the current read position.
 
virtual std::vector< uint64_t > get_remaining_frames () const =0
 Get the number of remaining frames from the current position, per channel.
 
virtual uint64_t get_temporal_rate () const =0
 Get the temporal rate (e.g., sample rate, frame rate) of the stream.
 
virtual bool has_processing_token (int channel) const =0
 
virtual bool is_at_end () const =0
 Check if read position has reached the end of the stream.
 
virtual bool is_looping () const =0
 Check if looping is enabled for the stream.
 
virtual bool is_ready () const =0
 Check if the stream is ready for reading.
 
virtual uint64_t peek_sequential (std::span< double > output, uint64_t count, uint64_t offset=0) const =0
 Peek at data without advancing the read position.
 
virtual double position_to_time (uint64_t position) const =0
 Convert from position units (e.g., frame/sample index) to time (seconds).
 
virtual uint64_t read_sequential (std::span< double > output, uint64_t count)=0
 Read data sequentially from the current position.
 
virtual void reset_processing_token ()=0
 
virtual void reset_read_position ()=0
 Reset read position to the beginning of the stream.
 
virtual void set_loop_region (const Region &region)=0
 Set the loop region using a Region.
 
virtual void set_looping (bool enable)=0
 Enable or disable looping behavior for the stream.
 
virtual void set_read_position (const std::vector< uint64_t > &position)=0
 Set the current read position in the primary temporal dimension per channel.
 
virtual uint64_t time_to_position (double time) const =0
 Convert from time (seconds) to position units (e.g., frame/sample index).
 
virtual bool try_acquire_processing_token (int channel)=0
 
virtual void update_read_position_for_channel (size_t channel, uint64_t frame)=0
 Update the read position for a specific channel.
 
virtual ~StreamContainer ()=default
 
- Public Member Functions inherited from MayaFlux::Kakshya::SignalSourceContainer
virtual std::vector< DataAccessall_channel_data ()=0
 Get all channel data as accessors.
 
virtual bool all_dimensions_consumed () const =0
 Check if all active dimensions have been consumed in this cycle.
 
virtual DataAccess channel_data (size_t channel_index)=0
 Get channel data with semantic interpretation.
 
virtual void create_default_processor ()=0
 Create and configure a default processor for this container.
 
virtual const std::vector< DataVariant > & get_data ()=0
 Get a reference to the raw data stored in the container.
 
virtual std::shared_ptr< DataProcessorget_default_processor () const =0
 Get the current default data processor.
 
virtual const std::vector< DataVariant > & get_processed_data () const =0
 Get a const reference to the processed data buffer.
 
virtual std::vector< DataVariant > & get_processed_data ()=0
 Get a mutable reference to the processed data buffer.
 
virtual std::shared_ptr< DataProcessingChainget_processing_chain ()=0
 Get the current processing chain for this container.
 
virtual ProcessingState get_processing_state () const =0
 Get the current processing state of the container.
 
virtual bool has_active_readers () const =0
 Check if any dimensions currently have active readers.
 
virtual bool is_ready_for_processing () const =0
 Check if the container is ready for processing.
 
virtual void mark_buffers_for_processing (bool should_process)=0
 Mark associated buffers for processing in the next cycle.
 
virtual void mark_buffers_for_removal ()=0
 Mark associated buffers for removal from the system.
 
virtual void mark_dimension_consumed (uint32_t dimension_index, uint32_t reader_id)=0
 Mark a dimension as consumed for the current processing cycle.
 
virtual void mark_ready_for_processing (bool ready)=0
 Mark the container as ready or not ready for processing.
 
virtual void process_default ()=0
 Process the container's data using the default processor.
 
virtual uint32_t register_dimension_reader (uint32_t dimension_index)=0
 Register a reader for a specific dimension.
 
virtual void register_state_change_callback (std::function< void(const std::shared_ptr< SignalSourceContainer > &, ProcessingState)> callback)=0
 Register a callback to be invoked on processing state changes.
 
virtual void set_default_processor (const std::shared_ptr< DataProcessor > &processor)=0
 Set the default data processor for this container.
 
virtual void set_processing_chain (const std::shared_ptr< DataProcessingChain > &chain)=0
 Set the processing chain for this container.
 
virtual void unregister_dimension_reader (uint32_t dimension_index)=0
 Unregister a reader for a specific dimension.
 
virtual void unregister_state_change_callback ()=0
 Unregister the state change callback, if any.
 
virtual void update_processing_state (ProcessingState new_state)=0
 Update the processing state of the container.
 
 ~SignalSourceContainer () override=default
 
- Public Member Functions inherited from MayaFlux::Kakshya::NDDataContainer
virtual void add_region_group (const RegionGroup &group)=0
 Add a named group of regions to the container.
 
virtual void clear ()=0
 Clear all data in the container.
 
virtual uint64_t coordinates_to_linear_index (const std::vector< uint64_t > &coordinates) const =0
 Convert coordinates to linear index based on current memory layout.
 
virtual std::unordered_map< std::string, RegionGroupget_all_region_groups () const =0
 Get all region groups in the container.
 
virtual std::vector< DataDimensionget_dimensions () const =0
 Get the dimensions describing the structure of the data.
 
virtual std::span< const double > get_frame (uint64_t frame_index) const =0
 Get a single frame of data efficiently.
 
virtual uint64_t get_frame_size () const =0
 Get the number of elements that constitute one "frame".
 
virtual void get_frames (std::span< double > output, uint64_t start_frame, uint64_t num_frames) const =0
 Get multiple frames efficiently.
 
virtual MemoryLayout get_memory_layout () const =0
 Get the memory layout used by this container.
 
virtual uint64_t get_num_frames () const =0
 Get the number of frames in the primary (temporal) dimension.
 
virtual const void * get_raw_data () const =0
 Get a raw pointer to the underlying data storage.
 
virtual std::vector< DataVariantget_region_data (const Region &region) const =0
 Get data for a specific region.
 
virtual const RegionGroupget_region_group (const std::string &name) const =0
 Get a region group by name.
 
virtual std::vector< DataVariantget_region_group_data (const RegionGroup &regions) const =0
 Get data for multiple regions efficiently.
 
virtual std::vector< DataVariantget_segments_data (const std::vector< RegionSegment > &segments) const =0
 Get data for multiple region segments efficiently.
 
virtual const ContainerDataStructureget_structure () const =0
 
virtual ContainerDataStructureget_structure ()=0
 Get the data structure defining this container's layout.
 
virtual uint64_t get_total_elements () const =0
 Get the total number of elements in the container.
 
virtual double get_value_at (const std::vector< uint64_t > &coordinates) const =0
 Get a single value at the specified coordinates.
 
virtual bool has_data () const =0
 Check if the container currently holds any data.
 
virtual bool is_region_loaded (const Region &region) const =0
 Check if a region is loaded in memory.
 
virtual std::vector< uint64_t > linear_index_to_coordinates (uint64_t linear_index) const =0
 Convert linear index to coordinates based on current memory layout.
 
virtual void load_region (const Region &region)=0
 Load a region into memory.
 
virtual void lock ()=0
 Acquire a lock for thread-safe access.
 
virtual void remove_region_group (const std::string &name)=0
 Remove a region group by name.
 
virtual void set_memory_layout (MemoryLayout layout)=0
 Set the memory layout for this container.
 
virtual void set_region_data (const Region &region, const std::vector< DataVariant > &data)=0
 Set data for a specific region.
 
virtual void set_structure (ContainerDataStructure structure)=0
 Set the data structure for this container.
 
virtual void set_value_at (const std::vector< uint64_t > &coordinates, double value)=0
 Set a single value at the specified coordinates.
 
virtual bool try_lock ()=0
 Attempt to acquire a lock without blocking.
 
virtual void unload_region (const Region &region)=0
 Unload a region from memory.
 
virtual void unlock ()=0
 Release a previously acquired lock.
 
virtual ~NDDataContainer ()=default
 

Detailed Description

Data-driven interface for temporal stream containers with navigable read position.

StreamContainer extends SignalSourceContainer by introducing explicit temporal navigation and read position management, making it suitable for playback, streaming, and interactive workflows. This abstraction enables digital-first systems to treat any multi-dimensional, processable signal source as a navigable stream, supporting advanced scenarios such as:

  • Real-time playback and scrubbing of audio, video, or multi-modal data
  • Looping, seeking, and temporal region-based processing
  • Interactive or programmatic navigation through large or infinite datasets
  • Streaming from live sources, files, or procedural generators with temporal semantics
  • Integration with digital-first nodes, routines, and buffer systems for seamless data-driven workflows

Key features:

  • Explicit read position in the primary (temporal) dimension, decoupled from analog metaphors like "tape"
  • Support for temporal rate (sample rate, frame rate, etc.) and conversion between time and position units
  • Looping and region-based navigation for flexible playback and processing
  • Sequential and random access read operations, including peek and advance
  • Designed for composability with digital-first processing chains, nodes, and routines
  • Enables robust, data-driven orchestration of streaming, playback, and temporal analysis tasks

StreamContainer is foundational for digital-first, data-driven applications that require precise, programmable control over temporal navigation and streaming, unconstrained by legacy analog models.

Definition at line 32 of file StreamContainer.hpp.


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