Validate structured insertion matches GLM component count.
230 {
231 constexpr size_t components = glm_component_count<T>();
232
233 bool valid = false;
234 switch (modality) {
239 valid = (components == 3);
240 break;
241
243 valid = (components == 2);
244 break;
245
247 valid = (components == 4);
248 break;
249
251 valid = (components == 16);
252 break;
253
254 default:
255 error<std::invalid_argument>(
258 std::source_location::current(),
259 "Modality {} does not represent structured GLM data",
261 }
262
263 if (!valid) {
264 error<std::invalid_argument>(
267 std::source_location::current(),
268 "GLM type component count ({}) doesn't match modality {}. "
269 "Suggested type: {}",
270 components,
273 }
274 }
static std::string_view suggest_glm_type_for_modality(DataModality modality)
Suggest appropriate GLM type for a modality.
@ Runtime
General runtime operations (default fallback)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
std::string_view modality_to_string(DataModality modality)
Convert DataModality enum to string representation.