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

◆ set_sorting_parameter()

template<ComputeData InputType = Kakshya::DataVariant, ComputeData OutputType = InputType>
void MayaFlux::Yantra::StandardSorter< InputType, OutputType >::set_sorting_parameter ( const std::string &  name,
std::any  value 
)
inlineoverrideprotectedvirtual

Custom parameter handling.

Reimplemented from MayaFlux::Yantra::UniversalSorter< InputType, OutputType >.

Definition at line 103 of file StandardSorter.hpp.

104 {
105 if (name == "algorithm") {
106 if (auto alg_result = safe_any_cast<SortingAlgorithm>(value)) {
107 m_algorithm = *alg_result.value;
108 return;
109 }
110 if (auto str_result = safe_any_cast<std::string>(value)) {
111 auto algorithm_enum = Reflect::string_to_enum_case_insensitive<SortingAlgorithm>(*str_result.value);
112 if (algorithm_enum) {
113 m_algorithm = *algorithm_enum;
114 return;
115 }
116 }
117 }
118 if (name == "chunk_size") {
119 if (auto size_result = safe_any_cast<size_t>(value)) {
120 m_chunk_size = *size_result.value;
121 return;
122 }
123 }
124 base_type::set_sorting_parameter(name, std::move(value));
125 }
virtual void set_sorting_parameter(const std::string &name, std::any value)
Sorting-specific parameter handling (override for custom parameters)