|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Concrete implementation for standard comparison-based sorting. More...
#include <StandardSorter.hpp>
Inheritance diagram for MayaFlux::Yantra::StandardSorter< InputType, OutputType >:
Collaboration diagram for MayaFlux::Yantra::StandardSorter< InputType, OutputType >:Public Types | |
| using | base_type = UniversalSorter< InputType, OutputType > |
| using | input_type = typename base_type::input_type |
| using | output_type = typename base_type::output_type |
Public Types inherited from MayaFlux::Yantra::UniversalSorter< InputType, OutputType > | |
| using | input_type = IO< InputType > |
| using | output_type = IO< OutputType > |
| using | base_type = ComputeOperation< InputType, OutputType > |
Public Types inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType > | |
| using | input_type = IO< InputType > |
| using | output_type = IO< OutputType > |
Public Member Functions | |
| StandardSorter () | |
| Constructor with default configuration. | |
| SortingType | get_sorting_type () const override |
| Get sorting type category. | |
| void | set_algorithm (SortingAlgorithm algorithm) |
| Configure sorting algorithm. | |
| SortingAlgorithm | get_algorithm () const |
Public Member Functions inherited from MayaFlux::Yantra::UniversalSorter< InputType, OutputType > | |
| virtual | ~UniversalSorter ()=default |
| std::string | get_name () const override |
| Gets human-readable name for this sorter. | |
| void | set_parameter (const std::string &name, std::any value) override |
| Type-safe parameter management with sorting-specific defaults. | |
| std::any | get_parameter (const std::string &name) const override |
| Retrieves a parameter's current value. | |
| std::map< std::string, std::any > | get_all_parameters () const override |
| Retrieves all parameters and their values. | |
| template<typename T > | |
| T | get_parameter_or_default (const std::string &name, const T &default_value) const |
| Type-safe parameter access with defaults. | |
| void | set_strategy (SortingStrategy strategy) |
| Configure sorting strategy. | |
| SortingStrategy | get_strategy () const |
| void | set_direction (SortingDirection direction) |
| Configure sorting direction. | |
| SortingDirection | get_direction () const |
| void | set_granularity (SortingGranularity granularity) |
| Configure output granularity. | |
| SortingGranularity | get_granularity () const |
| void | set_sort_keys (const std::vector< SortKey > &keys) |
| Add multi-key sorting capability. | |
| const std::vector< SortKey > & | get_sort_keys () const |
| template<typename T > | |
| void | set_custom_comparator (std::function< bool(const T &, const T &)> comparator) |
| Configure custom comparator for CUSTOM direction. | |
Public Member Functions inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType > | |
| ComputeOperation () | |
| Constructor with data type validation warnings. | |
| virtual | ~ComputeOperation ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| output_type | apply_operation (const input_type &input) |
| Public synchronous execution interface. | |
| output_type | apply_operation_with_dependencies (const input_type &input) |
| Applies the operation with dependencies resolved. | |
| output_type | operator() (const InputType &data) |
| Convenience overload for direct data processing (backward compatibility) | |
| OutputType | apply_to_data (const InputType &data) |
| Convenience overload that extracts just the data from result. | |
| virtual bool | validate_input (const input_type &) const |
| Validates if the input data meets the operation's requirements. | |
| output_type | execute (const input_type &input) |
| OpUnit interface - operations can act as units in dependency graphs. | |
| void | add_dependency (std::shared_ptr< ComputeOperation > dep) |
| const auto & | get_dependencies () const |
| virtual void | set_container_for_regions (const std::shared_ptr< Kakshya::SignalSourceContainer > &container) |
| virtual const std::shared_ptr< Kakshya::SignalSourceContainer > & | get_container_for_regions () const |
| void | set_last_execution_context (const ExecutionContext &ctx) |
| const ExecutionContext & | get_last_execution_context () const |
| void | set_pre_execution_hook (const OpererationHookCallback &hook) |
| void | set_post_execution_hook (const OpererationHookCallback &hook) |
| void | set_reconstruction_callback (const ReconstructionCallback &callback) |
Protected Member Functions | |
| std::string | get_sorter_name () const override |
| Get sorter name. | |
| output_type | sort_implementation (const input_type &input) override |
| Main sorting implementation with type dispatch. | |
| bool | validate_sorting_input (const input_type &input) const override |
| Input validation. | |
| void | set_sorting_parameter (const std::string &name, std::any value) override |
| Custom parameter handling. | |
| std::any | get_sorting_parameter (const std::string &name) const override |
Protected Member Functions inherited from MayaFlux::Yantra::UniversalSorter< InputType, OutputType > | |
| output_type | operation_function (const input_type &input) override |
| Core operation implementation - called by ComputeOperation interface. | |
| virtual std::map< std::string, std::any > | get_all_sorting_parameters () const |
| virtual output_type | apply_granularity_formatting (const output_type &raw_output) |
| Apply granularity-based output formatting. | |
| virtual output_type | add_sorting_metadata (const output_type &raw_output) |
| Add sorting metadata to results (override for custom attribution) | |
| virtual output_type | organize_into_groups (const output_type &raw_output) |
| Organize results into hierarchical groups (override for custom grouping) | |
| virtual output_type | create_sorting_analysis (const output_type &raw_output) |
| Create detailed sorting analysis (override for custom analysis) | |
| bool | has_custom_comparator () const |
| Helper to check if custom comparator is available. | |
| bool | apply_custom_comparator (const std::any &a, const std::any &b) const |
| Apply custom comparator if available. | |
| virtual bool | should_use_multi_key_sorting () const |
| Apply multi-key sorting if keys are configured. | |
| template<typename SortingResultType > | |
| void | store_current_sorting (SortingResultType &&result) const |
Protected Member Functions inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType > | |
| virtual output_type | apply_operation_internal (const input_type &input, const ExecutionContext &context) |
| Internal execution method - ComputeMatrix can access this. | |
| virtual std::future< output_type > | apply_operation_async (const input_type &input) |
| Optional async implementation - default delegates to operation_function. | |
| virtual output_type | apply_operation_parallel (const input_type &input, const ExecutionContext &ctx) |
| Optional parallel-aware implementation - default delegates to operation_function. | |
| virtual output_type | apply_operation_chained (const input_type &input, const ExecutionContext &ctx) |
| Optional chain-aware implementation - default delegates to operation_function. | |
| output_type | convert_result (std::vector< std::vector< double > > &result_data, DataStructureInfo &metadata) |
| Convert processed double data back to OutputType using metadata and optional callback. | |
Private Member Functions | |
| output_type | sort_copy (const input_type &input) |
| Copy-based sorting (preserves input) | |
| output_type | sort_in_place (const input_type &input) |
| In-place sorting (modifies input) | |
| output_type | sort_indices_only (const input_type &input) |
| Generate sort indices only. | |
| output_type | sort_partial (const input_type &input) |
| Partial sorting (top-K elements) | |
| output_type | sort_parallel (const input_type &input) |
| Parallel sorting. | |
| InputType | sort_data_copy (const input_type &data) |
| Sort data with copy semantics. | |
| void | sort_data_in_place (input_type &data) |
| Sort data in-place. | |
| InputType | sort_data_partial (const input_type &data) |
| Partial sorting implementation. | |
| std::vector< InputType > | extract_chunked_data (std::vector< std::span< double > > channels, DataStructureInfo info) |
| output_type | sort_chunked (const input_type &data) |
| Chunked sorting implementation. | |
| output_type | merge_chunks_to_result (const std::vector< InputType > &chunks, const input_type &original_input, DataStructureInfo info) |
| Merge chunks back to single result. | |
| output_type | convert_and_sort (const input_type &input) |
| Handle type conversion scenarios. | |
| bool | validate_input_type (const input_type &data) const |
| Validate input type for sorting. | |
Private Attributes | |
| SortingAlgorithm | m_algorithm = SortingAlgorithm::STANDARD |
| size_t | m_chunk_size = 1024 |
Additional Inherited Members | |
Protected Attributes inherited from MayaFlux::Yantra::UniversalSorter< InputType, OutputType > | |
| std::any | m_current_sorting |
| Current sorting operation storage for complex operations. | |
| output_type | m_current_output |
Protected Attributes inherited from MayaFlux::Yantra::ComputeOperation< InputType, OutputType > | |
| std::shared_ptr< Kakshya::SignalSourceContainer > | m_container |
| ExecutionContext | m_last_execution_context |
Concrete implementation for standard comparison-based sorting.
This sorter handles most common sorting scenarios using standard algorithms and comparators. It supports:
Definition at line 31 of file StandardSorter.hpp.