Validate structured insertion matches GLM component count.
233 {
234 constexpr size_t components = glm_component_count<T>();
235
236 bool valid = false;
237 switch (modality) {
242 valid = (components == 3);
243 break;
244
246 valid = (components == 2);
247 break;
248
250 valid = (components == 4);
251 break;
252
254 valid = (components == 16);
255 break;
256
257 default:
258 error<std::invalid_argument>(
261 std::source_location::current(),
262 "Modality {} does not represent structured GLM data",
264 }
265
266 if (!valid) {
267 error<std::invalid_argument>(
270 std::source_location::current(),
271 "GLM type component count ({}) doesn't match modality {}. "
272 "Suggested type: {}",
273 components,
276 }
277 }
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.