69# pragma warning(disable : 4251)
87 static constexpr const char *path{
"" };
90 static constexpr const char *name{
"EnvironmentInfo" };
93 static constexpr const char *description{
94 R
"description(Information about the current toolchain and platform)description"
97 static constexpr size_t version{ 1 };
107 static constexpr std::array<uint8_t, 3> binaryId{
'e',
'v',
'm' };
121 static constexpr const char *path{
"Platform" };
124 static constexpr const char *name{
"Platform" };
127 static constexpr const char *description{
128 R
"description(Information about the current platform)description"
141 static constexpr const char *path{
"Platform/CPU" };
144 static constexpr const char *name{
"CPU" };
147 static constexpr const char *description{ R
"description(Information about the CPU)description" };
159 static constexpr const char *path{
"Platform/CPU/Architecture" };
162 static constexpr const char *name{
"Architecture" };
165 static constexpr const char *description{ R
"description(CPU architecture)description" };
181 return { ValueType::unknown, ValueType::amd64, ValueType::arm64 };
189 : m_value{ verifyValue(value) }
207 return m_value == other.m_value;
213 return m_value != other.m_value;
223 void setFromString(
const std::string &value);
225 constexpr ValueType
static verifyValue(
const ValueType &value)
227 return value == ValueType::unknown || value == ValueType::amd64 || value == ValueType::arm64
229 :
throw std::invalid_argument{
230 "Invalid value: Architecture{ "
231 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value))
238 friend struct DataModel::Detail::Befriend<
Architecture>;
251 static constexpr const char *path{
"Platform/CPU/ModelName" };
254 static constexpr const char *name{
"ModelName" };
257 static constexpr const char *description{ R
"description(CPU model name)description" };
265 return { 0, std::numeric_limits<ValueType::size_type>::max() };
273 : m_value{ std::move(value) }
285 return m_value == other.m_value;
291 return m_value != other.m_value;
297 return m_value < other.m_value;
303 return m_value > other.m_value;
309 return m_value <= other.m_value;
315 return m_value >= other.m_value;
325 void setFromString(
const std::string &value);
327 std::string m_value{
"unknown" };
329 friend struct DataModel::Detail::Befriend<
ModelName>;
333 tuple<EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName>;
353 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
354 typename std::enable_if<
355 Zivid::Detail::TypeTraits::
356 AllArgsAreInTuple<
Descendants, typename std::decay<Args>::type...>::value,
359 template<typename... Args>
361 explicit
CPU(Args &&...args)
363 using namespace Zivid::Detail::TypeTraits;
366 AllArgsDecayedAreUnique<Args...>::value,
367 "Found duplicate types among the arguments passed to CPU(...). "
368 "Types should be listed at most once.");
370 set(std::forward<Args>(args)...);
385 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
387 template<typename... Args>
391 using namespace Zivid::Detail::TypeTraits;
393 using AllArgsAreDescendantNodes =
394 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
396 AllArgsAreDescendantNodes::value,
397 "All arguments passed to set(...) must be descendant nodes.");
400 AllArgsDecayedAreUnique<Args...>::value,
401 "Found duplicate types among the arguments passed to set(...). "
402 "Types should be listed at most once.");
404 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
420 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
422 template<typename... Args>
426 using namespace Zivid::Detail::TypeTraits;
428 using AllArgsAreDescendantNodes =
429 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
431 AllArgsAreDescendantNodes::value,
432 "All arguments passed to copyWith(...) must be descendant nodes.");
435 AllArgsDecayedAreUnique<Args...>::value,
436 "Found duplicate types among the arguments passed to copyWith(...). "
437 "Types should be listed at most once.");
440 copy.
set(std::forward<Args>(args)...);
447 return m_architecture;
453 return m_architecture;
459 m_architecture = value;
484 typename std::enable_if<
485 std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value,
489 return m_architecture;
495 enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value,
int>::type = 0>
501 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
504 return m_architecture;
507 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
545 void setFromString(
const std::string &value);
547 void setFromString(
const std::string &fullPath,
const std::string &value);
549 std::string getString(
const std::string &fullPath)
const;
551 Architecture m_architecture;
554 friend struct DataModel::Detail::Befriend<
CPU>;
567 static constexpr const char *path{
"Platform/OS" };
570 static constexpr const char *name{
"OS" };
573 static constexpr const char *description{
574 R
"description(Operation system name and version)description"
587 static constexpr const char *path{
"Platform/OS/ID" };
590 static constexpr const char *name{
"ID" };
593 static constexpr const char *description{ R
"description(Operating system name)description" };
609 return { ValueType::unknown, ValueType::windows, ValueType::gnulinux };
617 : m_value{ verifyValue(value) }
635 return m_value == other.m_value;
641 return m_value != other.m_value;
651 void setFromString(
const std::string &value);
653 constexpr ValueType
static verifyValue(
const ValueType &value)
655 return value == ValueType::unknown || value == ValueType::windows
656 || value == ValueType::gnulinux
658 :
throw std::invalid_argument{
659 "Invalid value: ID{ "
660 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value))
667 friend struct DataModel::Detail::Befriend<
ID>;
680 static constexpr const char *path{
"Platform/OS/Version" };
683 static constexpr const char *name{
"Version" };
686 static constexpr const char *description{ R
"description(Operating system version)description" };
694 return { 0, std::numeric_limits<ValueType::size_type>::max() };
702 : m_value{ std::move(value) }
714 return m_value == other.m_value;
720 return m_value != other.m_value;
726 return m_value < other.m_value;
732 return m_value > other.m_value;
738 return m_value <= other.m_value;
744 return m_value >= other.m_value;
754 void setFromString(
const std::string &value);
756 std::string m_value{
"unknown" };
758 friend struct DataModel::Detail::Befriend<
Version>;
762 std::tuple<EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version>;
782 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
783 typename std::enable_if<
784 Zivid::Detail::TypeTraits::
785 AllArgsAreInTuple<
Descendants, typename std::decay<Args>::type...>::value,
788 template<typename... Args>
790 explicit
OS(Args &&...args)
792 using namespace Zivid::Detail::TypeTraits;
795 AllArgsDecayedAreUnique<Args...>::value,
796 "Found duplicate types among the arguments passed to OS(...). "
797 "Types should be listed at most once.");
799 set(std::forward<Args>(args)...);
814 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
816 template<typename... Args>
820 using namespace Zivid::Detail::TypeTraits;
822 using AllArgsAreDescendantNodes =
823 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
825 AllArgsAreDescendantNodes::value,
826 "All arguments passed to set(...) must be descendant nodes.");
829 AllArgsDecayedAreUnique<Args...>::value,
830 "Found duplicate types among the arguments passed to set(...). "
831 "Types should be listed at most once.");
833 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
849 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
851 template<typename... Args>
855 using namespace Zivid::Detail::TypeTraits;
857 using AllArgsAreDescendantNodes =
858 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
860 AllArgsAreDescendantNodes::value,
861 "All arguments passed to copyWith(...) must be descendant nodes.");
864 AllArgsDecayedAreUnique<Args...>::value,
865 "Found duplicate types among the arguments passed to copyWith(...). "
866 "Types should be listed at most once.");
869 copy.
set(std::forward<Args>(args)...);
913 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value,
int>::type =
922 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value,
int>::
929 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
935 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
973 void setFromString(
const std::string &value);
975 void setFromString(
const std::string &fullPath,
const std::string &value);
977 std::string getString(
const std::string &fullPath)
const;
982 friend struct DataModel::Detail::Befriend<
OS>;
1015 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1016 typename std::enable_if<
1017 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
1021 template<typename... Args>
1025 using namespace Zivid::Detail::TypeTraits;
1028 AllArgsDecayedAreUnique<Args...>::value,
1029 "Found duplicate types among the arguments passed to Platform(...). "
1030 "Types should be listed at most once.");
1032 set(std::forward<Args>(args)...);
1051 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1053 template<typename... Args>
1057 using namespace Zivid::Detail::TypeTraits;
1059 using AllArgsAreDescendantNodes =
1060 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1062 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
1065 AllArgsDecayedAreUnique<Args...>::value,
1066 "Found duplicate types among the arguments passed to set(...). "
1067 "Types should be listed at most once.");
1069 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1089 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1091 template<typename... Args>
1095 using namespace Zivid::Detail::TypeTraits;
1097 using AllArgsAreDescendantNodes =
1098 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1100 AllArgsAreDescendantNodes::value,
1101 "All arguments passed to copyWith(...) must be descendant nodes.");
1104 AllArgsDecayedAreUnique<Args...>::value,
1105 "Found duplicate types among the arguments passed to copyWith(...). "
1106 "Types should be listed at most once.");
1109 copy.
set(std::forward<Args>(args)...);
1181 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU>::value,
int>::type = 0>
1189 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value,
int>::
1198 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value,
int>::
1207 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS>::value,
int>::type = 0>
1215 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value,
int>::type = 0>
1223 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value,
int>::type =
1230 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1236 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1243 template<
typename F>
1251 template<
typename F>
1274 void setFromString(
const std::string &value);
1276 void setFromString(
const std::string &fullPath,
const std::string &value);
1278 std::string getString(
const std::string &fullPath)
const;
1283 friend struct DataModel::Detail::Befriend<
Platform>;
1296 static constexpr const char *path{
"UserToolchain" };
1299 static constexpr const char *name{
"UserToolchain" };
1302 static constexpr const char *description{
1303 R
"description(Information about the current toolchain)description"
1316 static constexpr const char *path{
"UserToolchain/Compiler" };
1319 static constexpr const char *name{
"Compiler" };
1322 static constexpr const char *description{
1323 R
"description(Information about which compiler is being used)description"
1336 static constexpr const char *path{
"UserToolchain/Compiler/ID" };
1339 static constexpr const char *name{
"ID" };
1342 static constexpr const char *description{ R
"description(The name of the compiler)description" };
1368 return { ValueType::unknown, ValueType::msvc, ValueType::clang,
1369 ValueType::gcc, ValueType::intel, ValueType::mingwGcc,
1370 ValueType::mingwClang, ValueType::mingwUnknown };
1378 : m_value{ verifyValue(value) }
1396 return m_value == other.m_value;
1402 return m_value != other.m_value;
1412 void setFromString(
const std::string &value);
1414 constexpr ValueType
static verifyValue(
const ValueType &value)
1416 return value == ValueType::unknown || value == ValueType::msvc || value == ValueType::clang
1417 || value == ValueType::gcc || value == ValueType::intel
1418 || value == ValueType::mingwGcc || value == ValueType::mingwClang
1419 || value == ValueType::mingwUnknown
1421 :
throw std::invalid_argument{
1422 "Invalid value: ID{ "
1423 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value))
1430 friend struct DataModel::Detail::Befriend<
ID>;
1443 static constexpr const char *path{
"UserToolchain/Compiler/Version" };
1446 static constexpr const char *name{
"Version" };
1449 static constexpr const char *description{
1450 R
"description(The version of the compiler)description"
1459 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1467 : m_value{ std::move(value) }
1479 return m_value == other.m_value;
1485 return m_value != other.m_value;
1491 return m_value < other.m_value;
1497 return m_value > other.m_value;
1503 return m_value <= other.m_value;
1509 return m_value >= other.m_value;
1519 void setFromString(
const std::string &value);
1521 std::string m_value{
"unknown" };
1523 friend struct DataModel::Detail::Befriend<
Version>;
1548 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1549 typename std::enable_if<
1550 Zivid::Detail::TypeTraits::
1551 AllArgsAreInTuple<
Descendants, typename std::decay<Args>::type...>::value,
1554 template<typename... Args>
1558 using namespace Zivid::Detail::TypeTraits;
1561 AllArgsDecayedAreUnique<Args...>::value,
1562 "Found duplicate types among the arguments passed to Compiler(...). "
1563 "Types should be listed at most once.");
1565 set(std::forward<Args>(args)...);
1580 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1582 template<typename... Args>
1586 using namespace Zivid::Detail::TypeTraits;
1588 using AllArgsAreDescendantNodes =
1589 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1591 AllArgsAreDescendantNodes::value,
1592 "All arguments passed to set(...) must be descendant nodes.");
1595 AllArgsDecayedAreUnique<Args...>::value,
1596 "Found duplicate types among the arguments passed to set(...). "
1597 "Types should be listed at most once.");
1599 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1615 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1617 template<typename... Args>
1621 using namespace Zivid::Detail::TypeTraits;
1623 using AllArgsAreDescendantNodes =
1624 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1626 AllArgsAreDescendantNodes::value,
1627 "All arguments passed to copyWith(...) must be descendant nodes.");
1630 AllArgsDecayedAreUnique<Args...>::value,
1631 "Found duplicate types among the arguments passed to copyWith(...). "
1632 "Types should be listed at most once.");
1635 copy.
set(std::forward<Args>(args)...);
1679 typename std::enable_if<
1680 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value,
1689 typename std::enable_if<
1690 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
1697 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1703 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1710 template<
typename F>
1718 template<
typename F>
1741 void setFromString(
const std::string &value);
1743 void setFromString(
const std::string &fullPath,
const std::string &value);
1745 std::string getString(
const std::string &fullPath)
const;
1750 friend struct DataModel::Detail::Befriend<
Compiler>;
1763 static constexpr const char *path{
"UserToolchain/CxxStandard" };
1766 static constexpr const char *name{
"CxxStandard" };
1769 static constexpr const char *description{ R
"description(The C++ standard being used)description" };
1777 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1785 : m_value{ std::move(value) }
1797 return m_value == other.m_value;
1803 return m_value != other.m_value;
1809 return m_value < other.m_value;
1815 return m_value > other.m_value;
1821 return m_value <= other.m_value;
1827 return m_value >= other.m_value;
1837 void setFromString(
const std::string &value);
1839 std::string m_value{
"unknown" };
1841 friend struct DataModel::Detail::Befriend<
CxxStandard>;
1854 static constexpr const char *path{
"UserToolchain/StandardLibrary" };
1857 static constexpr const char *name{
"StandardLibrary" };
1860 static constexpr const char *description{
1861 R
"description(Information about what standard library implementation is being used)description"
1874 static constexpr const char *path{
"UserToolchain/StandardLibrary/ID" };
1877 static constexpr const char *name{
"ID" };
1880 static constexpr const char *description{
1881 R
"description(The name of the standard library implementation)description"
1900 return { ValueType::unknown, ValueType::msvc, ValueType::libcxx, ValueType::libstdcxx };
1908 : m_value{ verifyValue(value) }
1926 return m_value == other.m_value;
1932 return m_value != other.m_value;
1942 void setFromString(
const std::string &value);
1944 constexpr ValueType
static verifyValue(
const ValueType &value)
1946 return value == ValueType::unknown || value == ValueType::msvc || value == ValueType::libcxx
1947 || value == ValueType::libstdcxx
1949 :
throw std::invalid_argument{
1950 "Invalid value: ID{ "
1951 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value))
1958 friend struct DataModel::Detail::Befriend<
ID>;
1971 static constexpr const char *path{
"UserToolchain/StandardLibrary/Version" };
1974 static constexpr const char *name{
"Version" };
1977 static constexpr const char *description{
1978 R
"description(The version of the standard library implementation)description"
1987 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1995 : m_value{ std::move(value) }
2007 return m_value == other.m_value;
2013 return m_value != other.m_value;
2019 return m_value < other.m_value;
2025 return m_value > other.m_value;
2031 return m_value <= other.m_value;
2037 return m_value >= other.m_value;
2047 void setFromString(
const std::string &value);
2049 std::string m_value{
"unknown" };
2051 friend struct DataModel::Detail::Befriend<
Version>;
2076 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
2077 typename std::enable_if<
2078 Zivid::Detail::TypeTraits::
2079 AllArgsAreInTuple<
Descendants, typename std::decay<Args>::type...>::value,
2082 template<typename... Args>
2086 using namespace Zivid::Detail::TypeTraits;
2089 AllArgsDecayedAreUnique<Args...>::value,
2090 "Found duplicate types among the arguments passed to StandardLibrary(...). "
2091 "Types should be listed at most once.");
2093 set(std::forward<Args>(args)...);
2108 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2110 template<typename... Args>
2114 using namespace Zivid::Detail::TypeTraits;
2116 using AllArgsAreDescendantNodes =
2117 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2119 AllArgsAreDescendantNodes::value,
2120 "All arguments passed to set(...) must be descendant nodes.");
2123 AllArgsDecayedAreUnique<Args...>::value,
2124 "Found duplicate types among the arguments passed to set(...). "
2125 "Types should be listed at most once.");
2127 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2143 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2145 template<typename... Args>
2149 using namespace Zivid::Detail::TypeTraits;
2151 using AllArgsAreDescendantNodes =
2152 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2154 AllArgsAreDescendantNodes::value,
2155 "All arguments passed to copyWith(...) must be descendant nodes.");
2158 AllArgsDecayedAreUnique<Args...>::value,
2159 "Found duplicate types among the arguments passed to copyWith(...). "
2160 "Types should be listed at most once.");
2163 copy.
set(std::forward<Args>(args)...);
2207 typename std::enable_if<
2208 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
2217 typename std::enable_if<
2218 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
2225 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2231 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2238 template<
typename F>
2246 template<
typename F>
2269 void setFromString(
const std::string &value);
2271 void setFromString(
const std::string &fullPath,
const std::string &value);
2273 std::string getString(
const std::string &fullPath)
const;
2313 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
2314 typename std::enable_if<
2315 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
2319 template<typename... Args>
2323 using namespace Zivid::Detail::TypeTraits;
2326 AllArgsDecayedAreUnique<Args...>::value,
2327 "Found duplicate types among the arguments passed to UserToolchain(...). "
2328 "Types should be listed at most once.");
2330 set(std::forward<Args>(args)...);
2350 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2352 template<typename... Args>
2356 using namespace Zivid::Detail::TypeTraits;
2358 using AllArgsAreDescendantNodes =
2359 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2361 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
2364 AllArgsDecayedAreUnique<Args...>::value,
2365 "Found duplicate types among the arguments passed to set(...). "
2366 "Types should be listed at most once.");
2368 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2389 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2391 template<typename... Args>
2395 using namespace Zivid::Detail::TypeTraits;
2397 using AllArgsAreDescendantNodes =
2398 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2400 AllArgsAreDescendantNodes::value,
2401 "All arguments passed to copyWith(...) must be descendant nodes.");
2404 AllArgsDecayedAreUnique<Args...>::value,
2405 "Found duplicate types among the arguments passed to copyWith(...). "
2406 "Types should be listed at most once.");
2409 copy.
set(std::forward<Args>(args)...);
2435 m_compiler.
set(value);
2442 m_compiler.
set(value);
2449 return m_cxxStandard;
2455 return m_cxxStandard;
2461 m_cxxStandard = value;
2468 return m_standardLibrary;
2474 return m_standardLibrary;
2480 m_standardLibrary = value;
2487 m_standardLibrary.
set(value);
2494 m_standardLibrary.
set(value);
2500 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler>::value,
int>::
2509 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value,
int>::
2518 typename std::enable_if<
2519 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
2528 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::CxxStandard>::value,
int>::
2532 return m_cxxStandard;
2537 typename std::enable_if<
2538 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary>::value,
2542 return m_standardLibrary;
2547 typename std::enable_if<
2548 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
2557 typename std::enable_if<
2558 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
2565 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2571 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2574 return m_cxxStandard;
2577 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2580 return m_standardLibrary;
2584 template<
typename F>
2589 f(m_standardLibrary);
2593 template<
typename F>
2598 f(m_standardLibrary);
2617 void setFromString(
const std::string &value);
2619 void setFromString(
const std::string &fullPath,
const std::string &value);
2621 std::string getString(
const std::string &fullPath)
const;
2623 Compiler m_compiler;
2624 CxxStandard m_cxxStandard;
2640 static constexpr const char *path{
"Wrapper" };
2643 static constexpr const char *name{
"Wrapper" };
2646 static constexpr const char *description{ R
"description(The wrapper being used, if any)description" };
2670 return { ValueType::none, ValueType::python, ValueType::dotnet, ValueType::genicam,
2671 ValueType::ros1, ValueType::ros2, ValueType::studio };
2679 : m_value{ verifyValue(value) }
2697 return m_value == other.m_value;
2703 return m_value != other.m_value;
2713 void setFromString(
const std::string &value);
2715 constexpr ValueType
static verifyValue(
const ValueType &value)
2717 return value == ValueType::none || value == ValueType::python || value == ValueType::dotnet
2718 || value == ValueType::genicam || value == ValueType::ros1
2719 || value == ValueType::ros2 || value == ValueType::studio
2721 :
throw std::invalid_argument{
2722 "Invalid value: Wrapper{ "
2723 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
2729 friend struct DataModel::Detail::Befriend<
Wrapper>;
2799 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
2800 typename std::enable_if<
2801 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
2805 template<typename... Args>
2809 using namespace Zivid::Detail::TypeTraits;
2812 AllArgsDecayedAreUnique<Args...>::value,
2813 "Found duplicate types among the arguments passed to EnvironmentInfo(...). "
2814 "Types should be listed at most once.");
2816 set(std::forward<Args>(args)...);
2845 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2847 template<typename... Args>
2851 using namespace Zivid::Detail::TypeTraits;
2853 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2855 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
2858 AllArgsDecayedAreUnique<Args...>::value,
2859 "Found duplicate types among the arguments passed to set(...). "
2860 "Types should be listed at most once.");
2862 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2892 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2894 template<typename... Args>
2898 using namespace Zivid::Detail::TypeTraits;
2900 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2902 AllArgsAreDescendantNodes::value,
2903 "All arguments passed to copyWith(...) must be descendant nodes.");
2906 AllArgsDecayedAreUnique<Args...>::value,
2907 "Found duplicate types among the arguments passed to copyWith(...). "
2908 "Types should be listed at most once.");
2911 copy.
set(std::forward<Args>(args)...);
2937 m_platform.
set(value);
2944 m_platform.
set(value);
2951 m_platform.
set(value);
2958 m_platform.
set(value);
2965 m_platform.
set(value);
2972 m_platform.
set(value);
2979 return m_userToolchain;
2985 return m_userToolchain;
2991 m_userToolchain = value;
2998 m_userToolchain.
set(value);
3005 m_userToolchain.
set(value);
3012 m_userToolchain.
set(value);
3019 m_userToolchain.
set(value);
3026 m_userToolchain.
set(value);
3033 m_userToolchain.
set(value);
3040 m_userToolchain.
set(value);
3065 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform>::value,
int>::type = 0>
3073 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU>::value,
int>::type = 0>
3081 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value,
int>::
3090 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value,
int>::type =
3099 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS>::value,
int>::type = 0>
3107 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value,
int>::type = 0>
3115 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value,
int>::type = 0>
3123 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain>::value,
int>::type = 0>
3126 return m_userToolchain;
3131 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler>::value,
int>::type =
3140 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value,
int>::
3150 enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
int>::type = 0>
3158 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::CxxStandard>::value,
int>::
3167 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary>::value,
int>::
3176 typename std::enable_if<
3177 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
3186 typename std::enable_if<
3187 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
3196 typename std::enable_if<std::is_same<T, EnvironmentInfo::Wrapper>::value,
int>::type = 0>
3202 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3208 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3211 return m_userToolchain;
3214 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3221 template<
typename F>
3230 template<
typename F>
3254 void save(
const std::string &fileName)
const;
3257 void load(
const std::string &fileName);
3260 void setFromString(
const std::string &value);
3262 void setFromString(
const std::string &fullPath,
const std::string &value);
3264 std::string getString(
const std::string &fullPath)
const;
3284 struct EnvironmentInfo::Version<1>
3286 using Type = EnvironmentInfo;
3294# pragma warning(pop)
3298# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
3303 struct tuple_size<
Zivid::Detail::EnvironmentInfo::Platform> : integral_constant<size_t, 2>
3307 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::Platform>
3309 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform>::value,
"Index must be less than 2");
3312 =
decltype(declval<Zivid::Detail::EnvironmentInfo::Platform>().get<i>());
3316 struct tuple_size<
Zivid::Detail::EnvironmentInfo::Platform::CPU> : integral_constant<size_t, 2>
3320 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::Platform::CPU>
3323 i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform::CPU>::value,
3324 "Index must be less than 2");
3327 =
decltype(declval<Zivid::Detail::EnvironmentInfo::Platform::CPU>().get<i>());
3331 struct tuple_size<
Zivid::Detail::EnvironmentInfo::Platform::OS> : integral_constant<size_t, 2>
3335 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::Platform::OS>
3337 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform::OS>::value,
"Index must be less than 2");
3340 =
decltype(declval<Zivid::Detail::EnvironmentInfo::Platform::OS>().get<i>());
3344 struct tuple_size<
Zivid::Detail::EnvironmentInfo::UserToolchain> : integral_constant<size_t, 3>
3348 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::UserToolchain>
3351 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain>::value,
3352 "Index must be less than 3");
3355 =
decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain>().get<i>());
3359 struct tuple_size<
Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler> : integral_constant<size_t, 2>
3363 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>
3366 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>::value,
3367 "Index must be less than 2");
3370 =
decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>().get<i>());
3374 struct tuple_size<
Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary> : integral_constant<size_t, 2>
3378 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>
3381 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>::value,
3382 "Index must be less than 2");
3385 =
decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>().get<i>());
3389 struct tuple_size<
Zivid::Detail::EnvironmentInfo> : integral_constant<size_t, 3>
3393 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo>
3395 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo>::value,
"Index must be less than 3");
3398 =
decltype(declval<Zivid::Detail::EnvironmentInfo>().get<i>());
3407#if defined(__has_include) && !defined(NO_DOC)
3408# if __has_include("Zivid/Detail/EnvironmentInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
3409# include "Zivid/Detail/EnvironmentInfoInternal.h"
#define ZIVID_NODISCARD
Definition Attributes.h:49
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
The wrapper being used, if any.
Definition EnvironmentInfo.h:2634
static const Wrapper genicam
genicam
Definition EnvironmentInfo.h:2662
static const Wrapper dotnet
dotnet
Definition EnvironmentInfo.h:2661
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:2650
static const Wrapper python
python
Definition EnvironmentInfo.h:2660
static const Wrapper ros2
ros2
Definition EnvironmentInfo.h:2664
ValueType value() const
Get the value.
bool operator==(const Wrapper &other) const
Comparison operator.
Definition EnvironmentInfo.h:2695
friend std::ostream & operator<<(std::ostream &stream, const Wrapper &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:2707
bool operator!=(const Wrapper &other) const
Comparison operator.
Definition EnvironmentInfo.h:2701
static const Wrapper studio
studio
Definition EnvironmentInfo.h:2665
Wrapper()=default
Default constructor.
static std::set< ValueType > validValues()
All valid values of Wrapper.
Definition EnvironmentInfo.h:2668
friend std::ostream & operator<<(std::ostream &stream, const Wrapper::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:2689
static const Wrapper none
none
Definition EnvironmentInfo.h:2659
std::string toString() const
Get the value as string.
constexpr Wrapper(ValueType value)
Constructor.
Definition EnvironmentInfo.h:2678
static const Wrapper ros1
ros1
Definition EnvironmentInfo.h:2663
Information about the current toolchain and platform.
Definition EnvironmentInfo.h:81
bool operator==(const EnvironmentInfo &other) const
Equality operator.
EnvironmentInfo & set(const UserToolchain::StandardLibrary::ID &value)
Set UserToolchain::StandardLibrary::ID.
Definition EnvironmentInfo.h:3031
const EnvironmentInfo::Platform::OS::Version & get() const
Definition EnvironmentInfo.h:3116
EnvironmentInfo & set(const Platform::OS &value)
Set Platform::OS.
Definition EnvironmentInfo.h:2956
EnvironmentInfo copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition EnvironmentInfo.h:2896
Wrapper & wrapper()
Get Wrapper.
Definition EnvironmentInfo.h:3051
void save(const std::string &fileName) const
Save to the given file.
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:3222
EnvironmentInfo & set(const Platform::CPU &value)
Set Platform::CPU.
Definition EnvironmentInfo.h:2935
std::string serialize() const
Serialize to a string.
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:3231
const EnvironmentInfo::Platform::OS & get() const
Definition EnvironmentInfo.h:3100
const EnvironmentInfo::Platform::CPU & get() const
Definition EnvironmentInfo.h:3074
const EnvironmentInfo::Wrapper & get() const
Definition EnvironmentInfo.h:3197
EnvironmentInfo & set(const UserToolchain &value)
Set UserToolchain.
Definition EnvironmentInfo.h:2989
std::tuple< EnvironmentInfo::Platform, EnvironmentInfo::Platform::CPU, EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName, EnvironmentInfo::Platform::OS, EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version, EnvironmentInfo::UserToolchain, EnvironmentInfo::UserToolchain::Compiler, EnvironmentInfo::UserToolchain::Compiler::ID, EnvironmentInfo::UserToolchain::Compiler::Version, EnvironmentInfo::UserToolchain::CxxStandard, EnvironmentInfo::UserToolchain::StandardLibrary, EnvironmentInfo::UserToolchain::StandardLibrary::ID, EnvironmentInfo::UserToolchain::StandardLibrary::Version, EnvironmentInfo::Wrapper > Descendants
Definition EnvironmentInfo.h:2732
EnvironmentInfo & set(const UserToolchain::StandardLibrary::Version &value)
Set UserToolchain::StandardLibrary::Version.
Definition EnvironmentInfo.h:3038
const EnvironmentInfo::Platform::OS::ID & get() const
Definition EnvironmentInfo.h:3108
EnvironmentInfo()
Default constructor.
void load(const std::string &fileName)
Load from the given file.
EnvironmentInfo & set(const Platform::CPU::Architecture &value)
Set Platform::CPU::Architecture.
Definition EnvironmentInfo.h:2942
const EnvironmentInfo::Platform::CPU::Architecture & get() const
Definition EnvironmentInfo.h:3083
const Platform & platform() const
Get Platform.
Definition EnvironmentInfo.h:2916
EnvironmentInfo & set(const UserToolchain::Compiler::ID &value)
Set UserToolchain::Compiler::ID.
Definition EnvironmentInfo.h:3003
EnvironmentInfo & set(const Platform::OS::Version &value)
Set Platform::OS::Version.
Definition EnvironmentInfo.h:2970
const EnvironmentInfo::UserToolchain & get() const
Definition EnvironmentInfo.h:3124
EnvironmentInfo & set(const Platform &value)
Set Platform.
Definition EnvironmentInfo.h:2928
const EnvironmentInfo::UserToolchain::CxxStandard & get() const
Definition EnvironmentInfo.h:3160
EnvironmentInfo & set(const UserToolchain::Compiler &value)
Set UserToolchain::Compiler.
Definition EnvironmentInfo.h:2996
const EnvironmentInfo::UserToolchain::StandardLibrary::Version & get() const
Definition EnvironmentInfo.h:3189
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:2849
const EnvironmentInfo::UserToolchain::Compiler::Version & get() const
Definition EnvironmentInfo.h:3151
const EnvironmentInfo::UserToolchain::Compiler::ID & get() const
Definition EnvironmentInfo.h:3142
const EnvironmentInfo::UserToolchain::Compiler & get() const
Definition EnvironmentInfo.h:3133
EnvironmentInfo & set(const UserToolchain::CxxStandard &value)
Set UserToolchain::CxxStandard.
Definition EnvironmentInfo.h:3017
static ZIVID_NODISCARD EnvironmentInfo fromSerialized(const std::string &value)
Construct a new EnvironmentInfo instance from a previously serialized string.
EnvironmentInfo & set(const UserToolchain::StandardLibrary &value)
Set UserToolchain::StandardLibrary.
Definition EnvironmentInfo.h:3024
const EnvironmentInfo::UserToolchain::StandardLibrary::ID & get() const
Definition EnvironmentInfo.h:3179
std::string toString() const
Get the value as string.
EnvironmentInfo & set(const Platform::CPU::ModelName &value)
Set Platform::CPU::ModelName.
Definition EnvironmentInfo.h:2949
const EnvironmentInfo::Platform & get() const
Definition EnvironmentInfo.h:3066
const EnvironmentInfo::UserToolchain::StandardLibrary & get() const
Definition EnvironmentInfo.h:3169
friend std::ostream & operator<<(std::ostream &stream, const EnvironmentInfo &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:3248
UserToolchain & userToolchain()
Get UserToolchain.
Definition EnvironmentInfo.h:2983
EnvironmentInfo & set(const UserToolchain::Compiler::Version &value)
Set UserToolchain::Compiler::Version.
Definition EnvironmentInfo.h:3010
bool operator!=(const EnvironmentInfo &other) const
Inequality operator.
const Wrapper & wrapper() const
Get Wrapper.
Definition EnvironmentInfo.h:3045
const EnvironmentInfo::Platform::CPU::ModelName & get() const
Definition EnvironmentInfo.h:3092
const UserToolchain & userToolchain() const
Get UserToolchain.
Definition EnvironmentInfo.h:2977
Platform & platform()
Get Platform.
Definition EnvironmentInfo.h:2922
EnvironmentInfo(const std::string &fileName)
Construct EnvironmentInfo by loading from file.
EnvironmentInfo & set(const Platform::OS::ID &value)
Set Platform::OS::ID.
Definition EnvironmentInfo.h:2963
EnvironmentInfo & set(const Wrapper &value)
Set Wrapper.
Definition EnvironmentInfo.h:3057
Class describing a range of values for a given type T.
Definition Range.h:73
NodeType
Definition NodeType.h:55
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:56