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

◆ get_dimension_index_for_role()

size_t MayaFlux::Kakshya::ContainerDataStructure::get_dimension_index_for_role ( const std::vector< DataDimension > &  dimensions,
DataDimension::Role  role 
) const

Find the index of a dimension with the specified role.

Parameters
dimensionsVector of dimension descriptors to search
roleDimension role to find
Returns
Index of the dimension with the specified role

Definition at line 152 of file NDimensionalContainer.cpp.

154{
155 auto expected_roles = get_expected_dimension_roles();
156
157 auto it = std::ranges::find(expected_roles, role);
158 if (it != expected_roles.end()) {
159 return std::distance(expected_roles.begin(), it);
160 }
161
162 for (size_t i = 0; i < dimensions.size(); ++i) {
163 if (dimensions[i].role == role) {
164 return i;
165 }
166 }
167
168 return SIZE_MAX;
169}
std::vector< DataDimension::Role > get_expected_dimension_roles() const
Get the expected dimension roles for this structure's modality.

References dimensions, and get_expected_dimension_roles().

+ Here is the call graph for this function: