Last active
March 26, 2021 11:41
-
-
Save raghunayak/f32caa9ca952c4cda7f9c6e58145fc6a to your computer and use it in GitHub Desktop.
Nested QMap with std::array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QMap> | |
#include <QString> | |
#include <QDebug> | |
#include <array> | |
int main(int argc, char *argv[]) | |
{ | |
enum Gnss { Phoenix, Serell }; | |
enum ImuType { VH301, VD231, Seldov }; | |
static const QMap<Gnss, QMap<ImuType, std::array<double, 3>>> gnssImuParameters { | |
{ Gnss::Phoenix, { | |
{ ImuType::VH301, {1.11, 1.22, 1.33} }, | |
{ ImuType::VD231, {2.11, 2.22, 3.33} }, | |
} | |
}, { Gnss::Serell, { | |
{ ImuType::Seldov, {3.11, 3.22, 3.33} } | |
} | |
} | |
}; | |
for (auto i : gnssImuParameters.keys()) { | |
for (auto j : gnssImuParameters[i].keys()) { | |
qDebug() << i << j | |
<< gnssImuParameters[i][j][0] | |
<< gnssImuParameters[i][j][1] | |
<< gnssImuParameters[i][j][2]; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment