68# pragma warning(disable : 4251)
86 static constexpr const char *path{
"" };
89 static constexpr const char *name{
"EnvironmentInfo" };
92 static constexpr const char *description{
93 R
"description(Information about the current toolchain and platform)description"
96 static constexpr size_t version{ 1 };
106 static constexpr std::array<uint8_t, 3> binaryId{
'e',
'v',
'm' };
120 static constexpr const char *path{
"Platform" };
123 static constexpr const char *name{
"Platform" };
126 static constexpr const char *description{
127 R
"description(Information about the current platform)description"
140 static constexpr const char *path{
"Platform/CPU" };
143 static constexpr const char *name{
"CPU" };
146 static constexpr const char *description{ R
"description(Information about the CPU)description" };
158 static constexpr const char *path{
"Platform/CPU/Architecture" };
161 static constexpr const char *name{
"Architecture" };
164 static constexpr const char *description{ R
"description(CPU architecture)description" };
180 return { ValueType::unknown, ValueType::amd64, ValueType::arm64 };
188 : m_value{ verifyValue(value) }
206 return m_value == other.m_value;
212 return m_value != other.m_value;
222 void setFromString(
const std::string &value);
224 constexpr ValueType
static verifyValue(
const ValueType &value)
226 return value == ValueType::unknown || value == ValueType::amd64 || value == ValueType::arm64
228 :
throw std::invalid_argument{
229 "Invalid value: Architecture{ "
230 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value))
237 friend struct DataModel::Detail::Befriend<
Architecture>;
250 static constexpr const char *path{
"Platform/CPU/ModelName" };
253 static constexpr const char *name{
"ModelName" };
256 static constexpr const char *description{ R
"description(CPU model name)description" };
264 return { 0, std::numeric_limits<ValueType::size_type>::max() };
272 : m_value{ std::move(value) }
284 return m_value == other.m_value;
290 return m_value != other.m_value;
296 return m_value < other.m_value;
302 return m_value > other.m_value;
308 return m_value <= other.m_value;
314 return m_value >= other.m_value;
324 void setFromString(
const std::string &value);
326 std::string m_value{
"unknown" };
328 friend struct DataModel::Detail::Befriend<
ModelName>;
332 tuple<EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName>;
352 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
353 typename std::enable_if<
354 Zivid::Detail::TypeTraits::
355 AllArgsAreInTuple<
Descendants, typename std::decay<Args>::type...>::value,
358 template<typename... Args>
360 explicit
CPU(Args &&...args)
362 using namespace Zivid::Detail::TypeTraits;
365 AllArgsDecayedAreUnique<Args...>::value,
366 "Found duplicate types among the arguments passed to CPU(...). "
367 "Types should be listed at most once.");
369 set(std::forward<Args>(args)...);
384 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
386 template<typename... Args>
390 using namespace Zivid::Detail::TypeTraits;
392 using AllArgsAreDescendantNodes =
393 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
395 AllArgsAreDescendantNodes::value,
396 "All arguments passed to set(...) must be descendant nodes.");
399 AllArgsDecayedAreUnique<Args...>::value,
400 "Found duplicate types among the arguments passed to set(...). "
401 "Types should be listed at most once.");
403 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
419 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
421 template<typename... Args>
425 using namespace Zivid::Detail::TypeTraits;
427 using AllArgsAreDescendantNodes =
428 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
430 AllArgsAreDescendantNodes::value,
431 "All arguments passed to copyWith(...) must be descendant nodes.");
434 AllArgsDecayedAreUnique<Args...>::value,
435 "Found duplicate types among the arguments passed to copyWith(...). "
436 "Types should be listed at most once.");
439 copy.set(std::forward<Args>(args)...);
446 return m_architecture;
452 return m_architecture;
458 m_architecture = value;
483 typename std::enable_if<
484 std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value,
488 return m_architecture;
494 enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value,
int>::type = 0>
500 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
503 return m_architecture;
506 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
544 void setFromString(
const std::string &value);
546 void setFromString(
const std::string &fullPath,
const std::string &value);
548 std::string getString(
const std::string &fullPath)
const;
550 Architecture m_architecture;
553 friend struct DataModel::Detail::Befriend<
CPU>;
566 static constexpr const char *path{
"Platform/OS" };
569 static constexpr const char *name{
"OS" };
572 static constexpr const char *description{
573 R
"description(Operation system name and version)description"
586 static constexpr const char *path{
"Platform/OS/ID" };
589 static constexpr const char *name{
"ID" };
592 static constexpr const char *description{ R
"description(Operating system name)description" };
608 return { ValueType::unknown, ValueType::windows, ValueType::gnulinux };
616 : m_value{ verifyValue(value) }
634 return m_value == other.m_value;
640 return m_value != other.m_value;
650 void setFromString(
const std::string &value);
652 constexpr ValueType
static verifyValue(
const ValueType &value)
654 return value == ValueType::unknown || value == ValueType::windows
655 || value == ValueType::gnulinux
657 :
throw std::invalid_argument{
658 "Invalid value: ID{ "
659 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value))
666 friend struct DataModel::Detail::Befriend<
ID>;
679 static constexpr const char *path{
"Platform/OS/Version" };
682 static constexpr const char *name{
"Version" };
685 static constexpr const char *description{ R
"description(Operating system version)description" };
693 return { 0, std::numeric_limits<ValueType::size_type>::max() };
701 : m_value{ std::move(value) }
713 return m_value == other.m_value;
719 return m_value != other.m_value;
725 return m_value < other.m_value;
731 return m_value > other.m_value;
737 return m_value <= other.m_value;
743 return m_value >= other.m_value;
753 void setFromString(
const std::string &value);
755 std::string m_value{
"unknown" };
757 friend struct DataModel::Detail::Befriend<
Version>;
761 std::tuple<EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version>;
781 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
782 typename std::enable_if<
783 Zivid::Detail::TypeTraits::
784 AllArgsAreInTuple<
Descendants, typename std::decay<Args>::type...>::value,
787 template<typename... Args>
789 explicit
OS(Args &&...args)
791 using namespace Zivid::Detail::TypeTraits;
794 AllArgsDecayedAreUnique<Args...>::value,
795 "Found duplicate types among the arguments passed to OS(...). "
796 "Types should be listed at most once.");
798 set(std::forward<Args>(args)...);
813 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
815 template<typename... Args>
819 using namespace Zivid::Detail::TypeTraits;
821 using AllArgsAreDescendantNodes =
822 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
824 AllArgsAreDescendantNodes::value,
825 "All arguments passed to set(...) must be descendant nodes.");
828 AllArgsDecayedAreUnique<Args...>::value,
829 "Found duplicate types among the arguments passed to set(...). "
830 "Types should be listed at most once.");
832 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
848 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
850 template<typename... Args>
854 using namespace Zivid::Detail::TypeTraits;
856 using AllArgsAreDescendantNodes =
857 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
859 AllArgsAreDescendantNodes::value,
860 "All arguments passed to copyWith(...) must be descendant nodes.");
863 AllArgsDecayedAreUnique<Args...>::value,
864 "Found duplicate types among the arguments passed to copyWith(...). "
865 "Types should be listed at most once.");
868 copy.set(std::forward<Args>(args)...);
912 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value,
int>::type =
921 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value,
int>::
928 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
934 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
972 void setFromString(
const std::string &value);
974 void setFromString(
const std::string &fullPath,
const std::string &value);
976 std::string getString(
const std::string &fullPath)
const;
981 friend struct DataModel::Detail::Befriend<
OS>;
1014 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1015 typename std::enable_if<
1016 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
1020 template<typename... Args>
1024 using namespace Zivid::Detail::TypeTraits;
1027 AllArgsDecayedAreUnique<Args...>::value,
1028 "Found duplicate types among the arguments passed to Platform(...). "
1029 "Types should be listed at most once.");
1031 set(std::forward<Args>(args)...);
1050 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1052 template<typename... Args>
1056 using namespace Zivid::Detail::TypeTraits;
1058 using AllArgsAreDescendantNodes =
1059 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1061 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
1064 AllArgsDecayedAreUnique<Args...>::value,
1065 "Found duplicate types among the arguments passed to set(...). "
1066 "Types should be listed at most once.");
1068 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1088 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1090 template<typename... Args>
1094 using namespace Zivid::Detail::TypeTraits;
1096 using AllArgsAreDescendantNodes =
1097 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1099 AllArgsAreDescendantNodes::value,
1100 "All arguments passed to copyWith(...) must be descendant nodes.");
1103 AllArgsDecayedAreUnique<Args...>::value,
1104 "Found duplicate types among the arguments passed to copyWith(...). "
1105 "Types should be listed at most once.");
1108 copy.set(std::forward<Args>(args)...);
1180 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU>::value,
int>::type = 0>
1188 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value,
int>::
1197 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value,
int>::
1206 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS>::value,
int>::type = 0>
1214 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value,
int>::type = 0>
1222 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value,
int>::type =
1229 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1235 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1242 template<
typename F>
1250 template<
typename F>
1273 void setFromString(
const std::string &value);
1275 void setFromString(
const std::string &fullPath,
const std::string &value);
1277 std::string getString(
const std::string &fullPath)
const;
1282 friend struct DataModel::Detail::Befriend<
Platform>;
1295 static constexpr const char *path{
"UserToolchain" };
1298 static constexpr const char *name{
"UserToolchain" };
1301 static constexpr const char *description{
1302 R
"description(Information about the current toolchain)description"
1315 static constexpr const char *path{
"UserToolchain/Compiler" };
1318 static constexpr const char *name{
"Compiler" };
1321 static constexpr const char *description{
1322 R
"description(Information about which compiler is being used)description"
1335 static constexpr const char *path{
"UserToolchain/Compiler/ID" };
1338 static constexpr const char *name{
"ID" };
1341 static constexpr const char *description{ R
"description(The name of the compiler)description" };
1367 return { ValueType::unknown, ValueType::msvc, ValueType::clang,
1368 ValueType::gcc, ValueType::intel, ValueType::mingwGcc,
1369 ValueType::mingwClang, ValueType::mingwUnknown };
1377 : m_value{ verifyValue(value) }
1395 return m_value == other.m_value;
1401 return m_value != other.m_value;
1411 void setFromString(
const std::string &value);
1413 constexpr ValueType
static verifyValue(
const ValueType &value)
1415 return value == ValueType::unknown || value == ValueType::msvc || value == ValueType::clang
1416 || value == ValueType::gcc || value == ValueType::intel
1417 || value == ValueType::mingwGcc || value == ValueType::mingwClang
1418 || value == ValueType::mingwUnknown
1420 :
throw std::invalid_argument{
1421 "Invalid value: ID{ "
1422 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value))
1429 friend struct DataModel::Detail::Befriend<
ID>;
1442 static constexpr const char *path{
"UserToolchain/Compiler/Version" };
1445 static constexpr const char *name{
"Version" };
1448 static constexpr const char *description{
1449 R
"description(The version of the compiler)description"
1458 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1466 : m_value{ std::move(value) }
1478 return m_value == other.m_value;
1484 return m_value != other.m_value;
1490 return m_value < other.m_value;
1496 return m_value > other.m_value;
1502 return m_value <= other.m_value;
1508 return m_value >= other.m_value;
1518 void setFromString(
const std::string &value);
1520 std::string m_value{
"unknown" };
1522 friend struct DataModel::Detail::Befriend<
Version>;
1547 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1548 typename std::enable_if<
1549 Zivid::Detail::TypeTraits::
1550 AllArgsAreInTuple<
Descendants, typename std::decay<Args>::type...>::value,
1553 template<typename... Args>
1557 using namespace Zivid::Detail::TypeTraits;
1560 AllArgsDecayedAreUnique<Args...>::value,
1561 "Found duplicate types among the arguments passed to Compiler(...). "
1562 "Types should be listed at most once.");
1564 set(std::forward<Args>(args)...);
1579 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1581 template<typename... Args>
1585 using namespace Zivid::Detail::TypeTraits;
1587 using AllArgsAreDescendantNodes =
1588 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1590 AllArgsAreDescendantNodes::value,
1591 "All arguments passed to set(...) must be descendant nodes.");
1594 AllArgsDecayedAreUnique<Args...>::value,
1595 "Found duplicate types among the arguments passed to set(...). "
1596 "Types should be listed at most once.");
1598 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1614 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1616 template<typename... Args>
1620 using namespace Zivid::Detail::TypeTraits;
1622 using AllArgsAreDescendantNodes =
1623 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1625 AllArgsAreDescendantNodes::value,
1626 "All arguments passed to copyWith(...) must be descendant nodes.");
1629 AllArgsDecayedAreUnique<Args...>::value,
1630 "Found duplicate types among the arguments passed to copyWith(...). "
1631 "Types should be listed at most once.");
1634 copy.set(std::forward<Args>(args)...);
1678 typename std::enable_if<
1679 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value,
1688 typename std::enable_if<
1689 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
1696 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1702 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1709 template<
typename F>
1717 template<
typename F>
1740 void setFromString(
const std::string &value);
1742 void setFromString(
const std::string &fullPath,
const std::string &value);
1744 std::string getString(
const std::string &fullPath)
const;
1749 friend struct DataModel::Detail::Befriend<
Compiler>;
1762 static constexpr const char *path{
"UserToolchain/CxxStandard" };
1765 static constexpr const char *name{
"CxxStandard" };
1768 static constexpr const char *description{ R
"description(The C++ standard being used)description" };
1776 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1784 : m_value{ std::move(value) }
1796 return m_value == other.m_value;
1802 return m_value != other.m_value;
1808 return m_value < other.m_value;
1814 return m_value > other.m_value;
1820 return m_value <= other.m_value;
1826 return m_value >= other.m_value;
1836 void setFromString(
const std::string &value);
1838 std::string m_value{
"unknown" };
1840 friend struct DataModel::Detail::Befriend<
CxxStandard>;
1853 static constexpr const char *path{
"UserToolchain/StandardLibrary" };
1856 static constexpr const char *name{
"StandardLibrary" };
1859 static constexpr const char *description{
1860 R
"description(Information about what standard library implementation is being used)description"
1873 static constexpr const char *path{
"UserToolchain/StandardLibrary/ID" };
1876 static constexpr const char *name{
"ID" };
1879 static constexpr const char *description{
1880 R
"description(The name of the standard library implementation)description"
1899 return { ValueType::unknown, ValueType::msvc, ValueType::libcxx, ValueType::libstdcxx };
1907 : m_value{ verifyValue(value) }
1925 return m_value == other.m_value;
1931 return m_value != other.m_value;
1941 void setFromString(
const std::string &value);
1943 constexpr ValueType
static verifyValue(
const ValueType &value)
1945 return value == ValueType::unknown || value == ValueType::msvc || value == ValueType::libcxx
1946 || value == ValueType::libstdcxx
1948 :
throw std::invalid_argument{
1949 "Invalid value: ID{ "
1950 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value))
1957 friend struct DataModel::Detail::Befriend<
ID>;
1970 static constexpr const char *path{
"UserToolchain/StandardLibrary/Version" };
1973 static constexpr const char *name{
"Version" };
1976 static constexpr const char *description{
1977 R
"description(The version of the standard library implementation)description"
1986 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1994 : m_value{ std::move(value) }
2006 return m_value == other.m_value;
2012 return m_value != other.m_value;
2018 return m_value < other.m_value;
2024 return m_value > other.m_value;
2030 return m_value <= other.m_value;
2036 return m_value >= other.m_value;
2046 void setFromString(
const std::string &value);
2048 std::string m_value{
"unknown" };
2050 friend struct DataModel::Detail::Befriend<
Version>;
2075 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
2076 typename std::enable_if<
2077 Zivid::Detail::TypeTraits::
2078 AllArgsAreInTuple<
Descendants, typename std::decay<Args>::type...>::value,
2081 template<typename... Args>
2085 using namespace Zivid::Detail::TypeTraits;
2088 AllArgsDecayedAreUnique<Args...>::value,
2089 "Found duplicate types among the arguments passed to StandardLibrary(...). "
2090 "Types should be listed at most once.");
2092 set(std::forward<Args>(args)...);
2107 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2109 template<typename... Args>
2113 using namespace Zivid::Detail::TypeTraits;
2115 using AllArgsAreDescendantNodes =
2116 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2118 AllArgsAreDescendantNodes::value,
2119 "All arguments passed to set(...) must be descendant nodes.");
2122 AllArgsDecayedAreUnique<Args...>::value,
2123 "Found duplicate types among the arguments passed to set(...). "
2124 "Types should be listed at most once.");
2126 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2142 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2144 template<typename... Args>
2148 using namespace Zivid::Detail::TypeTraits;
2150 using AllArgsAreDescendantNodes =
2151 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2153 AllArgsAreDescendantNodes::value,
2154 "All arguments passed to copyWith(...) must be descendant nodes.");
2157 AllArgsDecayedAreUnique<Args...>::value,
2158 "Found duplicate types among the arguments passed to copyWith(...). "
2159 "Types should be listed at most once.");
2162 copy.set(std::forward<Args>(args)...);
2206 typename std::enable_if<
2207 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
2216 typename std::enable_if<
2217 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
2224 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2230 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2237 template<
typename F>
2245 template<
typename F>
2268 void setFromString(
const std::string &value);
2270 void setFromString(
const std::string &fullPath,
const std::string &value);
2272 std::string getString(
const std::string &fullPath)
const;
2312 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
2313 typename std::enable_if<
2314 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
2318 template<typename... Args>
2322 using namespace Zivid::Detail::TypeTraits;
2325 AllArgsDecayedAreUnique<Args...>::value,
2326 "Found duplicate types among the arguments passed to UserToolchain(...). "
2327 "Types should be listed at most once.");
2329 set(std::forward<Args>(args)...);
2349 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2351 template<typename... Args>
2355 using namespace Zivid::Detail::TypeTraits;
2357 using AllArgsAreDescendantNodes =
2358 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2360 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
2363 AllArgsDecayedAreUnique<Args...>::value,
2364 "Found duplicate types among the arguments passed to set(...). "
2365 "Types should be listed at most once.");
2367 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2388 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2390 template<typename... Args>
2394 using namespace Zivid::Detail::TypeTraits;
2396 using AllArgsAreDescendantNodes =
2397 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2399 AllArgsAreDescendantNodes::value,
2400 "All arguments passed to copyWith(...) must be descendant nodes.");
2403 AllArgsDecayedAreUnique<Args...>::value,
2404 "Found duplicate types among the arguments passed to copyWith(...). "
2405 "Types should be listed at most once.");
2408 copy.set(std::forward<Args>(args)...);
2434 m_compiler.
set(value);
2441 m_compiler.
set(value);
2448 return m_cxxStandard;
2454 return m_cxxStandard;
2460 m_cxxStandard = value;
2467 return m_standardLibrary;
2473 return m_standardLibrary;
2479 m_standardLibrary = value;
2486 m_standardLibrary.
set(value);
2493 m_standardLibrary.
set(value);
2499 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler>::value,
int>::
2508 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value,
int>::
2517 typename std::enable_if<
2518 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
2527 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::CxxStandard>::value,
int>::
2531 return m_cxxStandard;
2536 typename std::enable_if<
2537 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary>::value,
2541 return m_standardLibrary;
2546 typename std::enable_if<
2547 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
2556 typename std::enable_if<
2557 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
2564 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2570 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2573 return m_cxxStandard;
2576 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2579 return m_standardLibrary;
2583 template<
typename F>
2588 f(m_standardLibrary);
2592 template<
typename F>
2597 f(m_standardLibrary);
2616 void setFromString(
const std::string &value);
2618 void setFromString(
const std::string &fullPath,
const std::string &value);
2620 std::string getString(
const std::string &fullPath)
const;
2622 Compiler m_compiler;
2623 CxxStandard m_cxxStandard;
2639 static constexpr const char *path{
"Wrapper" };
2642 static constexpr const char *name{
"Wrapper" };
2645 static constexpr const char *description{ R
"description(The wrapper being used, if any)description" };
2669 return { ValueType::none, ValueType::python, ValueType::dotnet, ValueType::genicam,
2670 ValueType::ros1, ValueType::ros2, ValueType::studio };
2678 : m_value{ verifyValue(value) }
2696 return m_value == other.m_value;
2702 return m_value != other.m_value;
2712 void setFromString(
const std::string &value);
2714 constexpr ValueType
static verifyValue(
const ValueType &value)
2716 return value == ValueType::none || value == ValueType::python || value == ValueType::dotnet
2717 || value == ValueType::genicam || value == ValueType::ros1
2718 || value == ValueType::ros2 || value == ValueType::studio
2720 :
throw std::invalid_argument{
2721 "Invalid value: Wrapper{ "
2722 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
2728 friend struct DataModel::Detail::Befriend<
Wrapper>;
2798 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
2799 typename std::enable_if<
2800 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
2804 template<typename... Args>
2808 using namespace Zivid::Detail::TypeTraits;
2811 AllArgsDecayedAreUnique<Args...>::value,
2812 "Found duplicate types among the arguments passed to EnvironmentInfo(...). "
2813 "Types should be listed at most once.");
2815 set(std::forward<Args>(args)...);
2844 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2846 template<typename... Args>
2850 using namespace Zivid::Detail::TypeTraits;
2852 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2854 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
2857 AllArgsDecayedAreUnique<Args...>::value,
2858 "Found duplicate types among the arguments passed to set(...). "
2859 "Types should be listed at most once.");
2861 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2891 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2893 template<typename... Args>
2897 using namespace Zivid::Detail::TypeTraits;
2899 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2901 AllArgsAreDescendantNodes::value,
2902 "All arguments passed to copyWith(...) must be descendant nodes.");
2905 AllArgsDecayedAreUnique<Args...>::value,
2906 "Found duplicate types among the arguments passed to copyWith(...). "
2907 "Types should be listed at most once.");
2910 copy.set(std::forward<Args>(args)...);
2936 m_platform.
set(value);
2943 m_platform.
set(value);
2950 m_platform.
set(value);
2957 m_platform.
set(value);
2964 m_platform.
set(value);
2971 m_platform.
set(value);
2978 return m_userToolchain;
2984 return m_userToolchain;
2990 m_userToolchain = value;
2997 m_userToolchain.
set(value);
3004 m_userToolchain.
set(value);
3011 m_userToolchain.
set(value);
3018 m_userToolchain.
set(value);
3025 m_userToolchain.
set(value);
3032 m_userToolchain.
set(value);
3039 m_userToolchain.
set(value);
3064 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform>::value,
int>::type = 0>
3072 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU>::value,
int>::type = 0>
3080 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value,
int>::
3089 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value,
int>::type =
3098 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS>::value,
int>::type = 0>
3106 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value,
int>::type = 0>
3114 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value,
int>::type = 0>
3122 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain>::value,
int>::type = 0>
3125 return m_userToolchain;
3130 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler>::value,
int>::type =
3139 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value,
int>::
3149 enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
int>::type = 0>
3157 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::CxxStandard>::value,
int>::
3166 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary>::value,
int>::
3175 typename std::enable_if<
3176 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
3185 typename std::enable_if<
3186 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
3195 typename std::enable_if<std::is_same<T, EnvironmentInfo::Wrapper>::value,
int>::type = 0>
3201 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3207 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3210 return m_userToolchain;
3213 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3220 template<
typename F>
3229 template<
typename F>
3253 void save(
const std::string &fileName)
const;
3256 void load(
const std::string &fileName);
3259 void setFromString(
const std::string &value);
3261 void setFromString(
const std::string &fullPath,
const std::string &value);
3263 std::string getString(
const std::string &fullPath)
const;
3274 struct EnvironmentInfo::Version<1>
3294 const std::vector<uint8_t> &data);
3300# pragma warning(pop)
3304# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
3309 struct tuple_size<
Zivid::Detail::EnvironmentInfo::Platform> : integral_constant<size_t, 2>
3313 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::Platform>
3315 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform>::value,
"Index must be less than 2");
3318 =
decltype(declval<Zivid::Detail::EnvironmentInfo::Platform>().get<i>());
3322 struct tuple_size<
Zivid::Detail::EnvironmentInfo::Platform::CPU> : integral_constant<size_t, 2>
3326 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::Platform::CPU>
3329 i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform::CPU>::value,
3330 "Index must be less than 2");
3333 =
decltype(declval<Zivid::Detail::EnvironmentInfo::Platform::CPU>().get<i>());
3337 struct tuple_size<
Zivid::Detail::EnvironmentInfo::Platform::OS> : integral_constant<size_t, 2>
3341 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::Platform::OS>
3343 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform::OS>::value,
"Index must be less than 2");
3346 =
decltype(declval<Zivid::Detail::EnvironmentInfo::Platform::OS>().get<i>());
3350 struct tuple_size<
Zivid::Detail::EnvironmentInfo::UserToolchain> : integral_constant<size_t, 3>
3354 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::UserToolchain>
3357 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain>::value,
3358 "Index must be less than 3");
3361 =
decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain>().get<i>());
3365 struct tuple_size<
Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler> : integral_constant<size_t, 2>
3369 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>
3372 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>::value,
3373 "Index must be less than 2");
3376 =
decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>().get<i>());
3380 struct tuple_size<
Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary> : integral_constant<size_t, 2>
3384 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>
3387 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>::value,
3388 "Index must be less than 2");
3391 =
decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>().get<i>());
3395 struct tuple_size<
Zivid::Detail::EnvironmentInfo> : integral_constant<size_t, 3>
3399 struct tuple_element<i,
Zivid::Detail::EnvironmentInfo>
3401 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo>::value,
"Index must be less than 3");
3404 =
decltype(declval<Zivid::Detail::EnvironmentInfo>().get<i>());
3413#if defined(__has_include) && !defined(NO_DOC)
3414# if __has_include("Zivid/Detail/EnvironmentInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
3415# include "Zivid/Detail/EnvironmentInfoInternal.h"
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
The wrapper being used, if any.
Definition EnvironmentInfo.h:2633
static const Wrapper genicam
genicam
Definition EnvironmentInfo.h:2661
static const Wrapper dotnet
dotnet
Definition EnvironmentInfo.h:2660
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:2649
static const Wrapper python
python
Definition EnvironmentInfo.h:2659
static const Wrapper ros2
ros2
Definition EnvironmentInfo.h:2663
ValueType value() const
Get the value.
bool operator==(const Wrapper &other) const
Comparison operator.
Definition EnvironmentInfo.h:2694
friend std::ostream & operator<<(std::ostream &stream, const Wrapper &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:2706
bool operator!=(const Wrapper &other) const
Comparison operator.
Definition EnvironmentInfo.h:2700
static const Wrapper studio
studio
Definition EnvironmentInfo.h:2664
Wrapper()=default
Default constructor.
static std::set< ValueType > validValues()
All valid values of Wrapper.
Definition EnvironmentInfo.h:2667
friend std::ostream & operator<<(std::ostream &stream, const Wrapper::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:2688
static const Wrapper none
none
Definition EnvironmentInfo.h:2658
std::string toString() const
Get the value as string.
constexpr Wrapper(ValueType value)
Constructor.
Definition EnvironmentInfo.h:2677
static const Wrapper ros1
ros1
Definition EnvironmentInfo.h:2662
Information about the current toolchain and platform.
Definition EnvironmentInfo.h:80
bool operator==(const EnvironmentInfo &other) const
Equality operator.
EnvironmentInfo & set(const UserToolchain::StandardLibrary::ID &value)
Set UserToolchain::StandardLibrary::ID.
Definition EnvironmentInfo.h:3030
const EnvironmentInfo::Platform::OS::Version & get() const
Definition EnvironmentInfo.h:3115
EnvironmentInfo & set(const Platform::OS &value)
Set Platform::OS.
Definition EnvironmentInfo.h:2955
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:2895
Wrapper & wrapper()
Get Wrapper.
Definition EnvironmentInfo.h:3050
void save(const std::string &fileName) const
Save to the given file.
static EnvironmentInfo fromSerialized(const std::string &value)
Construct a new EnvironmentInfo instance from a previously serialized string.
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:3221
EnvironmentInfo & set(const Platform::CPU &value)
Set Platform::CPU.
Definition EnvironmentInfo.h:2934
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:3230
const EnvironmentInfo::Platform::OS & get() const
Definition EnvironmentInfo.h:3099
const EnvironmentInfo::Platform::CPU & get() const
Definition EnvironmentInfo.h:3073
const EnvironmentInfo::Wrapper & get() const
Definition EnvironmentInfo.h:3196
EnvironmentInfo & set(const UserToolchain &value)
Set UserToolchain.
Definition EnvironmentInfo.h:2988
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:2731
EnvironmentInfo & set(const UserToolchain::StandardLibrary::Version &value)
Set UserToolchain::StandardLibrary::Version.
Definition EnvironmentInfo.h:3037
const EnvironmentInfo::Platform::OS::ID & get() const
Definition EnvironmentInfo.h:3107
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:2941
const EnvironmentInfo::Platform::CPU::Architecture & get() const
Definition EnvironmentInfo.h:3082
const Platform & platform() const
Get Platform.
Definition EnvironmentInfo.h:2915
EnvironmentInfo & set(const UserToolchain::Compiler::ID &value)
Set UserToolchain::Compiler::ID.
Definition EnvironmentInfo.h:3002
EnvironmentInfo & set(const Platform::OS::Version &value)
Set Platform::OS::Version.
Definition EnvironmentInfo.h:2969
const EnvironmentInfo::UserToolchain & get() const
Definition EnvironmentInfo.h:3123
EnvironmentInfo & set(const Platform &value)
Set Platform.
Definition EnvironmentInfo.h:2927
const EnvironmentInfo::UserToolchain::CxxStandard & get() const
Definition EnvironmentInfo.h:3159
EnvironmentInfo & set(const UserToolchain::Compiler &value)
Set UserToolchain::Compiler.
Definition EnvironmentInfo.h:2995
const EnvironmentInfo::UserToolchain::StandardLibrary::Version & get() const
Definition EnvironmentInfo.h:3188
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:2848
const EnvironmentInfo::UserToolchain::Compiler::Version & get() const
Definition EnvironmentInfo.h:3150
const EnvironmentInfo::UserToolchain::Compiler::ID & get() const
Definition EnvironmentInfo.h:3141
const EnvironmentInfo::UserToolchain::Compiler & get() const
Definition EnvironmentInfo.h:3132
EnvironmentInfo & set(const UserToolchain::CxxStandard &value)
Set UserToolchain::CxxStandard.
Definition EnvironmentInfo.h:3016
EnvironmentInfo & set(const UserToolchain::StandardLibrary &value)
Set UserToolchain::StandardLibrary.
Definition EnvironmentInfo.h:3023
const EnvironmentInfo::UserToolchain::StandardLibrary::ID & get() const
Definition EnvironmentInfo.h:3178
std::string toString() const
Get the value as string.
EnvironmentInfo & set(const Platform::CPU::ModelName &value)
Set Platform::CPU::ModelName.
Definition EnvironmentInfo.h:2948
const EnvironmentInfo::Platform & get() const
Definition EnvironmentInfo.h:3065
const EnvironmentInfo::UserToolchain::StandardLibrary & get() const
Definition EnvironmentInfo.h:3168
friend std::ostream & operator<<(std::ostream &stream, const EnvironmentInfo &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:3247
UserToolchain & userToolchain()
Get UserToolchain.
Definition EnvironmentInfo.h:2982
EnvironmentInfo & set(const UserToolchain::Compiler::Version &value)
Set UserToolchain::Compiler::Version.
Definition EnvironmentInfo.h:3009
bool operator!=(const EnvironmentInfo &other) const
Inequality operator.
const Wrapper & wrapper() const
Get Wrapper.
Definition EnvironmentInfo.h:3044
const EnvironmentInfo::Platform::CPU::ModelName & get() const
Definition EnvironmentInfo.h:3091
const UserToolchain & userToolchain() const
Get UserToolchain.
Definition EnvironmentInfo.h:2976
Platform & platform()
Get Platform.
Definition EnvironmentInfo.h:2921
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:2962
EnvironmentInfo & set(const Wrapper &value)
Set Wrapper.
Definition EnvironmentInfo.h:3056
Class describing a range of values for a given type T.
Definition Range.h:75
NodeType
Definition NodeType.h:49
Definition EnvironmentInfo.h:74
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:84