MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Yantra::IO< T > Struct Template Reference

Input/Output container for computation pipeline data flow with structure preservation. More...

#include <DataIO.hpp>

+ Inheritance diagram for MayaFlux::Yantra::IO< T >:
+ Collaboration diagram for MayaFlux::Yantra::IO< T >:

Public Member Functions

 IO ()=default
 Default constructor.
 
 IO (const T &d)
 Construct from data by copy with automatic structure inference.
 
 IO (const T &d, const std::shared_ptr< Kakshya::SignalSourceContainer > &cont)
 Construct from data by copy with container reference and automatic structure inference.
 
 IO (T &&d)
 Construct from data by move with automatic structure inference.
 
 IO (T &&d, const std::shared_ptr< Kakshya::SignalSourceContainer > &cont)
 Construct from data by move with automatic structure inference.
 
 IO (T &&d, std::vector< Kakshya::DataDimension > dims, Kakshya::DataModality mod)
 Construct with move and explicit structure information.
 
 IO (T &&d, const std::shared_ptr< Kakshya::SignalSourceContainer > container, std::vector< Kakshya::DataDimension > dims, Kakshya::DataModality mod)
 Construct with move and explicit structure information.
 
const T & operator* () const
 Access underlying data (const)
 
T & operator* ()
 Access underlying data (mutable)
 
void set_container (const std::shared_ptr< Kakshya::SignalSourceContainer > &cont)
 Set or update the associated container reference.
 
bool has_container () const
 Check if a container reference is associated.
 
bool needs_processig () const
 Check if processing is needed (for container types)
 
void set_container_processing (bool val)
 Set whether processing is needed (for container types)
 
bool has_modality (Kakshya::DataModality target_modality) const
 Check if data has specific modality.
 
uint64_t get_total_elements () const
 Get total number of elements across all dimensions.
 
int find_dimension_by_role (Kakshya::DataDimension::Role role) const
 Find dimension by semantic role.
 
bool is_suitable_for_processing (Kakshya::DataModality required_modality, size_t min_dimensions=1) const
 Check if data is suitable for a specific type of processing.
 
void update_structure (std::vector< Kakshya::DataDimension > new_dims, Kakshya::DataModality new_modality)
 Update structure information (use carefully!)
 
template<typename ValueType >
void set_metadata (const std::string &key, ValueType &&value)
 Add or update metadata entry.
 
template<typename ValueType >
std::optional< ValueType > get_metadata (const std::string &key) const
 Get metadata entry with type safety.
 

Public Attributes

data
 The actual computation data.
 
std::vector< Kakshya::DataDimensiondimensions
 Data dimensional structure.
 
Kakshya::DataModality modality {}
 Data modality (audio, image, spectral, etc.)
 
std::unordered_map< std::string, std::any > metadata
 Associated metadata.
 
bool b_container_processing {}
 
std::optional< std::shared_ptr< Kakshya::SignalSourceContainer > > container
 Optional reference to container, required for regions.
 

Detailed Description

template<ComputeData T = std::vector<Kakshya::DataVariant>>
struct MayaFlux::Yantra::IO< T >

Input/Output container for computation pipeline data flow with structure preservation.

Template Parameters
TData type that satisfies ComputeData concept

Encapsulates data with associated structure information and metadata for pipeline operations. The structure (dimensions and modality) is automatically inferred at construction time, ensuring that all data flowing through operations carries its dimensional context.

Key Features:

  • Automatic structure inference from data type and content
  • Dimension and modality preservation through pipeline operations
  • Flexible metadata storage for operation-specific information
  • Move semantics for efficiency with large data

Definition at line 24 of file DataIO.hpp.


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