MayaFlux 0.1.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 104 of file StandardSorter.hpp.

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