Zivid C++ API 2.14.0+e4a0c4a9-1
EnvironmentInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2024 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <set>
53#include <sstream>
54#include <string>
55#include <tuple>
56#include <utility>
57#include <vector>
58
64#include "Zivid/Range.h"
65
66#ifdef _MSC_VER
67# pragma warning(push)
68# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
69#endif
70
71namespace Zivid
72{
73 namespace Detail
74 {
75
77
78 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
80 {
81 public:
83 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
84
86 static constexpr const char *path{ "" };
87
89 static constexpr const char *name{ "EnvironmentInfo" };
90
92 static constexpr const char *description{
93 R"description(Information about the current toolchain and platform)description"
94 };
95
96 static constexpr size_t version{ 1 };
97
98#ifndef NO_DOC
99 template<size_t>
100 struct Version;
101
102 using LatestVersion = Zivid::Detail::EnvironmentInfo;
103
104 // Short identifier. This value is not guaranteed to be universally unique
105 // Todo(ZIVID-2808): Move this to internal DataModelExt header
106 static constexpr std::array<uint8_t, 3> binaryId{ 'e', 'v', 'm' };
107
108#endif
109
111
112 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
114 {
115 public:
117 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
118
120 static constexpr const char *path{ "Platform" };
121
123 static constexpr const char *name{ "Platform" };
124
126 static constexpr const char *description{
127 R"description(Information about the current platform)description"
128 };
129
131
132 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
134 {
135 public:
137 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
138
140 static constexpr const char *path{ "Platform/CPU" };
141
143 static constexpr const char *name{ "CPU" };
144
146 static constexpr const char *description{ R"description(Information about the CPU)description" };
147
149
150 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
152 {
153 public:
155 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
156
158 static constexpr const char *path{ "Platform/CPU/Architecture" };
159
161 static constexpr const char *name{ "Architecture" };
162
164 static constexpr const char *description{ R"description(CPU architecture)description" };
165
167 enum class ValueType
168 {
169 unknown,
170 amd64,
171 arm64
172 };
173 static const Architecture unknown;
174 static const Architecture amd64;
175 static const Architecture arm64;
176
178 static std::set<ValueType> validValues()
179 {
180 return { ValueType::unknown, ValueType::amd64, ValueType::arm64 };
181 }
182
184 Architecture() = default;
185
187 explicit constexpr Architecture(ValueType value)
188 : m_value{ verifyValue(value) }
189 {}
190
193
195 std::string toString() const;
196
198 friend std::ostream &operator<<(std::ostream &stream, const Architecture::ValueType &value)
199 {
200 return stream << Architecture{ value }.toString();
201 }
202
204 bool operator==(const Architecture &other) const
205 {
206 return m_value == other.m_value;
207 }
208
210 bool operator!=(const Architecture &other) const
211 {
212 return m_value != other.m_value;
213 }
214
216 friend std::ostream &operator<<(std::ostream &stream, const Architecture &value)
217 {
218 return stream << value.toString();
219 }
220
221 private:
222 void setFromString(const std::string &value);
223
224 constexpr ValueType static verifyValue(const ValueType &value)
225 {
226 return value == ValueType::unknown || value == ValueType::amd64 || value == ValueType::arm64
227 ? value
228 : throw std::invalid_argument{
229 "Invalid value: Architecture{ "
230 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
231 + " }"
232 };
233 }
234
235 ValueType m_value{ ValueType::unknown };
236
237 friend struct DataModel::Detail::Befriend<Architecture>;
238 };
239
241
242 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
244 {
245 public:
247 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
248
250 static constexpr const char *path{ "Platform/CPU/ModelName" };
251
253 static constexpr const char *name{ "ModelName" };
254
256 static constexpr const char *description{ R"description(CPU model name)description" };
257
259 using ValueType = std::string;
260
263 {
264 return { 0, std::numeric_limits<ValueType::size_type>::max() };
265 }
266
268 ModelName() = default;
269
271 explicit ModelName(std::string value)
272 : m_value{ std::move(value) }
273 {}
274
276 const std::string &value() const;
277
279 std::string toString() const;
280
282 bool operator==(const ModelName &other) const
283 {
284 return m_value == other.m_value;
285 }
286
288 bool operator!=(const ModelName &other) const
289 {
290 return m_value != other.m_value;
291 }
292
294 bool operator<(const ModelName &other) const
295 {
296 return m_value < other.m_value;
297 }
298
300 bool operator>(const ModelName &other) const
301 {
302 return m_value > other.m_value;
303 }
304
306 bool operator<=(const ModelName &other) const
307 {
308 return m_value <= other.m_value;
309 }
310
312 bool operator>=(const ModelName &other) const
313 {
314 return m_value >= other.m_value;
315 }
316
318 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
319 {
320 return stream << value.toString();
321 }
322
323 private:
324 void setFromString(const std::string &value);
325
326 std::string m_value{ "unknown" };
327
328 friend struct DataModel::Detail::Befriend<ModelName>;
329 };
330
331 using Descendants = std::
332 tuple<EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName>;
333
336
349#ifndef NO_DOC
350 template<
351 typename... Args,
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,
356 int>::type = 0>
357#else
358 template<typename... Args>
359#endif
360 explicit CPU(Args &&...args)
361 {
362 using namespace Zivid::Detail::TypeTraits;
363
364 static_assert(
365 AllArgsDecayedAreUnique<Args...>::value,
366 "Found duplicate types among the arguments passed to CPU(...). "
367 "Types should be listed at most once.");
368
369 set(std::forward<Args>(args)...);
370 }
371
383#ifndef NO_DOC
384 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
385#else
386 template<typename... Args>
387#endif
388 void set(Args &&...args)
389 {
390 using namespace Zivid::Detail::TypeTraits;
391
392 using AllArgsAreDescendantNodes =
393 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
394 static_assert(
395 AllArgsAreDescendantNodes::value,
396 "All arguments passed to set(...) must be descendant nodes.");
397
398 static_assert(
399 AllArgsDecayedAreUnique<Args...>::value,
400 "Found duplicate types among the arguments passed to set(...). "
401 "Types should be listed at most once.");
402
403 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
404 }
405
418#ifndef NO_DOC
419 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
420#else
421 template<typename... Args>
422#endif
423 CPU copyWith(Args &&...args) const
424 {
425 using namespace Zivid::Detail::TypeTraits;
426
427 using AllArgsAreDescendantNodes =
428 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
429 static_assert(
430 AllArgsAreDescendantNodes::value,
431 "All arguments passed to copyWith(...) must be descendant nodes.");
432
433 static_assert(
434 AllArgsDecayedAreUnique<Args...>::value,
435 "Found duplicate types among the arguments passed to copyWith(...). "
436 "Types should be listed at most once.");
437
438 auto copy{ *this };
439 copy.set(std::forward<Args>(args)...);
440 return copy;
441 }
442
445 {
446 return m_architecture;
447 }
448
451 {
452 return m_architecture;
453 }
454
456 CPU &set(const Architecture &value)
457 {
458 m_architecture = value;
459 return *this;
460 }
461
463 const ModelName &modelName() const
464 {
465 return m_modelName;
466 }
467
470 {
471 return m_modelName;
472 }
473
475 CPU &set(const ModelName &value)
476 {
477 m_modelName = value;
478 return *this;
479 }
480
481 template<
482 typename T,
483 typename std::enable_if<
484 std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value,
485 int>::type = 0>
487 {
488 return m_architecture;
489 }
490
491 template<
492 typename T,
493 typename std::
494 enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value, int>::type = 0>
496 {
497 return m_modelName;
498 }
499
500 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
502 {
503 return m_architecture;
504 }
505
506 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
508 {
509 return m_modelName;
510 }
511
513 template<typename F>
514 void forEach(const F &f) const
515 {
516 f(m_architecture);
517 f(m_modelName);
518 }
519
521 template<typename F>
522 void forEach(const F &f)
523 {
524 f(m_architecture);
525 f(m_modelName);
526 }
527
529 bool operator==(const CPU &other) const;
530
532 bool operator!=(const CPU &other) const;
533
535 std::string toString() const;
536
538 friend std::ostream &operator<<(std::ostream &stream, const CPU &value)
539 {
540 return stream << value.toString();
541 }
542
543 private:
544 void setFromString(const std::string &value);
545
546 void setFromString(const std::string &fullPath, const std::string &value);
547
548 std::string getString(const std::string &fullPath) const;
549
550 Architecture m_architecture;
551 ModelName m_modelName;
552
553 friend struct DataModel::Detail::Befriend<CPU>;
554 };
555
557
558 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
560 {
561 public:
563 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
564
566 static constexpr const char *path{ "Platform/OS" };
567
569 static constexpr const char *name{ "OS" };
570
572 static constexpr const char *description{
573 R"description(Operation system name and version)description"
574 };
575
577
578 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
580 {
581 public:
583 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
584
586 static constexpr const char *path{ "Platform/OS/ID" };
587
589 static constexpr const char *name{ "ID" };
590
592 static constexpr const char *description{ R"description(Operating system name)description" };
593
595 enum class ValueType
596 {
597 unknown,
598 windows,
599 gnulinux
600 };
601 static const ID unknown;
602 static const ID windows;
603 static const ID gnulinux;
604
606 static std::set<ValueType> validValues()
607 {
608 return { ValueType::unknown, ValueType::windows, ValueType::gnulinux };
609 }
610
612 ID() = default;
613
615 explicit constexpr ID(ValueType value)
616 : m_value{ verifyValue(value) }
617 {}
618
621
623 std::string toString() const;
624
626 friend std::ostream &operator<<(std::ostream &stream, const ID::ValueType &value)
627 {
628 return stream << ID{ value }.toString();
629 }
630
632 bool operator==(const ID &other) const
633 {
634 return m_value == other.m_value;
635 }
636
638 bool operator!=(const ID &other) const
639 {
640 return m_value != other.m_value;
641 }
642
644 friend std::ostream &operator<<(std::ostream &stream, const ID &value)
645 {
646 return stream << value.toString();
647 }
648
649 private:
650 void setFromString(const std::string &value);
651
652 constexpr ValueType static verifyValue(const ValueType &value)
653 {
654 return value == ValueType::unknown || value == ValueType::windows
655 || value == ValueType::gnulinux
656 ? value
657 : throw std::invalid_argument{
658 "Invalid value: ID{ "
659 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
660 + " }"
661 };
662 }
663
664 ValueType m_value{ ValueType::unknown };
665
666 friend struct DataModel::Detail::Befriend<ID>;
667 };
668
670
671 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
673 {
674 public:
676 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
677
679 static constexpr const char *path{ "Platform/OS/Version" };
680
682 static constexpr const char *name{ "Version" };
683
685 static constexpr const char *description{ R"description(Operating system version)description" };
686
688 using ValueType = std::string;
689
692 {
693 return { 0, std::numeric_limits<ValueType::size_type>::max() };
694 }
695
697 Version() = default;
698
700 explicit Version(std::string value)
701 : m_value{ std::move(value) }
702 {}
703
705 const std::string &value() const;
706
708 std::string toString() const;
709
711 bool operator==(const Version &other) const
712 {
713 return m_value == other.m_value;
714 }
715
717 bool operator!=(const Version &other) const
718 {
719 return m_value != other.m_value;
720 }
721
723 bool operator<(const Version &other) const
724 {
725 return m_value < other.m_value;
726 }
727
729 bool operator>(const Version &other) const
730 {
731 return m_value > other.m_value;
732 }
733
735 bool operator<=(const Version &other) const
736 {
737 return m_value <= other.m_value;
738 }
739
741 bool operator>=(const Version &other) const
742 {
743 return m_value >= other.m_value;
744 }
745
747 friend std::ostream &operator<<(std::ostream &stream, const Version &value)
748 {
749 return stream << value.toString();
750 }
751
752 private:
753 void setFromString(const std::string &value);
754
755 std::string m_value{ "unknown" };
756
757 friend struct DataModel::Detail::Befriend<Version>;
758 };
759
761 std::tuple<EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version>;
762
764 OS();
765
778#ifndef NO_DOC
779 template<
780 typename... Args,
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,
785 int>::type = 0>
786#else
787 template<typename... Args>
788#endif
789 explicit OS(Args &&...args)
790 {
791 using namespace Zivid::Detail::TypeTraits;
792
793 static_assert(
794 AllArgsDecayedAreUnique<Args...>::value,
795 "Found duplicate types among the arguments passed to OS(...). "
796 "Types should be listed at most once.");
797
798 set(std::forward<Args>(args)...);
799 }
800
812#ifndef NO_DOC
813 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
814#else
815 template<typename... Args>
816#endif
817 void set(Args &&...args)
818 {
819 using namespace Zivid::Detail::TypeTraits;
820
821 using AllArgsAreDescendantNodes =
822 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
823 static_assert(
824 AllArgsAreDescendantNodes::value,
825 "All arguments passed to set(...) must be descendant nodes.");
826
827 static_assert(
828 AllArgsDecayedAreUnique<Args...>::value,
829 "Found duplicate types among the arguments passed to set(...). "
830 "Types should be listed at most once.");
831
832 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
833 }
834
847#ifndef NO_DOC
848 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
849#else
850 template<typename... Args>
851#endif
852 OS copyWith(Args &&...args) const
853 {
854 using namespace Zivid::Detail::TypeTraits;
855
856 using AllArgsAreDescendantNodes =
857 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
858 static_assert(
859 AllArgsAreDescendantNodes::value,
860 "All arguments passed to copyWith(...) must be descendant nodes.");
861
862 static_assert(
863 AllArgsDecayedAreUnique<Args...>::value,
864 "Found duplicate types among the arguments passed to copyWith(...). "
865 "Types should be listed at most once.");
866
867 auto copy{ *this };
868 copy.set(std::forward<Args>(args)...);
869 return copy;
870 }
871
873 const ID &id() const
874 {
875 return m_id;
876 }
877
880 {
881 return m_id;
882 }
883
885 OS &set(const ID &value)
886 {
887 m_id = value;
888 return *this;
889 }
890
892 const Version &version() const
893 {
894 return m_version;
895 }
896
899 {
900 return m_version;
901 }
902
904 OS &set(const Version &value)
905 {
906 m_version = value;
907 return *this;
908 }
909
910 template<
911 typename T,
912 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value, int>::type =
913 0>
915 {
916 return m_id;
917 }
918
919 template<
920 typename T,
921 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value, int>::
922 type = 0>
924 {
925 return m_version;
926 }
927
928 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
930 {
931 return m_id;
932 }
933
934 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
936 {
937 return m_version;
938 }
939
941 template<typename F>
942 void forEach(const F &f) const
943 {
944 f(m_id);
945 f(m_version);
946 }
947
949 template<typename F>
950 void forEach(const F &f)
951 {
952 f(m_id);
953 f(m_version);
954 }
955
957 bool operator==(const OS &other) const;
958
960 bool operator!=(const OS &other) const;
961
963 std::string toString() const;
964
966 friend std::ostream &operator<<(std::ostream &stream, const OS &value)
967 {
968 return stream << value.toString();
969 }
970
971 private:
972 void setFromString(const std::string &value);
973
974 void setFromString(const std::string &fullPath, const std::string &value);
975
976 std::string getString(const std::string &fullPath) const;
977
978 ID m_id;
979 Version m_version;
980
981 friend struct DataModel::Detail::Befriend<OS>;
982 };
983
984 using Descendants = std::tuple<
991
994
1011#ifndef NO_DOC
1012 template<
1013 typename... Args,
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...>::
1017 value,
1018 int>::type = 0>
1019#else
1020 template<typename... Args>
1021#endif
1022 explicit Platform(Args &&...args)
1023 {
1024 using namespace Zivid::Detail::TypeTraits;
1025
1026 static_assert(
1027 AllArgsDecayedAreUnique<Args...>::value,
1028 "Found duplicate types among the arguments passed to Platform(...). "
1029 "Types should be listed at most once.");
1030
1031 set(std::forward<Args>(args)...);
1032 }
1033
1049#ifndef NO_DOC
1050 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1051#else
1052 template<typename... Args>
1053#endif
1054 void set(Args &&...args)
1055 {
1056 using namespace Zivid::Detail::TypeTraits;
1057
1058 using AllArgsAreDescendantNodes =
1059 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1060 static_assert(
1061 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1062
1063 static_assert(
1064 AllArgsDecayedAreUnique<Args...>::value,
1065 "Found duplicate types among the arguments passed to set(...). "
1066 "Types should be listed at most once.");
1067
1068 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1069 }
1070
1087#ifndef NO_DOC
1088 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1089#else
1090 template<typename... Args>
1091#endif
1092 Platform copyWith(Args &&...args) const
1093 {
1094 using namespace Zivid::Detail::TypeTraits;
1095
1096 using AllArgsAreDescendantNodes =
1097 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1098 static_assert(
1099 AllArgsAreDescendantNodes::value,
1100 "All arguments passed to copyWith(...) must be descendant nodes.");
1101
1102 static_assert(
1103 AllArgsDecayedAreUnique<Args...>::value,
1104 "Found duplicate types among the arguments passed to copyWith(...). "
1105 "Types should be listed at most once.");
1106
1107 auto copy{ *this };
1108 copy.set(std::forward<Args>(args)...);
1109 return copy;
1110 }
1111
1113 const CPU &cpu() const
1114 {
1115 return m_cpu;
1116 }
1117
1120 {
1121 return m_cpu;
1122 }
1123
1125 Platform &set(const CPU &value)
1126 {
1127 m_cpu = value;
1128 return *this;
1129 }
1130
1133 {
1134 m_cpu.set(value);
1135 return *this;
1136 }
1137
1140 {
1141 m_cpu.set(value);
1142 return *this;
1143 }
1144
1146 const OS &os() const
1147 {
1148 return m_os;
1149 }
1150
1153 {
1154 return m_os;
1155 }
1156
1158 Platform &set(const OS &value)
1159 {
1160 m_os = value;
1161 return *this;
1162 }
1163
1165 Platform &set(const OS::ID &value)
1166 {
1167 m_os.set(value);
1168 return *this;
1169 }
1170
1172 Platform &set(const OS::Version &value)
1173 {
1174 m_os.set(value);
1175 return *this;
1176 }
1177
1178 template<
1179 typename T,
1180 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU>::value, int>::type = 0>
1182 {
1183 return m_cpu;
1184 }
1185
1186 template<
1187 typename T,
1188 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value, int>::
1189 type = 0>
1191 {
1193 }
1194
1195 template<
1196 typename T,
1197 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value, int>::
1198 type = 0>
1200 {
1202 }
1203
1204 template<
1205 typename T,
1206 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS>::value, int>::type = 0>
1208 {
1209 return m_os;
1210 }
1211
1212 template<
1213 typename T,
1214 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value, int>::type = 0>
1216 {
1217 return m_os.get<EnvironmentInfo::Platform::OS::ID>();
1218 }
1219
1220 template<
1221 typename T,
1222 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value, int>::type =
1223 0>
1225 {
1226 return m_os.get<EnvironmentInfo::Platform::OS::Version>();
1227 }
1228
1229 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1231 {
1232 return m_cpu;
1233 }
1234
1235 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1237 {
1238 return m_os;
1239 }
1240
1242 template<typename F>
1243 void forEach(const F &f) const
1244 {
1245 f(m_cpu);
1246 f(m_os);
1247 }
1248
1250 template<typename F>
1251 void forEach(const F &f)
1252 {
1253 f(m_cpu);
1254 f(m_os);
1255 }
1256
1258 bool operator==(const Platform &other) const;
1259
1261 bool operator!=(const Platform &other) const;
1262
1264 std::string toString() const;
1265
1267 friend std::ostream &operator<<(std::ostream &stream, const Platform &value)
1268 {
1269 return stream << value.toString();
1270 }
1271
1272 private:
1273 void setFromString(const std::string &value);
1274
1275 void setFromString(const std::string &fullPath, const std::string &value);
1276
1277 std::string getString(const std::string &fullPath) const;
1278
1279 CPU m_cpu;
1280 OS m_os;
1281
1282 friend struct DataModel::Detail::Befriend<Platform>;
1283 };
1284
1286
1287 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1289 {
1290 public:
1292 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1293
1295 static constexpr const char *path{ "UserToolchain" };
1296
1298 static constexpr const char *name{ "UserToolchain" };
1299
1301 static constexpr const char *description{
1302 R"description(Information about the current toolchain)description"
1303 };
1304
1306
1307 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1309 {
1310 public:
1312 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1313
1315 static constexpr const char *path{ "UserToolchain/Compiler" };
1316
1318 static constexpr const char *name{ "Compiler" };
1319
1321 static constexpr const char *description{
1322 R"description(Information about which compiler is being used)description"
1323 };
1324
1326
1327 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1329 {
1330 public:
1332 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1333
1335 static constexpr const char *path{ "UserToolchain/Compiler/ID" };
1336
1338 static constexpr const char *name{ "ID" };
1339
1341 static constexpr const char *description{ R"description(The name of the compiler)description" };
1342
1344 enum class ValueType
1345 {
1346 unknown,
1347 msvc,
1348 clang,
1349 gcc,
1350 intel,
1351 mingwGcc,
1352 mingwClang,
1353 mingwUnknown
1354 };
1355 static const ID unknown;
1356 static const ID msvc;
1357 static const ID clang;
1358 static const ID gcc;
1359 static const ID intel;
1360 static const ID mingwGcc;
1361 static const ID mingwClang;
1362 static const ID mingwUnknown;
1363
1365 static std::set<ValueType> validValues()
1366 {
1367 return { ValueType::unknown, ValueType::msvc, ValueType::clang,
1368 ValueType::gcc, ValueType::intel, ValueType::mingwGcc,
1369 ValueType::mingwClang, ValueType::mingwUnknown };
1370 }
1371
1373 ID() = default;
1374
1376 explicit constexpr ID(ValueType value)
1377 : m_value{ verifyValue(value) }
1378 {}
1379
1382
1384 std::string toString() const;
1385
1387 friend std::ostream &operator<<(std::ostream &stream, const ID::ValueType &value)
1388 {
1389 return stream << ID{ value }.toString();
1390 }
1391
1393 bool operator==(const ID &other) const
1394 {
1395 return m_value == other.m_value;
1396 }
1397
1399 bool operator!=(const ID &other) const
1400 {
1401 return m_value != other.m_value;
1402 }
1403
1405 friend std::ostream &operator<<(std::ostream &stream, const ID &value)
1406 {
1407 return stream << value.toString();
1408 }
1409
1410 private:
1411 void setFromString(const std::string &value);
1412
1413 constexpr ValueType static verifyValue(const ValueType &value)
1414 {
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
1419 ? value
1420 : throw std::invalid_argument{
1421 "Invalid value: ID{ "
1422 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
1423 + " }"
1424 };
1425 }
1426
1427 ValueType m_value{ ValueType::unknown };
1428
1429 friend struct DataModel::Detail::Befriend<ID>;
1430 };
1431
1433
1434 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1436 {
1437 public:
1439 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1440
1442 static constexpr const char *path{ "UserToolchain/Compiler/Version" };
1443
1445 static constexpr const char *name{ "Version" };
1446
1448 static constexpr const char *description{
1449 R"description(The version of the compiler)description"
1450 };
1451
1453 using ValueType = std::string;
1454
1457 {
1458 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1459 }
1460
1462 Version() = default;
1463
1465 explicit Version(std::string value)
1466 : m_value{ std::move(value) }
1467 {}
1468
1470 const std::string &value() const;
1471
1473 std::string toString() const;
1474
1476 bool operator==(const Version &other) const
1477 {
1478 return m_value == other.m_value;
1479 }
1480
1482 bool operator!=(const Version &other) const
1483 {
1484 return m_value != other.m_value;
1485 }
1486
1488 bool operator<(const Version &other) const
1489 {
1490 return m_value < other.m_value;
1491 }
1492
1494 bool operator>(const Version &other) const
1495 {
1496 return m_value > other.m_value;
1497 }
1498
1500 bool operator<=(const Version &other) const
1501 {
1502 return m_value <= other.m_value;
1503 }
1504
1506 bool operator>=(const Version &other) const
1507 {
1508 return m_value >= other.m_value;
1509 }
1510
1512 friend std::ostream &operator<<(std::ostream &stream, const Version &value)
1513 {
1514 return stream << value.toString();
1515 }
1516
1517 private:
1518 void setFromString(const std::string &value);
1519
1520 std::string m_value{ "unknown" };
1521
1522 friend struct DataModel::Detail::Befriend<Version>;
1523 };
1524
1525 using Descendants = std::tuple<
1528
1531
1544#ifndef NO_DOC
1545 template<
1546 typename... Args,
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,
1551 int>::type = 0>
1552#else
1553 template<typename... Args>
1554#endif
1555 explicit Compiler(Args &&...args)
1556 {
1557 using namespace Zivid::Detail::TypeTraits;
1558
1559 static_assert(
1560 AllArgsDecayedAreUnique<Args...>::value,
1561 "Found duplicate types among the arguments passed to Compiler(...). "
1562 "Types should be listed at most once.");
1563
1564 set(std::forward<Args>(args)...);
1565 }
1566
1578#ifndef NO_DOC
1579 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1580#else
1581 template<typename... Args>
1582#endif
1583 void set(Args &&...args)
1584 {
1585 using namespace Zivid::Detail::TypeTraits;
1586
1587 using AllArgsAreDescendantNodes =
1588 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1589 static_assert(
1590 AllArgsAreDescendantNodes::value,
1591 "All arguments passed to set(...) must be descendant nodes.");
1592
1593 static_assert(
1594 AllArgsDecayedAreUnique<Args...>::value,
1595 "Found duplicate types among the arguments passed to set(...). "
1596 "Types should be listed at most once.");
1597
1598 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1599 }
1600
1613#ifndef NO_DOC
1614 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1615#else
1616 template<typename... Args>
1617#endif
1618 Compiler copyWith(Args &&...args) const
1619 {
1620 using namespace Zivid::Detail::TypeTraits;
1621
1622 using AllArgsAreDescendantNodes =
1623 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1624 static_assert(
1625 AllArgsAreDescendantNodes::value,
1626 "All arguments passed to copyWith(...) must be descendant nodes.");
1627
1628 static_assert(
1629 AllArgsDecayedAreUnique<Args...>::value,
1630 "Found duplicate types among the arguments passed to copyWith(...). "
1631 "Types should be listed at most once.");
1632
1633 auto copy{ *this };
1634 copy.set(std::forward<Args>(args)...);
1635 return copy;
1636 }
1637
1639 const ID &id() const
1640 {
1641 return m_id;
1642 }
1643
1646 {
1647 return m_id;
1648 }
1649
1651 Compiler &set(const ID &value)
1652 {
1653 m_id = value;
1654 return *this;
1655 }
1656
1658 const Version &version() const
1659 {
1660 return m_version;
1661 }
1662
1665 {
1666 return m_version;
1667 }
1668
1670 Compiler &set(const Version &value)
1671 {
1672 m_version = value;
1673 return *this;
1674 }
1675
1676 template<
1677 typename T,
1678 typename std::enable_if<
1679 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value,
1680 int>::type = 0>
1682 {
1683 return m_id;
1684 }
1685
1686 template<
1687 typename T,
1688 typename std::enable_if<
1689 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
1690 int>::type = 0>
1692 {
1693 return m_version;
1694 }
1695
1696 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1698 {
1699 return m_id;
1700 }
1701
1702 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1704 {
1705 return m_version;
1706 }
1707
1709 template<typename F>
1710 void forEach(const F &f) const
1711 {
1712 f(m_id);
1713 f(m_version);
1714 }
1715
1717 template<typename F>
1718 void forEach(const F &f)
1719 {
1720 f(m_id);
1721 f(m_version);
1722 }
1723
1725 bool operator==(const Compiler &other) const;
1726
1728 bool operator!=(const Compiler &other) const;
1729
1731 std::string toString() const;
1732
1734 friend std::ostream &operator<<(std::ostream &stream, const Compiler &value)
1735 {
1736 return stream << value.toString();
1737 }
1738
1739 private:
1740 void setFromString(const std::string &value);
1741
1742 void setFromString(const std::string &fullPath, const std::string &value);
1743
1744 std::string getString(const std::string &fullPath) const;
1745
1746 ID m_id;
1747 Version m_version;
1748
1749 friend struct DataModel::Detail::Befriend<Compiler>;
1750 };
1751
1753
1754 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1756 {
1757 public:
1759 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1760
1762 static constexpr const char *path{ "UserToolchain/CxxStandard" };
1763
1765 static constexpr const char *name{ "CxxStandard" };
1766
1768 static constexpr const char *description{ R"description(The C++ standard being used)description" };
1769
1771 using ValueType = std::string;
1772
1775 {
1776 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1777 }
1778
1780 CxxStandard() = default;
1781
1783 explicit CxxStandard(std::string value)
1784 : m_value{ std::move(value) }
1785 {}
1786
1788 const std::string &value() const;
1789
1791 std::string toString() const;
1792
1794 bool operator==(const CxxStandard &other) const
1795 {
1796 return m_value == other.m_value;
1797 }
1798
1800 bool operator!=(const CxxStandard &other) const
1801 {
1802 return m_value != other.m_value;
1803 }
1804
1806 bool operator<(const CxxStandard &other) const
1807 {
1808 return m_value < other.m_value;
1809 }
1810
1812 bool operator>(const CxxStandard &other) const
1813 {
1814 return m_value > other.m_value;
1815 }
1816
1818 bool operator<=(const CxxStandard &other) const
1819 {
1820 return m_value <= other.m_value;
1821 }
1822
1824 bool operator>=(const CxxStandard &other) const
1825 {
1826 return m_value >= other.m_value;
1827 }
1828
1830 friend std::ostream &operator<<(std::ostream &stream, const CxxStandard &value)
1831 {
1832 return stream << value.toString();
1833 }
1834
1835 private:
1836 void setFromString(const std::string &value);
1837
1838 std::string m_value{ "unknown" };
1839
1840 friend struct DataModel::Detail::Befriend<CxxStandard>;
1841 };
1842
1844
1845 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1847 {
1848 public:
1850 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1851
1853 static constexpr const char *path{ "UserToolchain/StandardLibrary" };
1854
1856 static constexpr const char *name{ "StandardLibrary" };
1857
1859 static constexpr const char *description{
1860 R"description(Information about what standard library implementation is being used)description"
1861 };
1862
1864
1865 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1867 {
1868 public:
1870 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1871
1873 static constexpr const char *path{ "UserToolchain/StandardLibrary/ID" };
1874
1876 static constexpr const char *name{ "ID" };
1877
1879 static constexpr const char *description{
1880 R"description(The name of the standard library implementation)description"
1881 };
1882
1884 enum class ValueType
1885 {
1886 unknown,
1887 msvc,
1888 libcxx,
1889 libstdcxx
1890 };
1891 static const ID unknown;
1892 static const ID msvc;
1893 static const ID libcxx;
1894 static const ID libstdcxx;
1895
1897 static std::set<ValueType> validValues()
1898 {
1899 return { ValueType::unknown, ValueType::msvc, ValueType::libcxx, ValueType::libstdcxx };
1900 }
1901
1903 ID() = default;
1904
1906 explicit constexpr ID(ValueType value)
1907 : m_value{ verifyValue(value) }
1908 {}
1909
1912
1914 std::string toString() const;
1915
1917 friend std::ostream &operator<<(std::ostream &stream, const ID::ValueType &value)
1918 {
1919 return stream << ID{ value }.toString();
1920 }
1921
1923 bool operator==(const ID &other) const
1924 {
1925 return m_value == other.m_value;
1926 }
1927
1929 bool operator!=(const ID &other) const
1930 {
1931 return m_value != other.m_value;
1932 }
1933
1935 friend std::ostream &operator<<(std::ostream &stream, const ID &value)
1936 {
1937 return stream << value.toString();
1938 }
1939
1940 private:
1941 void setFromString(const std::string &value);
1942
1943 constexpr ValueType static verifyValue(const ValueType &value)
1944 {
1945 return value == ValueType::unknown || value == ValueType::msvc || value == ValueType::libcxx
1946 || value == ValueType::libstdcxx
1947 ? value
1948 : throw std::invalid_argument{
1949 "Invalid value: ID{ "
1950 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
1951 + " }"
1952 };
1953 }
1954
1955 ValueType m_value{ ValueType::unknown };
1956
1957 friend struct DataModel::Detail::Befriend<ID>;
1958 };
1959
1961
1962 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1964 {
1965 public:
1967 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1968
1970 static constexpr const char *path{ "UserToolchain/StandardLibrary/Version" };
1971
1973 static constexpr const char *name{ "Version" };
1974
1976 static constexpr const char *description{
1977 R"description(The version of the standard library implementation)description"
1978 };
1979
1981 using ValueType = std::string;
1982
1985 {
1986 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1987 }
1988
1990 Version() = default;
1991
1993 explicit Version(std::string value)
1994 : m_value{ std::move(value) }
1995 {}
1996
1998 const std::string &value() const;
1999
2001 std::string toString() const;
2002
2004 bool operator==(const Version &other) const
2005 {
2006 return m_value == other.m_value;
2007 }
2008
2010 bool operator!=(const Version &other) const
2011 {
2012 return m_value != other.m_value;
2013 }
2014
2016 bool operator<(const Version &other) const
2017 {
2018 return m_value < other.m_value;
2019 }
2020
2022 bool operator>(const Version &other) const
2023 {
2024 return m_value > other.m_value;
2025 }
2026
2028 bool operator<=(const Version &other) const
2029 {
2030 return m_value <= other.m_value;
2031 }
2032
2034 bool operator>=(const Version &other) const
2035 {
2036 return m_value >= other.m_value;
2037 }
2038
2040 friend std::ostream &operator<<(std::ostream &stream, const Version &value)
2041 {
2042 return stream << value.toString();
2043 }
2044
2045 private:
2046 void setFromString(const std::string &value);
2047
2048 std::string m_value{ "unknown" };
2049
2050 friend struct DataModel::Detail::Befriend<Version>;
2051 };
2052
2053 using Descendants = std::tuple<
2056
2059
2072#ifndef NO_DOC
2073 template<
2074 typename... Args,
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,
2079 int>::type = 0>
2080#else
2081 template<typename... Args>
2082#endif
2083 explicit StandardLibrary(Args &&...args)
2084 {
2085 using namespace Zivid::Detail::TypeTraits;
2086
2087 static_assert(
2088 AllArgsDecayedAreUnique<Args...>::value,
2089 "Found duplicate types among the arguments passed to StandardLibrary(...). "
2090 "Types should be listed at most once.");
2091
2092 set(std::forward<Args>(args)...);
2093 }
2094
2106#ifndef NO_DOC
2107 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2108#else
2109 template<typename... Args>
2110#endif
2111 void set(Args &&...args)
2112 {
2113 using namespace Zivid::Detail::TypeTraits;
2114
2115 using AllArgsAreDescendantNodes =
2116 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2117 static_assert(
2118 AllArgsAreDescendantNodes::value,
2119 "All arguments passed to set(...) must be descendant nodes.");
2120
2121 static_assert(
2122 AllArgsDecayedAreUnique<Args...>::value,
2123 "Found duplicate types among the arguments passed to set(...). "
2124 "Types should be listed at most once.");
2125
2126 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2127 }
2128
2141#ifndef NO_DOC
2142 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2143#else
2144 template<typename... Args>
2145#endif
2146 StandardLibrary copyWith(Args &&...args) const
2147 {
2148 using namespace Zivid::Detail::TypeTraits;
2149
2150 using AllArgsAreDescendantNodes =
2151 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2152 static_assert(
2153 AllArgsAreDescendantNodes::value,
2154 "All arguments passed to copyWith(...) must be descendant nodes.");
2155
2156 static_assert(
2157 AllArgsDecayedAreUnique<Args...>::value,
2158 "Found duplicate types among the arguments passed to copyWith(...). "
2159 "Types should be listed at most once.");
2160
2161 auto copy{ *this };
2162 copy.set(std::forward<Args>(args)...);
2163 return copy;
2164 }
2165
2167 const ID &id() const
2168 {
2169 return m_id;
2170 }
2171
2174 {
2175 return m_id;
2176 }
2177
2179 StandardLibrary &set(const ID &value)
2180 {
2181 m_id = value;
2182 return *this;
2183 }
2184
2186 const Version &version() const
2187 {
2188 return m_version;
2189 }
2190
2193 {
2194 return m_version;
2195 }
2196
2199 {
2200 m_version = value;
2201 return *this;
2202 }
2203
2204 template<
2205 typename T,
2206 typename std::enable_if<
2207 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
2208 int>::type = 0>
2210 {
2211 return m_id;
2212 }
2213
2214 template<
2215 typename T,
2216 typename std::enable_if<
2217 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
2218 int>::type = 0>
2220 {
2221 return m_version;
2222 }
2223
2224 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2226 {
2227 return m_id;
2228 }
2229
2230 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2232 {
2233 return m_version;
2234 }
2235
2237 template<typename F>
2238 void forEach(const F &f) const
2239 {
2240 f(m_id);
2241 f(m_version);
2242 }
2243
2245 template<typename F>
2246 void forEach(const F &f)
2247 {
2248 f(m_id);
2249 f(m_version);
2250 }
2251
2253 bool operator==(const StandardLibrary &other) const;
2254
2256 bool operator!=(const StandardLibrary &other) const;
2257
2259 std::string toString() const;
2260
2262 friend std::ostream &operator<<(std::ostream &stream, const StandardLibrary &value)
2263 {
2264 return stream << value.toString();
2265 }
2266
2267 private:
2268 void setFromString(const std::string &value);
2269
2270 void setFromString(const std::string &fullPath, const std::string &value);
2271
2272 std::string getString(const std::string &fullPath) const;
2273
2274 ID m_id;
2275 Version m_version;
2276
2277 friend struct DataModel::Detail::Befriend<StandardLibrary>;
2278 };
2279
2280 using Descendants = std::tuple<
2288
2291
2309#ifndef NO_DOC
2310 template<
2311 typename... Args,
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...>::
2315 value,
2316 int>::type = 0>
2317#else
2318 template<typename... Args>
2319#endif
2320 explicit UserToolchain(Args &&...args)
2321 {
2322 using namespace Zivid::Detail::TypeTraits;
2323
2324 static_assert(
2325 AllArgsDecayedAreUnique<Args...>::value,
2326 "Found duplicate types among the arguments passed to UserToolchain(...). "
2327 "Types should be listed at most once.");
2328
2329 set(std::forward<Args>(args)...);
2330 }
2331
2348#ifndef NO_DOC
2349 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2350#else
2351 template<typename... Args>
2352#endif
2353 void set(Args &&...args)
2354 {
2355 using namespace Zivid::Detail::TypeTraits;
2356
2357 using AllArgsAreDescendantNodes =
2358 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2359 static_assert(
2360 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2361
2362 static_assert(
2363 AllArgsDecayedAreUnique<Args...>::value,
2364 "Found duplicate types among the arguments passed to set(...). "
2365 "Types should be listed at most once.");
2366
2367 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2368 }
2369
2387#ifndef NO_DOC
2388 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2389#else
2390 template<typename... Args>
2391#endif
2392 UserToolchain copyWith(Args &&...args) const
2393 {
2394 using namespace Zivid::Detail::TypeTraits;
2395
2396 using AllArgsAreDescendantNodes =
2397 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2398 static_assert(
2399 AllArgsAreDescendantNodes::value,
2400 "All arguments passed to copyWith(...) must be descendant nodes.");
2401
2402 static_assert(
2403 AllArgsDecayedAreUnique<Args...>::value,
2404 "Found duplicate types among the arguments passed to copyWith(...). "
2405 "Types should be listed at most once.");
2406
2407 auto copy{ *this };
2408 copy.set(std::forward<Args>(args)...);
2409 return copy;
2410 }
2411
2413 const Compiler &compiler() const
2414 {
2415 return m_compiler;
2416 }
2417
2420 {
2421 return m_compiler;
2422 }
2423
2426 {
2427 m_compiler = value;
2428 return *this;
2429 }
2430
2433 {
2434 m_compiler.set(value);
2435 return *this;
2436 }
2437
2440 {
2441 m_compiler.set(value);
2442 return *this;
2443 }
2444
2447 {
2448 return m_cxxStandard;
2449 }
2450
2453 {
2454 return m_cxxStandard;
2455 }
2456
2459 {
2460 m_cxxStandard = value;
2461 return *this;
2462 }
2463
2466 {
2467 return m_standardLibrary;
2468 }
2469
2472 {
2473 return m_standardLibrary;
2474 }
2475
2478 {
2479 m_standardLibrary = value;
2480 return *this;
2481 }
2482
2485 {
2486 m_standardLibrary.set(value);
2487 return *this;
2488 }
2489
2492 {
2493 m_standardLibrary.set(value);
2494 return *this;
2495 }
2496
2497 template<
2498 typename T,
2499 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler>::value, int>::
2500 type = 0>
2502 {
2503 return m_compiler;
2504 }
2505
2506 template<
2507 typename T,
2508 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value, int>::
2509 type = 0>
2511 {
2512 return m_compiler.get<EnvironmentInfo::UserToolchain::Compiler::ID>();
2513 }
2514
2515 template<
2516 typename T,
2517 typename std::enable_if<
2518 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
2519 int>::type = 0>
2521 {
2523 }
2524
2525 template<
2526 typename T,
2527 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::CxxStandard>::value, int>::
2528 type = 0>
2530 {
2531 return m_cxxStandard;
2532 }
2533
2534 template<
2535 typename T,
2536 typename std::enable_if<
2537 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary>::value,
2538 int>::type = 0>
2540 {
2541 return m_standardLibrary;
2542 }
2543
2544 template<
2545 typename T,
2546 typename std::enable_if<
2547 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
2548 int>::type = 0>
2550 {
2551 return m_standardLibrary.get<EnvironmentInfo::UserToolchain::StandardLibrary::ID>();
2552 }
2553
2554 template<
2555 typename T,
2556 typename std::enable_if<
2557 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
2558 int>::type = 0>
2560 {
2561 return m_standardLibrary.get<EnvironmentInfo::UserToolchain::StandardLibrary::Version>();
2562 }
2563
2564 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2566 {
2567 return m_compiler;
2568 }
2569
2570 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2572 {
2573 return m_cxxStandard;
2574 }
2575
2576 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2578 {
2579 return m_standardLibrary;
2580 }
2581
2583 template<typename F>
2584 void forEach(const F &f) const
2585 {
2586 f(m_compiler);
2587 f(m_cxxStandard);
2588 f(m_standardLibrary);
2589 }
2590
2592 template<typename F>
2593 void forEach(const F &f)
2594 {
2595 f(m_compiler);
2596 f(m_cxxStandard);
2597 f(m_standardLibrary);
2598 }
2599
2601 bool operator==(const UserToolchain &other) const;
2602
2604 bool operator!=(const UserToolchain &other) const;
2605
2607 std::string toString() const;
2608
2610 friend std::ostream &operator<<(std::ostream &stream, const UserToolchain &value)
2611 {
2612 return stream << value.toString();
2613 }
2614
2615 private:
2616 void setFromString(const std::string &value);
2617
2618 void setFromString(const std::string &fullPath, const std::string &value);
2619
2620 std::string getString(const std::string &fullPath) const;
2621
2622 Compiler m_compiler;
2623 CxxStandard m_cxxStandard;
2624 StandardLibrary m_standardLibrary;
2625
2626 friend struct DataModel::Detail::Befriend<UserToolchain>;
2627 };
2628
2630
2631 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2633 {
2634 public:
2636 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
2637
2639 static constexpr const char *path{ "Wrapper" };
2640
2642 static constexpr const char *name{ "Wrapper" };
2643
2645 static constexpr const char *description{ R"description(The wrapper being used, if any)description" };
2646
2648 enum class ValueType
2649 {
2650 none,
2651 python,
2652 dotnet,
2653 genicam,
2654 ros1,
2655 ros2,
2656 studio
2657 };
2658 static const Wrapper none;
2659 static const Wrapper python;
2660 static const Wrapper dotnet;
2661 static const Wrapper genicam;
2662 static const Wrapper ros1;
2663 static const Wrapper ros2;
2664 static const Wrapper studio;
2665
2667 static std::set<ValueType> validValues()
2668 {
2669 return { ValueType::none, ValueType::python, ValueType::dotnet, ValueType::genicam,
2670 ValueType::ros1, ValueType::ros2, ValueType::studio };
2671 }
2672
2674 Wrapper() = default;
2675
2677 explicit constexpr Wrapper(ValueType value)
2678 : m_value{ verifyValue(value) }
2679 {}
2680
2683
2685 std::string toString() const;
2686
2688 friend std::ostream &operator<<(std::ostream &stream, const Wrapper::ValueType &value)
2689 {
2690 return stream << Wrapper{ value }.toString();
2691 }
2692
2694 bool operator==(const Wrapper &other) const
2695 {
2696 return m_value == other.m_value;
2697 }
2698
2700 bool operator!=(const Wrapper &other) const
2701 {
2702 return m_value != other.m_value;
2703 }
2704
2706 friend std::ostream &operator<<(std::ostream &stream, const Wrapper &value)
2707 {
2708 return stream << value.toString();
2709 }
2710
2711 private:
2712 void setFromString(const std::string &value);
2713
2714 constexpr ValueType static verifyValue(const ValueType &value)
2715 {
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
2719 ? value
2720 : throw std::invalid_argument{
2721 "Invalid value: Wrapper{ "
2722 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
2723 };
2724 }
2725
2726 ValueType m_value{ ValueType::none };
2727
2728 friend struct DataModel::Detail::Befriend<Wrapper>;
2729 };
2730
2731 using Descendants = std::tuple<
2748
2751
2753 explicit EnvironmentInfo(const std::string &fileName);
2754
2760 [[nodiscard]] static EnvironmentInfo fromSerialized(const std::string &value);
2761
2767 std::string serialize() const;
2768
2795#ifndef NO_DOC
2796 template<
2797 typename... Args,
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...>::
2801 value,
2802 int>::type = 0>
2803#else
2804 template<typename... Args>
2805#endif
2806 explicit EnvironmentInfo(Args &&...args)
2807 {
2808 using namespace Zivid::Detail::TypeTraits;
2809
2810 static_assert(
2811 AllArgsDecayedAreUnique<Args...>::value,
2812 "Found duplicate types among the arguments passed to EnvironmentInfo(...). "
2813 "Types should be listed at most once.");
2814
2815 set(std::forward<Args>(args)...);
2816 }
2817
2843#ifndef NO_DOC
2844 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2845#else
2846 template<typename... Args>
2847#endif
2848 void set(Args &&...args)
2849 {
2850 using namespace Zivid::Detail::TypeTraits;
2851
2852 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2853 static_assert(
2854 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2855
2856 static_assert(
2857 AllArgsDecayedAreUnique<Args...>::value,
2858 "Found duplicate types among the arguments passed to set(...). "
2859 "Types should be listed at most once.");
2860
2861 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2862 }
2863
2890#ifndef NO_DOC
2891 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2892#else
2893 template<typename... Args>
2894#endif
2895 EnvironmentInfo copyWith(Args &&...args) const
2896 {
2897 using namespace Zivid::Detail::TypeTraits;
2898
2899 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2900 static_assert(
2901 AllArgsAreDescendantNodes::value,
2902 "All arguments passed to copyWith(...) must be descendant nodes.");
2903
2904 static_assert(
2905 AllArgsDecayedAreUnique<Args...>::value,
2906 "Found duplicate types among the arguments passed to copyWith(...). "
2907 "Types should be listed at most once.");
2908
2909 auto copy{ *this };
2910 copy.set(std::forward<Args>(args)...);
2911 return copy;
2912 }
2913
2915 const Platform &platform() const
2916 {
2917 return m_platform;
2918 }
2919
2922 {
2923 return m_platform;
2924 }
2925
2928 {
2929 m_platform = value;
2930 return *this;
2931 }
2932
2935 {
2936 m_platform.set(value);
2937 return *this;
2938 }
2939
2942 {
2943 m_platform.set(value);
2944 return *this;
2945 }
2946
2949 {
2950 m_platform.set(value);
2951 return *this;
2952 }
2953
2956 {
2957 m_platform.set(value);
2958 return *this;
2959 }
2960
2963 {
2964 m_platform.set(value);
2965 return *this;
2966 }
2967
2970 {
2971 m_platform.set(value);
2972 return *this;
2973 }
2974
2977 {
2978 return m_userToolchain;
2979 }
2980
2983 {
2984 return m_userToolchain;
2985 }
2986
2989 {
2990 m_userToolchain = value;
2991 return *this;
2992 }
2993
2996 {
2997 m_userToolchain.set(value);
2998 return *this;
2999 }
3000
3003 {
3004 m_userToolchain.set(value);
3005 return *this;
3006 }
3007
3010 {
3011 m_userToolchain.set(value);
3012 return *this;
3013 }
3014
3017 {
3018 m_userToolchain.set(value);
3019 return *this;
3020 }
3021
3024 {
3025 m_userToolchain.set(value);
3026 return *this;
3027 }
3028
3031 {
3032 m_userToolchain.set(value);
3033 return *this;
3034 }
3035
3038 {
3039 m_userToolchain.set(value);
3040 return *this;
3041 }
3042
3044 const Wrapper &wrapper() const
3045 {
3046 return m_wrapper;
3047 }
3048
3051 {
3052 return m_wrapper;
3053 }
3054
3057 {
3058 m_wrapper = value;
3059 return *this;
3060 }
3061
3062 template<
3063 typename T,
3064 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform>::value, int>::type = 0>
3066 {
3067 return m_platform;
3068 }
3069
3070 template<
3071 typename T,
3072 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU>::value, int>::type = 0>
3074 {
3075 return m_platform.get<EnvironmentInfo::Platform::CPU>();
3076 }
3077
3078 template<
3079 typename T,
3080 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value, int>::
3081 type = 0>
3083 {
3084 return m_platform.get<EnvironmentInfo::Platform::CPU::Architecture>();
3085 }
3086
3087 template<
3088 typename T,
3089 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value, int>::type =
3090 0>
3092 {
3093 return m_platform.get<EnvironmentInfo::Platform::CPU::ModelName>();
3094 }
3095
3096 template<
3097 typename T,
3098 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS>::value, int>::type = 0>
3100 {
3101 return m_platform.get<EnvironmentInfo::Platform::OS>();
3102 }
3103
3104 template<
3105 typename T,
3106 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value, int>::type = 0>
3108 {
3109 return m_platform.get<EnvironmentInfo::Platform::OS::ID>();
3110 }
3111
3112 template<
3113 typename T,
3114 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value, int>::type = 0>
3116 {
3117 return m_platform.get<EnvironmentInfo::Platform::OS::Version>();
3118 }
3119
3120 template<
3121 typename T,
3122 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain>::value, int>::type = 0>
3124 {
3125 return m_userToolchain;
3126 }
3127
3128 template<
3129 typename T,
3130 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler>::value, int>::type =
3131 0>
3133 {
3134 return m_userToolchain.get<EnvironmentInfo::UserToolchain::Compiler>();
3135 }
3136
3137 template<
3138 typename T,
3139 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value, int>::
3140 type = 0>
3142 {
3143 return m_userToolchain.get<EnvironmentInfo::UserToolchain::Compiler::ID>();
3144 }
3145
3146 template<
3147 typename T,
3148 typename std::
3149 enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value, int>::type = 0>
3151 {
3152 return m_userToolchain.get<EnvironmentInfo::UserToolchain::Compiler::Version>();
3153 }
3154
3155 template<
3156 typename T,
3157 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::CxxStandard>::value, int>::
3158 type = 0>
3160 {
3161 return m_userToolchain.get<EnvironmentInfo::UserToolchain::CxxStandard>();
3162 }
3163
3164 template<
3165 typename T,
3166 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary>::value, int>::
3167 type = 0>
3169 {
3170 return m_userToolchain.get<EnvironmentInfo::UserToolchain::StandardLibrary>();
3171 }
3172
3173 template<
3174 typename T,
3175 typename std::enable_if<
3176 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
3177 int>::type = 0>
3179 {
3180 return m_userToolchain.get<EnvironmentInfo::UserToolchain::StandardLibrary::ID>();
3181 }
3182
3183 template<
3184 typename T,
3185 typename std::enable_if<
3186 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
3187 int>::type = 0>
3189 {
3191 }
3192
3193 template<
3194 typename T,
3195 typename std::enable_if<std::is_same<T, EnvironmentInfo::Wrapper>::value, int>::type = 0>
3197 {
3198 return m_wrapper;
3199 }
3200
3201 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3203 {
3204 return m_platform;
3205 }
3206
3207 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3209 {
3210 return m_userToolchain;
3211 }
3212
3213 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3215 {
3216 return m_wrapper;
3217 }
3218
3220 template<typename F>
3221 void forEach(const F &f) const
3222 {
3223 f(m_platform);
3224 f(m_userToolchain);
3225 f(m_wrapper);
3226 }
3227
3229 template<typename F>
3230 void forEach(const F &f)
3231 {
3232 f(m_platform);
3233 f(m_userToolchain);
3234 f(m_wrapper);
3235 }
3236
3238 bool operator==(const EnvironmentInfo &other) const;
3239
3241 bool operator!=(const EnvironmentInfo &other) const;
3242
3244 std::string toString() const;
3245
3247 friend std::ostream &operator<<(std::ostream &stream, const EnvironmentInfo &value)
3248 {
3249 return stream << value.toString();
3250 }
3251
3253 void save(const std::string &fileName) const;
3254
3256 void load(const std::string &fileName);
3257
3258 private:
3259 void setFromString(const std::string &value);
3260
3261 void setFromString(const std::string &fullPath, const std::string &value);
3262
3263 std::string getString(const std::string &fullPath) const;
3264
3265 Platform m_platform;
3266 UserToolchain m_userToolchain;
3267 Wrapper m_wrapper;
3268
3269 friend struct DataModel::Detail::Befriend<EnvironmentInfo>;
3270 };
3271
3272#ifndef NO_DOC
3273 template<>
3274 struct EnvironmentInfo::Version<1>
3275 {
3276 using Type = EnvironmentInfo;
3277 };
3278#endif
3279
3280 } // namespace Detail
3281} // namespace Zivid
3282
3283#ifndef NO_DOC
3285namespace Zivid::Detail
3286{
3287
3288 ZIVID_CORE_EXPORT void save(const Zivid::Detail::EnvironmentInfo &dataModel, std::ostream &ostream);
3289 ZIVID_CORE_EXPORT void load(Zivid::Detail::EnvironmentInfo &dataModel, std::istream &istream);
3290
3291 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::Detail::EnvironmentInfo &source);
3292 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(
3294 const std::vector<uint8_t> &data);
3295
3296} // namespace Zivid::Detail
3297#endif
3298
3299#ifdef _MSC_VER
3300# pragma warning(pop)
3301#endif
3302
3303#ifndef NO_DOC
3304# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
3305namespace std // NOLINT
3306{
3307
3308 template<>
3309 struct tuple_size<Zivid::Detail::EnvironmentInfo::Platform> : integral_constant<size_t, 2>
3310 {};
3311
3312 template<size_t i>
3313 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::Platform>
3314 {
3315 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform>::value, "Index must be less than 2");
3316
3317 using type // NOLINT
3318 = decltype(declval<Zivid::Detail::EnvironmentInfo::Platform>().get<i>());
3319 };
3320
3321 template<>
3322 struct tuple_size<Zivid::Detail::EnvironmentInfo::Platform::CPU> : integral_constant<size_t, 2>
3323 {};
3324
3325 template<size_t i>
3326 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::Platform::CPU>
3327 {
3328 static_assert(
3329 i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform::CPU>::value,
3330 "Index must be less than 2");
3331
3332 using type // NOLINT
3333 = decltype(declval<Zivid::Detail::EnvironmentInfo::Platform::CPU>().get<i>());
3334 };
3335
3336 template<>
3337 struct tuple_size<Zivid::Detail::EnvironmentInfo::Platform::OS> : integral_constant<size_t, 2>
3338 {};
3339
3340 template<size_t i>
3341 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::Platform::OS>
3342 {
3343 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform::OS>::value, "Index must be less than 2");
3344
3345 using type // NOLINT
3346 = decltype(declval<Zivid::Detail::EnvironmentInfo::Platform::OS>().get<i>());
3347 };
3348
3349 template<>
3350 struct tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain> : integral_constant<size_t, 3>
3351 {};
3352
3353 template<size_t i>
3354 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::UserToolchain>
3355 {
3356 static_assert(
3357 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain>::value,
3358 "Index must be less than 3");
3359
3360 using type // NOLINT
3361 = decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain>().get<i>());
3362 };
3363
3364 template<>
3365 struct tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler> : integral_constant<size_t, 2>
3366 {};
3367
3368 template<size_t i>
3369 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>
3370 {
3371 static_assert(
3372 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>::value,
3373 "Index must be less than 2");
3374
3375 using type // NOLINT
3376 = decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>().get<i>());
3377 };
3378
3379 template<>
3380 struct tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary> : integral_constant<size_t, 2>
3381 {};
3382
3383 template<size_t i>
3384 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>
3385 {
3386 static_assert(
3387 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>::value,
3388 "Index must be less than 2");
3389
3390 using type // NOLINT
3391 = decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>().get<i>());
3392 };
3393
3394 template<>
3395 struct tuple_size<Zivid::Detail::EnvironmentInfo> : integral_constant<size_t, 3>
3396 {};
3397
3398 template<size_t i>
3399 struct tuple_element<i, Zivid::Detail::EnvironmentInfo>
3400 {
3401 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo>::value, "Index must be less than 3");
3402
3403 using type // NOLINT
3404 = decltype(declval<Zivid::Detail::EnvironmentInfo>().get<i>());
3405 };
3406
3407} // namespace std
3408# endif
3409#endif
3410
3411// If we have access to the DataModel library, automatically include internal DataModel
3412// header. This header is necessary for serialization and deserialization.
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"
3416# endif
3417#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
CPU architecture.
Definition EnvironmentInfo.h:152
bool operator==(const Architecture &other) const
Comparison operator.
Definition EnvironmentInfo.h:204
constexpr Architecture(ValueType value)
Constructor.
Definition EnvironmentInfo.h:187
static std::set< ValueType > validValues()
All valid values of Architecture.
Definition EnvironmentInfo.h:178
bool operator!=(const Architecture &other) const
Comparison operator.
Definition EnvironmentInfo.h:210
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:168
static const Architecture arm64
arm64
Definition EnvironmentInfo.h:175
static const Architecture unknown
unknown
Definition EnvironmentInfo.h:173
friend std::ostream & operator<<(std::ostream &stream, const Architecture &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:216
friend std::ostream & operator<<(std::ostream &stream, const Architecture::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:198
static const Architecture amd64
amd64
Definition EnvironmentInfo.h:174
CPU model name.
Definition EnvironmentInfo.h:244
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:259
std::string toString() const
Get the value as string.
bool operator>(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:300
bool operator==(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:282
const std::string & value() const
Get the value.
bool operator>=(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:312
bool operator!=(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:288
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:318
bool operator<(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:294
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName.
Definition EnvironmentInfo.h:262
ModelName(std::string value)
Constructor.
Definition EnvironmentInfo.h:271
bool operator<=(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:306
Information about the CPU.
Definition EnvironmentInfo.h:134
const EnvironmentInfo::Platform::CPU::ModelName & get() const
Definition EnvironmentInfo.h:495
bool operator==(const CPU &other) const
Equality operator.
std::string toString() const
Get the value as string.
const Architecture & architecture() const
Get Architecture.
Definition EnvironmentInfo.h:444
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:388
ModelName & modelName()
Get ModelName.
Definition EnvironmentInfo.h:469
std:: tuple< EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName > Descendants
Definition EnvironmentInfo.h:331
const ModelName & modelName() const
Get ModelName.
Definition EnvironmentInfo.h:463
Architecture & architecture()
Get Architecture.
Definition EnvironmentInfo.h:450
friend std::ostream & operator<<(std::ostream &stream, const CPU &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:538
CPU copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition EnvironmentInfo.h:423
CPU & set(const ModelName &value)
Set ModelName.
Definition EnvironmentInfo.h:475
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:514
bool operator!=(const CPU &other) const
Inequality operator.
CPU & set(const Architecture &value)
Set Architecture.
Definition EnvironmentInfo.h:456
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:522
const EnvironmentInfo::Platform::CPU::Architecture & get() const
Definition EnvironmentInfo.h:486
Operating system name.
Definition EnvironmentInfo.h:580
bool operator==(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:632
friend std::ostream & operator<<(std::ostream &stream, const ID::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:626
constexpr ID(ValueType value)
Constructor.
Definition EnvironmentInfo.h:615
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:596
std::string toString() const
Get the value as string.
static const ID windows
windows
Definition EnvironmentInfo.h:602
friend std::ostream & operator<<(std::ostream &stream, const ID &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:644
static const ID unknown
unknown
Definition EnvironmentInfo.h:601
static const ID gnulinux
gnulinux
Definition EnvironmentInfo.h:603
bool operator!=(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:638
static std::set< ValueType > validValues()
All valid values of ID.
Definition EnvironmentInfo.h:606
ValueType value() const
Get the value.
Operating system version.
Definition EnvironmentInfo.h:673
bool operator>(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:729
friend std::ostream & operator<<(std::ostream &stream, const Version &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:747
bool operator!=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:717
bool operator==(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:711
const std::string & value() const
Get the value.
std::string toString() const
Get the value as string.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Version.
Definition EnvironmentInfo.h:691
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:688
bool operator>=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:741
Version(std::string value)
Constructor.
Definition EnvironmentInfo.h:700
bool operator<(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:723
bool operator<=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:735
Operation system name and version.
Definition EnvironmentInfo.h:560
std::tuple< EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version > Descendants
Definition EnvironmentInfo.h:760
friend std::ostream & operator<<(std::ostream &stream, const OS &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:966
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:950
const ID & id() const
Get ID.
Definition EnvironmentInfo.h:873
bool operator==(const OS &other) const
Equality operator.
const EnvironmentInfo::Platform::OS::Version & get() const
Definition EnvironmentInfo.h:923
Version & version()
Get Version.
Definition EnvironmentInfo.h:898
OS & set(const ID &value)
Set ID.
Definition EnvironmentInfo.h:885
std::string toString() const
Get the value as string.
ID & id()
Get ID.
Definition EnvironmentInfo.h:879
bool operator!=(const OS &other) const
Inequality operator.
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:942
const Version & version() const
Get Version.
Definition EnvironmentInfo.h:892
OS & set(const Version &value)
Set Version.
Definition EnvironmentInfo.h:904
const EnvironmentInfo::Platform::OS::ID & get() const
Definition EnvironmentInfo.h:914
OS copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition EnvironmentInfo.h:852
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:817
Information about the current platform.
Definition EnvironmentInfo.h:114
const EnvironmentInfo::Platform::CPU::ModelName & get() const
Definition EnvironmentInfo.h:1199
Platform & set(const OS &value)
Set OS.
Definition EnvironmentInfo.h:1158
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:1054
Platform & set(const CPU &value)
Set CPU.
Definition EnvironmentInfo.h:1125
bool operator==(const Platform &other) const
Equality operator.
Platform & set(const CPU::Architecture &value)
Set CPU::Architecture.
Definition EnvironmentInfo.h:1132
const CPU & cpu() const
Get CPU.
Definition EnvironmentInfo.h:1113
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:1243
const EnvironmentInfo::Platform::CPU::Architecture & get() const
Definition EnvironmentInfo.h:1190
Platform & set(const OS::Version &value)
Set OS::Version.
Definition EnvironmentInfo.h:1172
const OS & os() const
Get OS.
Definition EnvironmentInfo.h:1146
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const Platform &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:1267
const EnvironmentInfo::Platform::OS::Version & get() const
Definition EnvironmentInfo.h:1224
Platform copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition EnvironmentInfo.h:1092
const EnvironmentInfo::Platform::OS & get() const
Definition EnvironmentInfo.h:1207
bool operator!=(const Platform &other) const
Inequality operator.
const EnvironmentInfo::Platform::CPU & get() const
Definition EnvironmentInfo.h:1181
Platform & set(const OS::ID &value)
Set OS::ID.
Definition EnvironmentInfo.h:1165
const EnvironmentInfo::Platform::OS::ID & get() const
Definition EnvironmentInfo.h:1215
CPU & cpu()
Get CPU.
Definition EnvironmentInfo.h:1119
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:1251
std::tuple< EnvironmentInfo::Platform::CPU, EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName, EnvironmentInfo::Platform::OS, EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version > Descendants
Definition EnvironmentInfo.h:984
Platform & set(const CPU::ModelName &value)
Set CPU::ModelName.
Definition EnvironmentInfo.h:1139
OS & os()
Get OS.
Definition EnvironmentInfo.h:1152
The name of the compiler.
Definition EnvironmentInfo.h:1329
static const ID clang
clang
Definition EnvironmentInfo.h:1357
friend std::ostream & operator<<(std::ostream &stream, const ID::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:1387
static const ID mingwClang
mingwClang
Definition EnvironmentInfo.h:1361
static const ID unknown
unknown
Definition EnvironmentInfo.h:1355
static const ID msvc
msvc
Definition EnvironmentInfo.h:1356
static std::set< ValueType > validValues()
All valid values of ID.
Definition EnvironmentInfo.h:1365
static const ID gcc
gcc
Definition EnvironmentInfo.h:1358
bool operator==(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:1393
friend std::ostream & operator<<(std::ostream &stream, const ID &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:1405
constexpr ID(ValueType value)
Constructor.
Definition EnvironmentInfo.h:1376
static const ID mingwGcc
mingwGcc
Definition EnvironmentInfo.h:1360
static const ID mingwUnknown
mingwUnknown
Definition EnvironmentInfo.h:1362
static const ID intel
intel
Definition EnvironmentInfo.h:1359
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1345
bool operator!=(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:1399
std::string toString() const
Get the value as string.
The version of the compiler.
Definition EnvironmentInfo.h:1436
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Version.
Definition EnvironmentInfo.h:1456
bool operator==(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1476
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const Version &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:1512
Version(std::string value)
Constructor.
Definition EnvironmentInfo.h:1465
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1453
bool operator>=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1506
bool operator!=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1482
bool operator<(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1488
bool operator<=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1500
bool operator>(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1494
Information about which compiler is being used.
Definition EnvironmentInfo.h:1309
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:1710
std::tuple< EnvironmentInfo::UserToolchain::Compiler::ID, EnvironmentInfo::UserToolchain::Compiler::Version > Descendants
Definition EnvironmentInfo.h:1525
const EnvironmentInfo::UserToolchain::Compiler::ID & get() const
Definition EnvironmentInfo.h:1681
const EnvironmentInfo::UserToolchain::Compiler::Version & get() const
Definition EnvironmentInfo.h:1691
Compiler & set(const ID &value)
Set ID.
Definition EnvironmentInfo.h:1651
const ID & id() const
Get ID.
Definition EnvironmentInfo.h:1639
std::string toString() const
Get the value as string.
Version & version()
Get Version.
Definition EnvironmentInfo.h:1664
const Version & version() const
Get Version.
Definition EnvironmentInfo.h:1658
ID & id()
Get ID.
Definition EnvironmentInfo.h:1645
friend std::ostream & operator<<(std::ostream &stream, const Compiler &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:1734
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:1583
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:1718
Compiler copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition EnvironmentInfo.h:1618
bool operator!=(const Compiler &other) const
Inequality operator.
Compiler & set(const Version &value)
Set Version.
Definition EnvironmentInfo.h:1670
bool operator==(const Compiler &other) const
Equality operator.
The C++ standard being used.
Definition EnvironmentInfo.h:1756
bool operator<(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1806
const std::string & value() const
Get the value.
bool operator!=(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1800
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1771
bool operator<=(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1818
bool operator>(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1812
friend std::ostream & operator<<(std::ostream &stream, const CxxStandard &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:1830
CxxStandard(std::string value)
Constructor.
Definition EnvironmentInfo.h:1783
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for CxxStandard.
Definition EnvironmentInfo.h:1774
bool operator==(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1794
std::string toString() const
Get the value as string.
bool operator>=(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1824
The name of the standard library implementation.
Definition EnvironmentInfo.h:1867
static const ID libstdcxx
libstdcxx
Definition EnvironmentInfo.h:1894
static const ID msvc
msvc
Definition EnvironmentInfo.h:1892
constexpr ID(ValueType value)
Constructor.
Definition EnvironmentInfo.h:1906
friend std::ostream & operator<<(std::ostream &stream, const ID::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:1917
bool operator==(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:1923
friend std::ostream & operator<<(std::ostream &stream, const ID &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:1935
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1885
static const ID unknown
unknown
Definition EnvironmentInfo.h:1891
static std::set< ValueType > validValues()
All valid values of ID.
Definition EnvironmentInfo.h:1897
static const ID libcxx
libcxx
Definition EnvironmentInfo.h:1893
bool operator!=(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:1929
The version of the standard library implementation.
Definition EnvironmentInfo.h:1964
bool operator<=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2028
friend std::ostream & operator<<(std::ostream &stream, const Version &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:2040
bool operator<(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2016
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Version.
Definition EnvironmentInfo.h:1984
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1981
bool operator>=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2034
bool operator!=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2010
Version(std::string value)
Constructor.
Definition EnvironmentInfo.h:1993
bool operator==(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2004
bool operator>(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2022
Information about what standard library implementation is being used.
Definition EnvironmentInfo.h:1847
StandardLibrary copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition EnvironmentInfo.h:2146
std::string toString() const
Get the value as string.
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:2111
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:2238
std::tuple< EnvironmentInfo::UserToolchain::StandardLibrary::ID, EnvironmentInfo::UserToolchain::StandardLibrary::Version > Descendants
Definition EnvironmentInfo.h:2053
const Version & version() const
Get Version.
Definition EnvironmentInfo.h:2186
StandardLibrary & set(const Version &value)
Set Version.
Definition EnvironmentInfo.h:2198
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:2246
friend std::ostream & operator<<(std::ostream &stream, const StandardLibrary &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:2262
StandardLibrary & set(const ID &value)
Set ID.
Definition EnvironmentInfo.h:2179
const ID & id() const
Get ID.
Definition EnvironmentInfo.h:2167
const EnvironmentInfo::UserToolchain::StandardLibrary::Version & get() const
Definition EnvironmentInfo.h:2219
Version & version()
Get Version.
Definition EnvironmentInfo.h:2192
bool operator!=(const StandardLibrary &other) const
Inequality operator.
ID & id()
Get ID.
Definition EnvironmentInfo.h:2173
bool operator==(const StandardLibrary &other) const
Equality operator.
const EnvironmentInfo::UserToolchain::StandardLibrary::ID & get() const
Definition EnvironmentInfo.h:2209
Information about the current toolchain.
Definition EnvironmentInfo.h:1289
UserToolchain & set(const StandardLibrary &value)
Set StandardLibrary.
Definition EnvironmentInfo.h:2477
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:2593
StandardLibrary & standardLibrary()
Get StandardLibrary.
Definition EnvironmentInfo.h:2471
const CxxStandard & cxxStandard() const
Get CxxStandard.
Definition EnvironmentInfo.h:2446
std::string toString() const
Get the value as string.
const EnvironmentInfo::UserToolchain::CxxStandard & get() const
Definition EnvironmentInfo.h:2529
UserToolchain & set(const StandardLibrary::ID &value)
Set StandardLibrary::ID.
Definition EnvironmentInfo.h:2484
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:2584
bool operator!=(const UserToolchain &other) const
Inequality operator.
UserToolchain & set(const Compiler &value)
Set Compiler.
Definition EnvironmentInfo.h:2425
UserToolchain copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition EnvironmentInfo.h:2392
UserToolchain & set(const StandardLibrary::Version &value)
Set StandardLibrary::Version.
Definition EnvironmentInfo.h:2491
bool operator==(const UserToolchain &other) const
Equality operator.
const Compiler & compiler() const
Get Compiler.
Definition EnvironmentInfo.h:2413
const EnvironmentInfo::UserToolchain::Compiler & get() const
Definition EnvironmentInfo.h:2501
UserToolchain & set(const Compiler::ID &value)
Set Compiler::ID.
Definition EnvironmentInfo.h:2432
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:2353
const EnvironmentInfo::UserToolchain::StandardLibrary & get() const
Definition EnvironmentInfo.h:2539
const EnvironmentInfo::UserToolchain::Compiler::Version & get() const
Definition EnvironmentInfo.h:2520
UserToolchain & set(const Compiler::Version &value)
Set Compiler::Version.
Definition EnvironmentInfo.h:2439
const StandardLibrary & standardLibrary() const
Get StandardLibrary.
Definition EnvironmentInfo.h:2465
const EnvironmentInfo::UserToolchain::StandardLibrary::Version & get() const
Definition EnvironmentInfo.h:2559
Compiler & compiler()
Get Compiler.
Definition EnvironmentInfo.h:2419
const EnvironmentInfo::UserToolchain::Compiler::ID & get() const
Definition EnvironmentInfo.h:2510
const EnvironmentInfo::UserToolchain::StandardLibrary::ID & get() const
Definition EnvironmentInfo.h:2549
friend std::ostream & operator<<(std::ostream &stream, const UserToolchain &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:2610
std::tuple< 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 > Descendants
Definition EnvironmentInfo.h:2280
CxxStandard & cxxStandard()
Get CxxStandard.
Definition EnvironmentInfo.h:2452
UserToolchain & set(const CxxStandard &value)
Set CxxStandard.
Definition EnvironmentInfo.h:2458
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