Validate structured insertion matches GLM component count.
218 {
219 constexpr size_t components = glm_component_count<T>();
220
221 bool valid = false;
222 switch (modality) {
227 valid = (components == 3);
228 break;
229
231 valid = (components == 2);
232 break;
233
235 valid = (components == 4);
236 break;
237
239 valid = (components == 16);
240 break;
241
242 default:
243 error<std::invalid_argument>(
246 std::source_location::current(),
247 "Modality {} does not represent structured GLM data",
249 }
250
251 if (!valid) {
252 error<std::invalid_argument>(
255 std::source_location::current(),
256 "GLM type component count ({}) doesn't match modality {}. "
257 "Suggested type: {}",
258 components,
261 }
262 }
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.