MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ sort_compute_data_inplace()

template<ComputeData T>
void MayaFlux::Yantra::sort_compute_data_inplace ( IO< T > &  data,
SortingDirection  direction,
SortingAlgorithm  algorithm 
)

Universal sort function - handles extraction/conversion internally.

Template Parameters
TComputeData type
Parameters
dataData to sort (modified in-place)
directionSort direction
algorithmSort algorithm

Definition at line 246 of file SortingHelper.hpp.

249{
250 if constexpr (RequiresContainer<T>) {
251 if (!data.has_container()) {
252 throw std::runtime_error("Region-like types require container use UniversalSorter instead");
253 }
254 auto channels = OperationHelper::extract_numeric_data(data.data, data.container.value());
255 sort_channels_inplace(channels, direction, algorithm);
256 return;
257 }
258
259 auto channels = OperationHelper::extract_numeric_data(data.data, data.needs_processig());
260 sort_channels_inplace(channels, direction, algorithm);
261}
bool has_container() const
Check if a container reference is associated.
Definition DataIO.hpp:155
bool needs_processig() const
Check if processing is needed (for container types)
Definition DataIO.hpp:164
T data
The actual computation data.
Definition DataIO.hpp:25
std::optional< std::shared_ptr< Kakshya::SignalSourceContainer > > container
Optional reference to container, required for regions.
Definition DataIO.hpp:31

References MayaFlux::Yantra::IO< T >::container, MayaFlux::Yantra::IO< T >::data, MayaFlux::Yantra::OperationHelper::extract_numeric_data(), MayaFlux::Yantra::IO< T >::has_container(), MayaFlux::Yantra::IO< T >::needs_processig(), and sort_channels_inplace().

Referenced by MayaFlux::Yantra::StandardSorter< InputType, OutputType >::sort_data_in_place().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: