Zivid C++ API 2.13.1+18e79e79-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
65#include "Zivid/Range.h"
66
67#ifdef _MSC_VER
68# pragma warning(push)
69# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
70#endif
71
72namespace Zivid
73{
74 namespace Detail
75 {
76
78
79 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
81 {
82 public:
84 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
85
87 static constexpr const char *path{ "" };
88
90 static constexpr const char *name{ "EnvironmentInfo" };
91
93 static constexpr const char *description{
94 R"description(Information about the current toolchain and platform)description"
95 };
96
97 static constexpr size_t version{ 1 };
98
99#ifndef NO_DOC
100 template<size_t>
101 struct Version;
102
103 using LatestVersion = Zivid::Detail::EnvironmentInfo;
104
105 // Short identifier. This value is not guaranteed to be universally unique
106 // Todo(ZIVID-2808): Move this to internal DataModelExt header
107 static constexpr std::array<uint8_t, 3> binaryId{ 'e', 'v', 'm' };
108
109#endif
110
112
113 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
115 {
116 public:
118 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
119
121 static constexpr const char *path{ "Platform" };
122
124 static constexpr const char *name{ "Platform" };
125
127 static constexpr const char *description{
128 R"description(Information about the current platform)description"
129 };
130
132
133 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
135 {
136 public:
138 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
139
141 static constexpr const char *path{ "Platform/CPU" };
142
144 static constexpr const char *name{ "CPU" };
145
147 static constexpr const char *description{ R"description(Information about the CPU)description" };
148
150
151 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
153 {
154 public:
156 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
157
159 static constexpr const char *path{ "Platform/CPU/Architecture" };
160
162 static constexpr const char *name{ "Architecture" };
163
165 static constexpr const char *description{ R"description(CPU architecture)description" };
166
168 enum class ValueType
169 {
170 unknown,
171 amd64,
172 arm64
173 };
174 static const Architecture unknown;
175 static const Architecture amd64;
176 static const Architecture arm64;
177
179 static std::set<ValueType> validValues()
180 {
181 return { ValueType::unknown, ValueType::amd64, ValueType::arm64 };
182 }
183
185 Architecture() = default;
186
188 explicit constexpr Architecture(ValueType value)
189 : m_value{ verifyValue(value) }
190 {}
191
194
196 std::string toString() const;
197
199 friend std::ostream &operator<<(std::ostream &stream, const Architecture::ValueType &value)
200 {
201 return stream << Architecture{ value }.toString();
202 }
203
205 bool operator==(const Architecture &other) const
206 {
207 return m_value == other.m_value;
208 }
209
211 bool operator!=(const Architecture &other) const
212 {
213 return m_value != other.m_value;
214 }
215
217 friend std::ostream &operator<<(std::ostream &stream, const Architecture &value)
218 {
219 return stream << value.toString();
220 }
221
222 private:
223 void setFromString(const std::string &value);
224
225 constexpr ValueType static verifyValue(const ValueType &value)
226 {
227 return value == ValueType::unknown || value == ValueType::amd64 || value == ValueType::arm64
228 ? value
229 : throw std::invalid_argument{
230 "Invalid value: Architecture{ "
231 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
232 + " }"
233 };
234 }
235
236 ValueType m_value{ ValueType::unknown };
237
238 friend struct DataModel::Detail::Befriend<Architecture>;
239 };
240
242
243 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
245 {
246 public:
248 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
249
251 static constexpr const char *path{ "Platform/CPU/ModelName" };
252
254 static constexpr const char *name{ "ModelName" };
255
257 static constexpr const char *description{ R"description(CPU model name)description" };
258
260 using ValueType = std::string;
261
264 {
265 return { 0, std::numeric_limits<ValueType::size_type>::max() };
266 }
267
269 ModelName() = default;
270
272 explicit ModelName(std::string value)
273 : m_value{ std::move(value) }
274 {}
275
277 const std::string &value() const;
278
280 std::string toString() const;
281
283 bool operator==(const ModelName &other) const
284 {
285 return m_value == other.m_value;
286 }
287
289 bool operator!=(const ModelName &other) const
290 {
291 return m_value != other.m_value;
292 }
293
295 bool operator<(const ModelName &other) const
296 {
297 return m_value < other.m_value;
298 }
299
301 bool operator>(const ModelName &other) const
302 {
303 return m_value > other.m_value;
304 }
305
307 bool operator<=(const ModelName &other) const
308 {
309 return m_value <= other.m_value;
310 }
311
313 bool operator>=(const ModelName &other) const
314 {
315 return m_value >= other.m_value;
316 }
317
319 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
320 {
321 return stream << value.toString();
322 }
323
324 private:
325 void setFromString(const std::string &value);
326
327 std::string m_value{ "unknown" };
328
329 friend struct DataModel::Detail::Befriend<ModelName>;
330 };
331
332 using Descendants = std::
333 tuple<EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName>;
334
337
350#ifndef NO_DOC
351 template<
352 typename... Args,
353 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
354 typename std::enable_if<
355 Zivid::Detail::TypeTraits::
356 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
357 int>::type = 0>
358#else
359 template<typename... Args>
360#endif
361 explicit CPU(Args &&...args)
362 {
363 using namespace Zivid::Detail::TypeTraits;
364
365 static_assert(
366 AllArgsDecayedAreUnique<Args...>::value,
367 "Found duplicate types among the arguments passed to CPU(...). "
368 "Types should be listed at most once.");
369
370 set(std::forward<Args>(args)...);
371 }
372
384#ifndef NO_DOC
385 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
386#else
387 template<typename... Args>
388#endif
389 void set(Args &&...args)
390 {
391 using namespace Zivid::Detail::TypeTraits;
392
393 using AllArgsAreDescendantNodes =
394 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
395 static_assert(
396 AllArgsAreDescendantNodes::value,
397 "All arguments passed to set(...) must be descendant nodes.");
398
399 static_assert(
400 AllArgsDecayedAreUnique<Args...>::value,
401 "Found duplicate types among the arguments passed to set(...). "
402 "Types should be listed at most once.");
403
404 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
405 }
406
419#ifndef NO_DOC
420 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
421#else
422 template<typename... Args>
423#endif
424 CPU copyWith(Args &&...args) const
425 {
426 using namespace Zivid::Detail::TypeTraits;
427
428 using AllArgsAreDescendantNodes =
429 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
430 static_assert(
431 AllArgsAreDescendantNodes::value,
432 "All arguments passed to copyWith(...) must be descendant nodes.");
433
434 static_assert(
435 AllArgsDecayedAreUnique<Args...>::value,
436 "Found duplicate types among the arguments passed to copyWith(...). "
437 "Types should be listed at most once.");
438
439 auto copy{ *this };
440 copy.set(std::forward<Args>(args)...);
441 return copy;
442 }
443
446 {
447 return m_architecture;
448 }
449
452 {
453 return m_architecture;
454 }
455
457 CPU &set(const Architecture &value)
458 {
459 m_architecture = value;
460 return *this;
461 }
462
464 const ModelName &modelName() const
465 {
466 return m_modelName;
467 }
468
471 {
472 return m_modelName;
473 }
474
476 CPU &set(const ModelName &value)
477 {
478 m_modelName = value;
479 return *this;
480 }
481
482 template<
483 typename T,
484 typename std::enable_if<
485 std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value,
486 int>::type = 0>
488 {
489 return m_architecture;
490 }
491
492 template<
493 typename T,
494 typename std::
495 enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value, int>::type = 0>
497 {
498 return m_modelName;
499 }
500
501 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
503 {
504 return m_architecture;
505 }
506
507 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
509 {
510 return m_modelName;
511 }
512
514 template<typename F>
515 void forEach(const F &f) const
516 {
517 f(m_architecture);
518 f(m_modelName);
519 }
520
522 template<typename F>
523 void forEach(const F &f)
524 {
525 f(m_architecture);
526 f(m_modelName);
527 }
528
530 bool operator==(const CPU &other) const;
531
533 bool operator!=(const CPU &other) const;
534
536 std::string toString() const;
537
539 friend std::ostream &operator<<(std::ostream &stream, const CPU &value)
540 {
541 return stream << value.toString();
542 }
543
544 private:
545 void setFromString(const std::string &value);
546
547 void setFromString(const std::string &fullPath, const std::string &value);
548
549 std::string getString(const std::string &fullPath) const;
550
551 Architecture m_architecture;
552 ModelName m_modelName;
553
554 friend struct DataModel::Detail::Befriend<CPU>;
555 };
556
558
559 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
561 {
562 public:
564 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
565
567 static constexpr const char *path{ "Platform/OS" };
568
570 static constexpr const char *name{ "OS" };
571
573 static constexpr const char *description{
574 R"description(Operation system name and version)description"
575 };
576
578
579 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
581 {
582 public:
584 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
585
587 static constexpr const char *path{ "Platform/OS/ID" };
588
590 static constexpr const char *name{ "ID" };
591
593 static constexpr const char *description{ R"description(Operating system name)description" };
594
596 enum class ValueType
597 {
598 unknown,
599 windows,
600 gnulinux
601 };
602 static const ID unknown;
603 static const ID windows;
604 static const ID gnulinux;
605
607 static std::set<ValueType> validValues()
608 {
609 return { ValueType::unknown, ValueType::windows, ValueType::gnulinux };
610 }
611
613 ID() = default;
614
616 explicit constexpr ID(ValueType value)
617 : m_value{ verifyValue(value) }
618 {}
619
622
624 std::string toString() const;
625
627 friend std::ostream &operator<<(std::ostream &stream, const ID::ValueType &value)
628 {
629 return stream << ID{ value }.toString();
630 }
631
633 bool operator==(const ID &other) const
634 {
635 return m_value == other.m_value;
636 }
637
639 bool operator!=(const ID &other) const
640 {
641 return m_value != other.m_value;
642 }
643
645 friend std::ostream &operator<<(std::ostream &stream, const ID &value)
646 {
647 return stream << value.toString();
648 }
649
650 private:
651 void setFromString(const std::string &value);
652
653 constexpr ValueType static verifyValue(const ValueType &value)
654 {
655 return value == ValueType::unknown || value == ValueType::windows
656 || value == ValueType::gnulinux
657 ? value
658 : throw std::invalid_argument{
659 "Invalid value: ID{ "
660 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
661 + " }"
662 };
663 }
664
665 ValueType m_value{ ValueType::unknown };
666
667 friend struct DataModel::Detail::Befriend<ID>;
668 };
669
671
672 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
674 {
675 public:
677 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
678
680 static constexpr const char *path{ "Platform/OS/Version" };
681
683 static constexpr const char *name{ "Version" };
684
686 static constexpr const char *description{ R"description(Operating system version)description" };
687
689 using ValueType = std::string;
690
693 {
694 return { 0, std::numeric_limits<ValueType::size_type>::max() };
695 }
696
698 Version() = default;
699
701 explicit Version(std::string value)
702 : m_value{ std::move(value) }
703 {}
704
706 const std::string &value() const;
707
709 std::string toString() const;
710
712 bool operator==(const Version &other) const
713 {
714 return m_value == other.m_value;
715 }
716
718 bool operator!=(const Version &other) const
719 {
720 return m_value != other.m_value;
721 }
722
724 bool operator<(const Version &other) const
725 {
726 return m_value < other.m_value;
727 }
728
730 bool operator>(const Version &other) const
731 {
732 return m_value > other.m_value;
733 }
734
736 bool operator<=(const Version &other) const
737 {
738 return m_value <= other.m_value;
739 }
740
742 bool operator>=(const Version &other) const
743 {
744 return m_value >= other.m_value;
745 }
746
748 friend std::ostream &operator<<(std::ostream &stream, const Version &value)
749 {
750 return stream << value.toString();
751 }
752
753 private:
754 void setFromString(const std::string &value);
755
756 std::string m_value{ "unknown" };
757
758 friend struct DataModel::Detail::Befriend<Version>;
759 };
760
762 std::tuple<EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version>;
763
765 OS();
766
779#ifndef NO_DOC
780 template<
781 typename... Args,
782 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
783 typename std::enable_if<
784 Zivid::Detail::TypeTraits::
785 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
786 int>::type = 0>
787#else
788 template<typename... Args>
789#endif
790 explicit OS(Args &&...args)
791 {
792 using namespace Zivid::Detail::TypeTraits;
793
794 static_assert(
795 AllArgsDecayedAreUnique<Args...>::value,
796 "Found duplicate types among the arguments passed to OS(...). "
797 "Types should be listed at most once.");
798
799 set(std::forward<Args>(args)...);
800 }
801
813#ifndef NO_DOC
814 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
815#else
816 template<typename... Args>
817#endif
818 void set(Args &&...args)
819 {
820 using namespace Zivid::Detail::TypeTraits;
821
822 using AllArgsAreDescendantNodes =
823 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
824 static_assert(
825 AllArgsAreDescendantNodes::value,
826 "All arguments passed to set(...) must be descendant nodes.");
827
828 static_assert(
829 AllArgsDecayedAreUnique<Args...>::value,
830 "Found duplicate types among the arguments passed to set(...). "
831 "Types should be listed at most once.");
832
833 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
834 }
835
848#ifndef NO_DOC
849 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
850#else
851 template<typename... Args>
852#endif
853 OS copyWith(Args &&...args) const
854 {
855 using namespace Zivid::Detail::TypeTraits;
856
857 using AllArgsAreDescendantNodes =
858 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
859 static_assert(
860 AllArgsAreDescendantNodes::value,
861 "All arguments passed to copyWith(...) must be descendant nodes.");
862
863 static_assert(
864 AllArgsDecayedAreUnique<Args...>::value,
865 "Found duplicate types among the arguments passed to copyWith(...). "
866 "Types should be listed at most once.");
867
868 auto copy{ *this };
869 copy.set(std::forward<Args>(args)...);
870 return copy;
871 }
872
874 const ID &id() const
875 {
876 return m_id;
877 }
878
881 {
882 return m_id;
883 }
884
886 OS &set(const ID &value)
887 {
888 m_id = value;
889 return *this;
890 }
891
893 const Version &version() const
894 {
895 return m_version;
896 }
897
900 {
901 return m_version;
902 }
903
905 OS &set(const Version &value)
906 {
907 m_version = value;
908 return *this;
909 }
910
911 template<
912 typename T,
913 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value, int>::type =
914 0>
916 {
917 return m_id;
918 }
919
920 template<
921 typename T,
922 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value, int>::
923 type = 0>
925 {
926 return m_version;
927 }
928
929 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
931 {
932 return m_id;
933 }
934
935 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
937 {
938 return m_version;
939 }
940
942 template<typename F>
943 void forEach(const F &f) const
944 {
945 f(m_id);
946 f(m_version);
947 }
948
950 template<typename F>
951 void forEach(const F &f)
952 {
953 f(m_id);
954 f(m_version);
955 }
956
958 bool operator==(const OS &other) const;
959
961 bool operator!=(const OS &other) const;
962
964 std::string toString() const;
965
967 friend std::ostream &operator<<(std::ostream &stream, const OS &value)
968 {
969 return stream << value.toString();
970 }
971
972 private:
973 void setFromString(const std::string &value);
974
975 void setFromString(const std::string &fullPath, const std::string &value);
976
977 std::string getString(const std::string &fullPath) const;
978
979 ID m_id;
980 Version m_version;
981
982 friend struct DataModel::Detail::Befriend<OS>;
983 };
984
985 using Descendants = std::tuple<
992
995
1012#ifndef NO_DOC
1013 template<
1014 typename... Args,
1015 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1016 typename std::enable_if<
1017 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1018 value,
1019 int>::type = 0>
1020#else
1021 template<typename... Args>
1022#endif
1023 explicit Platform(Args &&...args)
1024 {
1025 using namespace Zivid::Detail::TypeTraits;
1026
1027 static_assert(
1028 AllArgsDecayedAreUnique<Args...>::value,
1029 "Found duplicate types among the arguments passed to Platform(...). "
1030 "Types should be listed at most once.");
1031
1032 set(std::forward<Args>(args)...);
1033 }
1034
1050#ifndef NO_DOC
1051 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1052#else
1053 template<typename... Args>
1054#endif
1055 void set(Args &&...args)
1056 {
1057 using namespace Zivid::Detail::TypeTraits;
1058
1059 using AllArgsAreDescendantNodes =
1060 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1061 static_assert(
1062 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1063
1064 static_assert(
1065 AllArgsDecayedAreUnique<Args...>::value,
1066 "Found duplicate types among the arguments passed to set(...). "
1067 "Types should be listed at most once.");
1068
1069 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1070 }
1071
1088#ifndef NO_DOC
1089 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1090#else
1091 template<typename... Args>
1092#endif
1093 Platform copyWith(Args &&...args) const
1094 {
1095 using namespace Zivid::Detail::TypeTraits;
1096
1097 using AllArgsAreDescendantNodes =
1098 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1099 static_assert(
1100 AllArgsAreDescendantNodes::value,
1101 "All arguments passed to copyWith(...) must be descendant nodes.");
1102
1103 static_assert(
1104 AllArgsDecayedAreUnique<Args...>::value,
1105 "Found duplicate types among the arguments passed to copyWith(...). "
1106 "Types should be listed at most once.");
1107
1108 auto copy{ *this };
1109 copy.set(std::forward<Args>(args)...);
1110 return copy;
1111 }
1112
1114 const CPU &cpu() const
1115 {
1116 return m_cpu;
1117 }
1118
1121 {
1122 return m_cpu;
1123 }
1124
1126 Platform &set(const CPU &value)
1127 {
1128 m_cpu = value;
1129 return *this;
1130 }
1131
1134 {
1135 m_cpu.set(value);
1136 return *this;
1137 }
1138
1141 {
1142 m_cpu.set(value);
1143 return *this;
1144 }
1145
1147 const OS &os() const
1148 {
1149 return m_os;
1150 }
1151
1154 {
1155 return m_os;
1156 }
1157
1159 Platform &set(const OS &value)
1160 {
1161 m_os = value;
1162 return *this;
1163 }
1164
1166 Platform &set(const OS::ID &value)
1167 {
1168 m_os.set(value);
1169 return *this;
1170 }
1171
1173 Platform &set(const OS::Version &value)
1174 {
1175 m_os.set(value);
1176 return *this;
1177 }
1178
1179 template<
1180 typename T,
1181 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU>::value, int>::type = 0>
1183 {
1184 return m_cpu;
1185 }
1186
1187 template<
1188 typename T,
1189 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value, int>::
1190 type = 0>
1192 {
1194 }
1195
1196 template<
1197 typename T,
1198 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value, int>::
1199 type = 0>
1201 {
1203 }
1204
1205 template<
1206 typename T,
1207 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS>::value, int>::type = 0>
1209 {
1210 return m_os;
1211 }
1212
1213 template<
1214 typename T,
1215 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value, int>::type = 0>
1217 {
1218 return m_os.get<EnvironmentInfo::Platform::OS::ID>();
1219 }
1220
1221 template<
1222 typename T,
1223 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value, int>::type =
1224 0>
1226 {
1227 return m_os.get<EnvironmentInfo::Platform::OS::Version>();
1228 }
1229
1230 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1232 {
1233 return m_cpu;
1234 }
1235
1236 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1238 {
1239 return m_os;
1240 }
1241
1243 template<typename F>
1244 void forEach(const F &f) const
1245 {
1246 f(m_cpu);
1247 f(m_os);
1248 }
1249
1251 template<typename F>
1252 void forEach(const F &f)
1253 {
1254 f(m_cpu);
1255 f(m_os);
1256 }
1257
1259 bool operator==(const Platform &other) const;
1260
1262 bool operator!=(const Platform &other) const;
1263
1265 std::string toString() const;
1266
1268 friend std::ostream &operator<<(std::ostream &stream, const Platform &value)
1269 {
1270 return stream << value.toString();
1271 }
1272
1273 private:
1274 void setFromString(const std::string &value);
1275
1276 void setFromString(const std::string &fullPath, const std::string &value);
1277
1278 std::string getString(const std::string &fullPath) const;
1279
1280 CPU m_cpu;
1281 OS m_os;
1282
1283 friend struct DataModel::Detail::Befriend<Platform>;
1284 };
1285
1287
1288 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1290 {
1291 public:
1293 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1294
1296 static constexpr const char *path{ "UserToolchain" };
1297
1299 static constexpr const char *name{ "UserToolchain" };
1300
1302 static constexpr const char *description{
1303 R"description(Information about the current toolchain)description"
1304 };
1305
1307
1308 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1310 {
1311 public:
1313 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1314
1316 static constexpr const char *path{ "UserToolchain/Compiler" };
1317
1319 static constexpr const char *name{ "Compiler" };
1320
1322 static constexpr const char *description{
1323 R"description(Information about which compiler is being used)description"
1324 };
1325
1327
1328 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1330 {
1331 public:
1333 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1334
1336 static constexpr const char *path{ "UserToolchain/Compiler/ID" };
1337
1339 static constexpr const char *name{ "ID" };
1340
1342 static constexpr const char *description{ R"description(The name of the compiler)description" };
1343
1345 enum class ValueType
1346 {
1347 unknown,
1348 msvc,
1349 clang,
1350 gcc,
1351 intel,
1352 mingwGcc,
1353 mingwClang,
1354 mingwUnknown
1355 };
1356 static const ID unknown;
1357 static const ID msvc;
1358 static const ID clang;
1359 static const ID gcc;
1360 static const ID intel;
1361 static const ID mingwGcc;
1362 static const ID mingwClang;
1363 static const ID mingwUnknown;
1364
1366 static std::set<ValueType> validValues()
1367 {
1368 return { ValueType::unknown, ValueType::msvc, ValueType::clang,
1369 ValueType::gcc, ValueType::intel, ValueType::mingwGcc,
1370 ValueType::mingwClang, ValueType::mingwUnknown };
1371 }
1372
1374 ID() = default;
1375
1377 explicit constexpr ID(ValueType value)
1378 : m_value{ verifyValue(value) }
1379 {}
1380
1383
1385 std::string toString() const;
1386
1388 friend std::ostream &operator<<(std::ostream &stream, const ID::ValueType &value)
1389 {
1390 return stream << ID{ value }.toString();
1391 }
1392
1394 bool operator==(const ID &other) const
1395 {
1396 return m_value == other.m_value;
1397 }
1398
1400 bool operator!=(const ID &other) const
1401 {
1402 return m_value != other.m_value;
1403 }
1404
1406 friend std::ostream &operator<<(std::ostream &stream, const ID &value)
1407 {
1408 return stream << value.toString();
1409 }
1410
1411 private:
1412 void setFromString(const std::string &value);
1413
1414 constexpr ValueType static verifyValue(const ValueType &value)
1415 {
1416 return value == ValueType::unknown || value == ValueType::msvc || value == ValueType::clang
1417 || value == ValueType::gcc || value == ValueType::intel
1418 || value == ValueType::mingwGcc || value == ValueType::mingwClang
1419 || value == ValueType::mingwUnknown
1420 ? value
1421 : throw std::invalid_argument{
1422 "Invalid value: ID{ "
1423 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
1424 + " }"
1425 };
1426 }
1427
1428 ValueType m_value{ ValueType::unknown };
1429
1430 friend struct DataModel::Detail::Befriend<ID>;
1431 };
1432
1434
1435 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1437 {
1438 public:
1440 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1441
1443 static constexpr const char *path{ "UserToolchain/Compiler/Version" };
1444
1446 static constexpr const char *name{ "Version" };
1447
1449 static constexpr const char *description{
1450 R"description(The version of the compiler)description"
1451 };
1452
1454 using ValueType = std::string;
1455
1458 {
1459 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1460 }
1461
1463 Version() = default;
1464
1466 explicit Version(std::string value)
1467 : m_value{ std::move(value) }
1468 {}
1469
1471 const std::string &value() const;
1472
1474 std::string toString() const;
1475
1477 bool operator==(const Version &other) const
1478 {
1479 return m_value == other.m_value;
1480 }
1481
1483 bool operator!=(const Version &other) const
1484 {
1485 return m_value != other.m_value;
1486 }
1487
1489 bool operator<(const Version &other) const
1490 {
1491 return m_value < other.m_value;
1492 }
1493
1495 bool operator>(const Version &other) const
1496 {
1497 return m_value > other.m_value;
1498 }
1499
1501 bool operator<=(const Version &other) const
1502 {
1503 return m_value <= other.m_value;
1504 }
1505
1507 bool operator>=(const Version &other) const
1508 {
1509 return m_value >= other.m_value;
1510 }
1511
1513 friend std::ostream &operator<<(std::ostream &stream, const Version &value)
1514 {
1515 return stream << value.toString();
1516 }
1517
1518 private:
1519 void setFromString(const std::string &value);
1520
1521 std::string m_value{ "unknown" };
1522
1523 friend struct DataModel::Detail::Befriend<Version>;
1524 };
1525
1526 using Descendants = std::tuple<
1529
1532
1545#ifndef NO_DOC
1546 template<
1547 typename... Args,
1548 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1549 typename std::enable_if<
1550 Zivid::Detail::TypeTraits::
1551 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1552 int>::type = 0>
1553#else
1554 template<typename... Args>
1555#endif
1556 explicit Compiler(Args &&...args)
1557 {
1558 using namespace Zivid::Detail::TypeTraits;
1559
1560 static_assert(
1561 AllArgsDecayedAreUnique<Args...>::value,
1562 "Found duplicate types among the arguments passed to Compiler(...). "
1563 "Types should be listed at most once.");
1564
1565 set(std::forward<Args>(args)...);
1566 }
1567
1579#ifndef NO_DOC
1580 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1581#else
1582 template<typename... Args>
1583#endif
1584 void set(Args &&...args)
1585 {
1586 using namespace Zivid::Detail::TypeTraits;
1587
1588 using AllArgsAreDescendantNodes =
1589 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1590 static_assert(
1591 AllArgsAreDescendantNodes::value,
1592 "All arguments passed to set(...) must be descendant nodes.");
1593
1594 static_assert(
1595 AllArgsDecayedAreUnique<Args...>::value,
1596 "Found duplicate types among the arguments passed to set(...). "
1597 "Types should be listed at most once.");
1598
1599 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1600 }
1601
1614#ifndef NO_DOC
1615 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1616#else
1617 template<typename... Args>
1618#endif
1619 Compiler copyWith(Args &&...args) const
1620 {
1621 using namespace Zivid::Detail::TypeTraits;
1622
1623 using AllArgsAreDescendantNodes =
1624 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1625 static_assert(
1626 AllArgsAreDescendantNodes::value,
1627 "All arguments passed to copyWith(...) must be descendant nodes.");
1628
1629 static_assert(
1630 AllArgsDecayedAreUnique<Args...>::value,
1631 "Found duplicate types among the arguments passed to copyWith(...). "
1632 "Types should be listed at most once.");
1633
1634 auto copy{ *this };
1635 copy.set(std::forward<Args>(args)...);
1636 return copy;
1637 }
1638
1640 const ID &id() const
1641 {
1642 return m_id;
1643 }
1644
1647 {
1648 return m_id;
1649 }
1650
1652 Compiler &set(const ID &value)
1653 {
1654 m_id = value;
1655 return *this;
1656 }
1657
1659 const Version &version() const
1660 {
1661 return m_version;
1662 }
1663
1666 {
1667 return m_version;
1668 }
1669
1671 Compiler &set(const Version &value)
1672 {
1673 m_version = value;
1674 return *this;
1675 }
1676
1677 template<
1678 typename T,
1679 typename std::enable_if<
1680 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value,
1681 int>::type = 0>
1683 {
1684 return m_id;
1685 }
1686
1687 template<
1688 typename T,
1689 typename std::enable_if<
1690 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
1691 int>::type = 0>
1693 {
1694 return m_version;
1695 }
1696
1697 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1699 {
1700 return m_id;
1701 }
1702
1703 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1705 {
1706 return m_version;
1707 }
1708
1710 template<typename F>
1711 void forEach(const F &f) const
1712 {
1713 f(m_id);
1714 f(m_version);
1715 }
1716
1718 template<typename F>
1719 void forEach(const F &f)
1720 {
1721 f(m_id);
1722 f(m_version);
1723 }
1724
1726 bool operator==(const Compiler &other) const;
1727
1729 bool operator!=(const Compiler &other) const;
1730
1732 std::string toString() const;
1733
1735 friend std::ostream &operator<<(std::ostream &stream, const Compiler &value)
1736 {
1737 return stream << value.toString();
1738 }
1739
1740 private:
1741 void setFromString(const std::string &value);
1742
1743 void setFromString(const std::string &fullPath, const std::string &value);
1744
1745 std::string getString(const std::string &fullPath) const;
1746
1747 ID m_id;
1748 Version m_version;
1749
1750 friend struct DataModel::Detail::Befriend<Compiler>;
1751 };
1752
1754
1755 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1757 {
1758 public:
1760 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1761
1763 static constexpr const char *path{ "UserToolchain/CxxStandard" };
1764
1766 static constexpr const char *name{ "CxxStandard" };
1767
1769 static constexpr const char *description{ R"description(The C++ standard being used)description" };
1770
1772 using ValueType = std::string;
1773
1776 {
1777 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1778 }
1779
1781 CxxStandard() = default;
1782
1784 explicit CxxStandard(std::string value)
1785 : m_value{ std::move(value) }
1786 {}
1787
1789 const std::string &value() const;
1790
1792 std::string toString() const;
1793
1795 bool operator==(const CxxStandard &other) const
1796 {
1797 return m_value == other.m_value;
1798 }
1799
1801 bool operator!=(const CxxStandard &other) const
1802 {
1803 return m_value != other.m_value;
1804 }
1805
1807 bool operator<(const CxxStandard &other) const
1808 {
1809 return m_value < other.m_value;
1810 }
1811
1813 bool operator>(const CxxStandard &other) const
1814 {
1815 return m_value > other.m_value;
1816 }
1817
1819 bool operator<=(const CxxStandard &other) const
1820 {
1821 return m_value <= other.m_value;
1822 }
1823
1825 bool operator>=(const CxxStandard &other) const
1826 {
1827 return m_value >= other.m_value;
1828 }
1829
1831 friend std::ostream &operator<<(std::ostream &stream, const CxxStandard &value)
1832 {
1833 return stream << value.toString();
1834 }
1835
1836 private:
1837 void setFromString(const std::string &value);
1838
1839 std::string m_value{ "unknown" };
1840
1841 friend struct DataModel::Detail::Befriend<CxxStandard>;
1842 };
1843
1845
1846 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1848 {
1849 public:
1851 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1852
1854 static constexpr const char *path{ "UserToolchain/StandardLibrary" };
1855
1857 static constexpr const char *name{ "StandardLibrary" };
1858
1860 static constexpr const char *description{
1861 R"description(Information about what standard library implementation is being used)description"
1862 };
1863
1865
1866 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1868 {
1869 public:
1871 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1872
1874 static constexpr const char *path{ "UserToolchain/StandardLibrary/ID" };
1875
1877 static constexpr const char *name{ "ID" };
1878
1880 static constexpr const char *description{
1881 R"description(The name of the standard library implementation)description"
1882 };
1883
1885 enum class ValueType
1886 {
1887 unknown,
1888 msvc,
1889 libcxx,
1890 libstdcxx
1891 };
1892 static const ID unknown;
1893 static const ID msvc;
1894 static const ID libcxx;
1895 static const ID libstdcxx;
1896
1898 static std::set<ValueType> validValues()
1899 {
1900 return { ValueType::unknown, ValueType::msvc, ValueType::libcxx, ValueType::libstdcxx };
1901 }
1902
1904 ID() = default;
1905
1907 explicit constexpr ID(ValueType value)
1908 : m_value{ verifyValue(value) }
1909 {}
1910
1913
1915 std::string toString() const;
1916
1918 friend std::ostream &operator<<(std::ostream &stream, const ID::ValueType &value)
1919 {
1920 return stream << ID{ value }.toString();
1921 }
1922
1924 bool operator==(const ID &other) const
1925 {
1926 return m_value == other.m_value;
1927 }
1928
1930 bool operator!=(const ID &other) const
1931 {
1932 return m_value != other.m_value;
1933 }
1934
1936 friend std::ostream &operator<<(std::ostream &stream, const ID &value)
1937 {
1938 return stream << value.toString();
1939 }
1940
1941 private:
1942 void setFromString(const std::string &value);
1943
1944 constexpr ValueType static verifyValue(const ValueType &value)
1945 {
1946 return value == ValueType::unknown || value == ValueType::msvc || value == ValueType::libcxx
1947 || value == ValueType::libstdcxx
1948 ? value
1949 : throw std::invalid_argument{
1950 "Invalid value: ID{ "
1951 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
1952 + " }"
1953 };
1954 }
1955
1956 ValueType m_value{ ValueType::unknown };
1957
1958 friend struct DataModel::Detail::Befriend<ID>;
1959 };
1960
1962
1963 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1965 {
1966 public:
1968 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1969
1971 static constexpr const char *path{ "UserToolchain/StandardLibrary/Version" };
1972
1974 static constexpr const char *name{ "Version" };
1975
1977 static constexpr const char *description{
1978 R"description(The version of the standard library implementation)description"
1979 };
1980
1982 using ValueType = std::string;
1983
1986 {
1987 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1988 }
1989
1991 Version() = default;
1992
1994 explicit Version(std::string value)
1995 : m_value{ std::move(value) }
1996 {}
1997
1999 const std::string &value() const;
2000
2002 std::string toString() const;
2003
2005 bool operator==(const Version &other) const
2006 {
2007 return m_value == other.m_value;
2008 }
2009
2011 bool operator!=(const Version &other) const
2012 {
2013 return m_value != other.m_value;
2014 }
2015
2017 bool operator<(const Version &other) const
2018 {
2019 return m_value < other.m_value;
2020 }
2021
2023 bool operator>(const Version &other) const
2024 {
2025 return m_value > other.m_value;
2026 }
2027
2029 bool operator<=(const Version &other) const
2030 {
2031 return m_value <= other.m_value;
2032 }
2033
2035 bool operator>=(const Version &other) const
2036 {
2037 return m_value >= other.m_value;
2038 }
2039
2041 friend std::ostream &operator<<(std::ostream &stream, const Version &value)
2042 {
2043 return stream << value.toString();
2044 }
2045
2046 private:
2047 void setFromString(const std::string &value);
2048
2049 std::string m_value{ "unknown" };
2050
2051 friend struct DataModel::Detail::Befriend<Version>;
2052 };
2053
2054 using Descendants = std::tuple<
2057
2060
2073#ifndef NO_DOC
2074 template<
2075 typename... Args,
2076 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2077 typename std::enable_if<
2078 Zivid::Detail::TypeTraits::
2079 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2080 int>::type = 0>
2081#else
2082 template<typename... Args>
2083#endif
2084 explicit StandardLibrary(Args &&...args)
2085 {
2086 using namespace Zivid::Detail::TypeTraits;
2087
2088 static_assert(
2089 AllArgsDecayedAreUnique<Args...>::value,
2090 "Found duplicate types among the arguments passed to StandardLibrary(...). "
2091 "Types should be listed at most once.");
2092
2093 set(std::forward<Args>(args)...);
2094 }
2095
2107#ifndef NO_DOC
2108 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2109#else
2110 template<typename... Args>
2111#endif
2112 void set(Args &&...args)
2113 {
2114 using namespace Zivid::Detail::TypeTraits;
2115
2116 using AllArgsAreDescendantNodes =
2117 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2118 static_assert(
2119 AllArgsAreDescendantNodes::value,
2120 "All arguments passed to set(...) must be descendant nodes.");
2121
2122 static_assert(
2123 AllArgsDecayedAreUnique<Args...>::value,
2124 "Found duplicate types among the arguments passed to set(...). "
2125 "Types should be listed at most once.");
2126
2127 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2128 }
2129
2142#ifndef NO_DOC
2143 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2144#else
2145 template<typename... Args>
2146#endif
2147 StandardLibrary copyWith(Args &&...args) const
2148 {
2149 using namespace Zivid::Detail::TypeTraits;
2150
2151 using AllArgsAreDescendantNodes =
2152 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2153 static_assert(
2154 AllArgsAreDescendantNodes::value,
2155 "All arguments passed to copyWith(...) must be descendant nodes.");
2156
2157 static_assert(
2158 AllArgsDecayedAreUnique<Args...>::value,
2159 "Found duplicate types among the arguments passed to copyWith(...). "
2160 "Types should be listed at most once.");
2161
2162 auto copy{ *this };
2163 copy.set(std::forward<Args>(args)...);
2164 return copy;
2165 }
2166
2168 const ID &id() const
2169 {
2170 return m_id;
2171 }
2172
2175 {
2176 return m_id;
2177 }
2178
2180 StandardLibrary &set(const ID &value)
2181 {
2182 m_id = value;
2183 return *this;
2184 }
2185
2187 const Version &version() const
2188 {
2189 return m_version;
2190 }
2191
2194 {
2195 return m_version;
2196 }
2197
2200 {
2201 m_version = value;
2202 return *this;
2203 }
2204
2205 template<
2206 typename T,
2207 typename std::enable_if<
2208 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
2209 int>::type = 0>
2211 {
2212 return m_id;
2213 }
2214
2215 template<
2216 typename T,
2217 typename std::enable_if<
2218 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
2219 int>::type = 0>
2221 {
2222 return m_version;
2223 }
2224
2225 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2227 {
2228 return m_id;
2229 }
2230
2231 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2233 {
2234 return m_version;
2235 }
2236
2238 template<typename F>
2239 void forEach(const F &f) const
2240 {
2241 f(m_id);
2242 f(m_version);
2243 }
2244
2246 template<typename F>
2247 void forEach(const F &f)
2248 {
2249 f(m_id);
2250 f(m_version);
2251 }
2252
2254 bool operator==(const StandardLibrary &other) const;
2255
2257 bool operator!=(const StandardLibrary &other) const;
2258
2260 std::string toString() const;
2261
2263 friend std::ostream &operator<<(std::ostream &stream, const StandardLibrary &value)
2264 {
2265 return stream << value.toString();
2266 }
2267
2268 private:
2269 void setFromString(const std::string &value);
2270
2271 void setFromString(const std::string &fullPath, const std::string &value);
2272
2273 std::string getString(const std::string &fullPath) const;
2274
2275 ID m_id;
2276 Version m_version;
2277
2278 friend struct DataModel::Detail::Befriend<StandardLibrary>;
2279 };
2280
2281 using Descendants = std::tuple<
2289
2292
2310#ifndef NO_DOC
2311 template<
2312 typename... Args,
2313 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2314 typename std::enable_if<
2315 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2316 value,
2317 int>::type = 0>
2318#else
2319 template<typename... Args>
2320#endif
2321 explicit UserToolchain(Args &&...args)
2322 {
2323 using namespace Zivid::Detail::TypeTraits;
2324
2325 static_assert(
2326 AllArgsDecayedAreUnique<Args...>::value,
2327 "Found duplicate types among the arguments passed to UserToolchain(...). "
2328 "Types should be listed at most once.");
2329
2330 set(std::forward<Args>(args)...);
2331 }
2332
2349#ifndef NO_DOC
2350 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2351#else
2352 template<typename... Args>
2353#endif
2354 void set(Args &&...args)
2355 {
2356 using namespace Zivid::Detail::TypeTraits;
2357
2358 using AllArgsAreDescendantNodes =
2359 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2360 static_assert(
2361 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2362
2363 static_assert(
2364 AllArgsDecayedAreUnique<Args...>::value,
2365 "Found duplicate types among the arguments passed to set(...). "
2366 "Types should be listed at most once.");
2367
2368 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2369 }
2370
2388#ifndef NO_DOC
2389 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2390#else
2391 template<typename... Args>
2392#endif
2393 UserToolchain copyWith(Args &&...args) const
2394 {
2395 using namespace Zivid::Detail::TypeTraits;
2396
2397 using AllArgsAreDescendantNodes =
2398 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2399 static_assert(
2400 AllArgsAreDescendantNodes::value,
2401 "All arguments passed to copyWith(...) must be descendant nodes.");
2402
2403 static_assert(
2404 AllArgsDecayedAreUnique<Args...>::value,
2405 "Found duplicate types among the arguments passed to copyWith(...). "
2406 "Types should be listed at most once.");
2407
2408 auto copy{ *this };
2409 copy.set(std::forward<Args>(args)...);
2410 return copy;
2411 }
2412
2414 const Compiler &compiler() const
2415 {
2416 return m_compiler;
2417 }
2418
2421 {
2422 return m_compiler;
2423 }
2424
2427 {
2428 m_compiler = value;
2429 return *this;
2430 }
2431
2434 {
2435 m_compiler.set(value);
2436 return *this;
2437 }
2438
2441 {
2442 m_compiler.set(value);
2443 return *this;
2444 }
2445
2448 {
2449 return m_cxxStandard;
2450 }
2451
2454 {
2455 return m_cxxStandard;
2456 }
2457
2460 {
2461 m_cxxStandard = value;
2462 return *this;
2463 }
2464
2467 {
2468 return m_standardLibrary;
2469 }
2470
2473 {
2474 return m_standardLibrary;
2475 }
2476
2479 {
2480 m_standardLibrary = value;
2481 return *this;
2482 }
2483
2486 {
2487 m_standardLibrary.set(value);
2488 return *this;
2489 }
2490
2493 {
2494 m_standardLibrary.set(value);
2495 return *this;
2496 }
2497
2498 template<
2499 typename T,
2500 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler>::value, int>::
2501 type = 0>
2503 {
2504 return m_compiler;
2505 }
2506
2507 template<
2508 typename T,
2509 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value, int>::
2510 type = 0>
2512 {
2513 return m_compiler.get<EnvironmentInfo::UserToolchain::Compiler::ID>();
2514 }
2515
2516 template<
2517 typename T,
2518 typename std::enable_if<
2519 std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value,
2520 int>::type = 0>
2522 {
2524 }
2525
2526 template<
2527 typename T,
2528 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::CxxStandard>::value, int>::
2529 type = 0>
2531 {
2532 return m_cxxStandard;
2533 }
2534
2535 template<
2536 typename T,
2537 typename std::enable_if<
2538 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary>::value,
2539 int>::type = 0>
2541 {
2542 return m_standardLibrary;
2543 }
2544
2545 template<
2546 typename T,
2547 typename std::enable_if<
2548 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
2549 int>::type = 0>
2551 {
2552 return m_standardLibrary.get<EnvironmentInfo::UserToolchain::StandardLibrary::ID>();
2553 }
2554
2555 template<
2556 typename T,
2557 typename std::enable_if<
2558 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
2559 int>::type = 0>
2561 {
2562 return m_standardLibrary.get<EnvironmentInfo::UserToolchain::StandardLibrary::Version>();
2563 }
2564
2565 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2567 {
2568 return m_compiler;
2569 }
2570
2571 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2573 {
2574 return m_cxxStandard;
2575 }
2576
2577 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2579 {
2580 return m_standardLibrary;
2581 }
2582
2584 template<typename F>
2585 void forEach(const F &f) const
2586 {
2587 f(m_compiler);
2588 f(m_cxxStandard);
2589 f(m_standardLibrary);
2590 }
2591
2593 template<typename F>
2594 void forEach(const F &f)
2595 {
2596 f(m_compiler);
2597 f(m_cxxStandard);
2598 f(m_standardLibrary);
2599 }
2600
2602 bool operator==(const UserToolchain &other) const;
2603
2605 bool operator!=(const UserToolchain &other) const;
2606
2608 std::string toString() const;
2609
2611 friend std::ostream &operator<<(std::ostream &stream, const UserToolchain &value)
2612 {
2613 return stream << value.toString();
2614 }
2615
2616 private:
2617 void setFromString(const std::string &value);
2618
2619 void setFromString(const std::string &fullPath, const std::string &value);
2620
2621 std::string getString(const std::string &fullPath) const;
2622
2623 Compiler m_compiler;
2624 CxxStandard m_cxxStandard;
2625 StandardLibrary m_standardLibrary;
2626
2627 friend struct DataModel::Detail::Befriend<UserToolchain>;
2628 };
2629
2631
2632 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2634 {
2635 public:
2637 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
2638
2640 static constexpr const char *path{ "Wrapper" };
2641
2643 static constexpr const char *name{ "Wrapper" };
2644
2646 static constexpr const char *description{ R"description(The wrapper being used, if any)description" };
2647
2649 enum class ValueType
2650 {
2651 none,
2652 python,
2653 dotnet,
2654 genicam,
2655 ros1,
2656 ros2,
2657 studio
2658 };
2659 static const Wrapper none;
2660 static const Wrapper python;
2661 static const Wrapper dotnet;
2662 static const Wrapper genicam;
2663 static const Wrapper ros1;
2664 static const Wrapper ros2;
2665 static const Wrapper studio;
2666
2668 static std::set<ValueType> validValues()
2669 {
2670 return { ValueType::none, ValueType::python, ValueType::dotnet, ValueType::genicam,
2671 ValueType::ros1, ValueType::ros2, ValueType::studio };
2672 }
2673
2675 Wrapper() = default;
2676
2678 explicit constexpr Wrapper(ValueType value)
2679 : m_value{ verifyValue(value) }
2680 {}
2681
2684
2686 std::string toString() const;
2687
2689 friend std::ostream &operator<<(std::ostream &stream, const Wrapper::ValueType &value)
2690 {
2691 return stream << Wrapper{ value }.toString();
2692 }
2693
2695 bool operator==(const Wrapper &other) const
2696 {
2697 return m_value == other.m_value;
2698 }
2699
2701 bool operator!=(const Wrapper &other) const
2702 {
2703 return m_value != other.m_value;
2704 }
2705
2707 friend std::ostream &operator<<(std::ostream &stream, const Wrapper &value)
2708 {
2709 return stream << value.toString();
2710 }
2711
2712 private:
2713 void setFromString(const std::string &value);
2714
2715 constexpr ValueType static verifyValue(const ValueType &value)
2716 {
2717 return value == ValueType::none || value == ValueType::python || value == ValueType::dotnet
2718 || value == ValueType::genicam || value == ValueType::ros1
2719 || value == ValueType::ros2 || value == ValueType::studio
2720 ? value
2721 : throw std::invalid_argument{
2722 "Invalid value: Wrapper{ "
2723 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
2724 };
2725 }
2726
2727 ValueType m_value{ ValueType::none };
2728
2729 friend struct DataModel::Detail::Befriend<Wrapper>;
2730 };
2731
2732 using Descendants = std::tuple<
2749
2752
2754 explicit EnvironmentInfo(const std::string &fileName);
2755
2761 ZIVID_NODISCARD static EnvironmentInfo fromSerialized(const std::string &value);
2762
2768 std::string serialize() const;
2769
2796#ifndef NO_DOC
2797 template<
2798 typename... Args,
2799 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2800 typename std::enable_if<
2801 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2802 value,
2803 int>::type = 0>
2804#else
2805 template<typename... Args>
2806#endif
2807 explicit EnvironmentInfo(Args &&...args)
2808 {
2809 using namespace Zivid::Detail::TypeTraits;
2810
2811 static_assert(
2812 AllArgsDecayedAreUnique<Args...>::value,
2813 "Found duplicate types among the arguments passed to EnvironmentInfo(...). "
2814 "Types should be listed at most once.");
2815
2816 set(std::forward<Args>(args)...);
2817 }
2818
2844#ifndef NO_DOC
2845 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2846#else
2847 template<typename... Args>
2848#endif
2849 void set(Args &&...args)
2850 {
2851 using namespace Zivid::Detail::TypeTraits;
2852
2853 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2854 static_assert(
2855 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2856
2857 static_assert(
2858 AllArgsDecayedAreUnique<Args...>::value,
2859 "Found duplicate types among the arguments passed to set(...). "
2860 "Types should be listed at most once.");
2861
2862 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2863 }
2864
2891#ifndef NO_DOC
2892 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2893#else
2894 template<typename... Args>
2895#endif
2896 EnvironmentInfo copyWith(Args &&...args) const
2897 {
2898 using namespace Zivid::Detail::TypeTraits;
2899
2900 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2901 static_assert(
2902 AllArgsAreDescendantNodes::value,
2903 "All arguments passed to copyWith(...) must be descendant nodes.");
2904
2905 static_assert(
2906 AllArgsDecayedAreUnique<Args...>::value,
2907 "Found duplicate types among the arguments passed to copyWith(...). "
2908 "Types should be listed at most once.");
2909
2910 auto copy{ *this };
2911 copy.set(std::forward<Args>(args)...);
2912 return copy;
2913 }
2914
2916 const Platform &platform() const
2917 {
2918 return m_platform;
2919 }
2920
2923 {
2924 return m_platform;
2925 }
2926
2929 {
2930 m_platform = value;
2931 return *this;
2932 }
2933
2936 {
2937 m_platform.set(value);
2938 return *this;
2939 }
2940
2943 {
2944 m_platform.set(value);
2945 return *this;
2946 }
2947
2950 {
2951 m_platform.set(value);
2952 return *this;
2953 }
2954
2957 {
2958 m_platform.set(value);
2959 return *this;
2960 }
2961
2964 {
2965 m_platform.set(value);
2966 return *this;
2967 }
2968
2971 {
2972 m_platform.set(value);
2973 return *this;
2974 }
2975
2978 {
2979 return m_userToolchain;
2980 }
2981
2984 {
2985 return m_userToolchain;
2986 }
2987
2990 {
2991 m_userToolchain = value;
2992 return *this;
2993 }
2994
2997 {
2998 m_userToolchain.set(value);
2999 return *this;
3000 }
3001
3004 {
3005 m_userToolchain.set(value);
3006 return *this;
3007 }
3008
3011 {
3012 m_userToolchain.set(value);
3013 return *this;
3014 }
3015
3018 {
3019 m_userToolchain.set(value);
3020 return *this;
3021 }
3022
3025 {
3026 m_userToolchain.set(value);
3027 return *this;
3028 }
3029
3032 {
3033 m_userToolchain.set(value);
3034 return *this;
3035 }
3036
3039 {
3040 m_userToolchain.set(value);
3041 return *this;
3042 }
3043
3045 const Wrapper &wrapper() const
3046 {
3047 return m_wrapper;
3048 }
3049
3052 {
3053 return m_wrapper;
3054 }
3055
3058 {
3059 m_wrapper = value;
3060 return *this;
3061 }
3062
3063 template<
3064 typename T,
3065 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform>::value, int>::type = 0>
3067 {
3068 return m_platform;
3069 }
3070
3071 template<
3072 typename T,
3073 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU>::value, int>::type = 0>
3075 {
3076 return m_platform.get<EnvironmentInfo::Platform::CPU>();
3077 }
3078
3079 template<
3080 typename T,
3081 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::Architecture>::value, int>::
3082 type = 0>
3084 {
3085 return m_platform.get<EnvironmentInfo::Platform::CPU::Architecture>();
3086 }
3087
3088 template<
3089 typename T,
3090 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::CPU::ModelName>::value, int>::type =
3091 0>
3093 {
3094 return m_platform.get<EnvironmentInfo::Platform::CPU::ModelName>();
3095 }
3096
3097 template<
3098 typename T,
3099 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS>::value, int>::type = 0>
3101 {
3102 return m_platform.get<EnvironmentInfo::Platform::OS>();
3103 }
3104
3105 template<
3106 typename T,
3107 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::ID>::value, int>::type = 0>
3109 {
3110 return m_platform.get<EnvironmentInfo::Platform::OS::ID>();
3111 }
3112
3113 template<
3114 typename T,
3115 typename std::enable_if<std::is_same<T, EnvironmentInfo::Platform::OS::Version>::value, int>::type = 0>
3117 {
3118 return m_platform.get<EnvironmentInfo::Platform::OS::Version>();
3119 }
3120
3121 template<
3122 typename T,
3123 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain>::value, int>::type = 0>
3125 {
3126 return m_userToolchain;
3127 }
3128
3129 template<
3130 typename T,
3131 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler>::value, int>::type =
3132 0>
3134 {
3135 return m_userToolchain.get<EnvironmentInfo::UserToolchain::Compiler>();
3136 }
3137
3138 template<
3139 typename T,
3140 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::ID>::value, int>::
3141 type = 0>
3143 {
3144 return m_userToolchain.get<EnvironmentInfo::UserToolchain::Compiler::ID>();
3145 }
3146
3147 template<
3148 typename T,
3149 typename std::
3150 enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::Compiler::Version>::value, int>::type = 0>
3152 {
3153 return m_userToolchain.get<EnvironmentInfo::UserToolchain::Compiler::Version>();
3154 }
3155
3156 template<
3157 typename T,
3158 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::CxxStandard>::value, int>::
3159 type = 0>
3161 {
3162 return m_userToolchain.get<EnvironmentInfo::UserToolchain::CxxStandard>();
3163 }
3164
3165 template<
3166 typename T,
3167 typename std::enable_if<std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary>::value, int>::
3168 type = 0>
3170 {
3171 return m_userToolchain.get<EnvironmentInfo::UserToolchain::StandardLibrary>();
3172 }
3173
3174 template<
3175 typename T,
3176 typename std::enable_if<
3177 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::ID>::value,
3178 int>::type = 0>
3180 {
3181 return m_userToolchain.get<EnvironmentInfo::UserToolchain::StandardLibrary::ID>();
3182 }
3183
3184 template<
3185 typename T,
3186 typename std::enable_if<
3187 std::is_same<T, EnvironmentInfo::UserToolchain::StandardLibrary::Version>::value,
3188 int>::type = 0>
3190 {
3192 }
3193
3194 template<
3195 typename T,
3196 typename std::enable_if<std::is_same<T, EnvironmentInfo::Wrapper>::value, int>::type = 0>
3198 {
3199 return m_wrapper;
3200 }
3201
3202 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3204 {
3205 return m_platform;
3206 }
3207
3208 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3210 {
3211 return m_userToolchain;
3212 }
3213
3214 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3216 {
3217 return m_wrapper;
3218 }
3219
3221 template<typename F>
3222 void forEach(const F &f) const
3223 {
3224 f(m_platform);
3225 f(m_userToolchain);
3226 f(m_wrapper);
3227 }
3228
3230 template<typename F>
3231 void forEach(const F &f)
3232 {
3233 f(m_platform);
3234 f(m_userToolchain);
3235 f(m_wrapper);
3236 }
3237
3239 bool operator==(const EnvironmentInfo &other) const;
3240
3242 bool operator!=(const EnvironmentInfo &other) const;
3243
3245 std::string toString() const;
3246
3248 friend std::ostream &operator<<(std::ostream &stream, const EnvironmentInfo &value)
3249 {
3250 return stream << value.toString();
3251 }
3252
3254 void save(const std::string &fileName) const;
3255
3257 void load(const std::string &fileName);
3258
3259 private:
3260 void setFromString(const std::string &value);
3261
3262 void setFromString(const std::string &fullPath, const std::string &value);
3263
3264 std::string getString(const std::string &fullPath) const;
3265
3266 Platform m_platform;
3267 UserToolchain m_userToolchain;
3268 Wrapper m_wrapper;
3269
3270 friend struct DataModel::Detail::Befriend<EnvironmentInfo>;
3271 };
3272
3273#ifndef NO_DOC
3275 namespace Detail
3276 {
3277 ZIVID_CORE_EXPORT void save(const EnvironmentInfo &dataModel, std::ostream &ostream);
3278 ZIVID_CORE_EXPORT void load(EnvironmentInfo &dataModel, std::istream &istream);
3279 } // namespace Detail
3280#endif
3281
3282#ifndef NO_DOC
3283 template<>
3284 struct EnvironmentInfo::Version<1>
3285 {
3286 using Type = EnvironmentInfo;
3287 };
3288#endif
3289
3290 } // namespace Detail
3291} // namespace Zivid
3292
3293#ifdef _MSC_VER
3294# pragma warning(pop)
3295#endif
3296
3297#ifndef NO_DOC
3298# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
3299namespace std // NOLINT
3300{
3301
3302 template<>
3303 struct tuple_size<Zivid::Detail::EnvironmentInfo::Platform> : integral_constant<size_t, 2>
3304 {};
3305
3306 template<size_t i>
3307 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::Platform>
3308 {
3309 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform>::value, "Index must be less than 2");
3310
3311 using type // NOLINT
3312 = decltype(declval<Zivid::Detail::EnvironmentInfo::Platform>().get<i>());
3313 };
3314
3315 template<>
3316 struct tuple_size<Zivid::Detail::EnvironmentInfo::Platform::CPU> : integral_constant<size_t, 2>
3317 {};
3318
3319 template<size_t i>
3320 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::Platform::CPU>
3321 {
3322 static_assert(
3323 i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform::CPU>::value,
3324 "Index must be less than 2");
3325
3326 using type // NOLINT
3327 = decltype(declval<Zivid::Detail::EnvironmentInfo::Platform::CPU>().get<i>());
3328 };
3329
3330 template<>
3331 struct tuple_size<Zivid::Detail::EnvironmentInfo::Platform::OS> : integral_constant<size_t, 2>
3332 {};
3333
3334 template<size_t i>
3335 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::Platform::OS>
3336 {
3337 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo::Platform::OS>::value, "Index must be less than 2");
3338
3339 using type // NOLINT
3340 = decltype(declval<Zivid::Detail::EnvironmentInfo::Platform::OS>().get<i>());
3341 };
3342
3343 template<>
3344 struct tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain> : integral_constant<size_t, 3>
3345 {};
3346
3347 template<size_t i>
3348 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::UserToolchain>
3349 {
3350 static_assert(
3351 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain>::value,
3352 "Index must be less than 3");
3353
3354 using type // NOLINT
3355 = decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain>().get<i>());
3356 };
3357
3358 template<>
3359 struct tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler> : integral_constant<size_t, 2>
3360 {};
3361
3362 template<size_t i>
3363 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>
3364 {
3365 static_assert(
3366 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>::value,
3367 "Index must be less than 2");
3368
3369 using type // NOLINT
3370 = decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain::Compiler>().get<i>());
3371 };
3372
3373 template<>
3374 struct tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary> : integral_constant<size_t, 2>
3375 {};
3376
3377 template<size_t i>
3378 struct tuple_element<i, Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>
3379 {
3380 static_assert(
3381 i < tuple_size<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>::value,
3382 "Index must be less than 2");
3383
3384 using type // NOLINT
3385 = decltype(declval<Zivid::Detail::EnvironmentInfo::UserToolchain::StandardLibrary>().get<i>());
3386 };
3387
3388 template<>
3389 struct tuple_size<Zivid::Detail::EnvironmentInfo> : integral_constant<size_t, 3>
3390 {};
3391
3392 template<size_t i>
3393 struct tuple_element<i, Zivid::Detail::EnvironmentInfo>
3394 {
3395 static_assert(i < tuple_size<Zivid::Detail::EnvironmentInfo>::value, "Index must be less than 3");
3396
3397 using type // NOLINT
3398 = decltype(declval<Zivid::Detail::EnvironmentInfo>().get<i>());
3399 };
3400
3401} // namespace std
3402# endif
3403#endif
3404
3405// If we have access to the DataModel library, automatically include internal DataModel
3406// header. This header is necessary for serialization and deserialization.
3407#if defined(__has_include) && !defined(NO_DOC)
3408# if __has_include("Zivid/Detail/EnvironmentInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
3409# include "Zivid/Detail/EnvironmentInfoInternal.h"
3410# endif
3411#endif
#define ZIVID_NODISCARD
Definition Attributes.h:49
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
CPU architecture.
Definition EnvironmentInfo.h:153
bool operator==(const Architecture &other) const
Comparison operator.
Definition EnvironmentInfo.h:205
constexpr Architecture(ValueType value)
Constructor.
Definition EnvironmentInfo.h:188
static std::set< ValueType > validValues()
All valid values of Architecture.
Definition EnvironmentInfo.h:179
bool operator!=(const Architecture &other) const
Comparison operator.
Definition EnvironmentInfo.h:211
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:169
static const Architecture arm64
arm64
Definition EnvironmentInfo.h:176
static const Architecture unknown
unknown
Definition EnvironmentInfo.h:174
friend std::ostream & operator<<(std::ostream &stream, const Architecture &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:217
friend std::ostream & operator<<(std::ostream &stream, const Architecture::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:199
static const Architecture amd64
amd64
Definition EnvironmentInfo.h:175
CPU model name.
Definition EnvironmentInfo.h:245
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:260
std::string toString() const
Get the value as string.
bool operator>(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:301
bool operator==(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:283
const std::string & value() const
Get the value.
bool operator>=(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:313
bool operator!=(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:289
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:319
bool operator<(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:295
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName.
Definition EnvironmentInfo.h:263
ModelName(std::string value)
Constructor.
Definition EnvironmentInfo.h:272
bool operator<=(const ModelName &other) const
Comparison operator.
Definition EnvironmentInfo.h:307
Information about the CPU.
Definition EnvironmentInfo.h:135
const EnvironmentInfo::Platform::CPU::ModelName & get() const
Definition EnvironmentInfo.h:496
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:445
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:389
ModelName & modelName()
Get ModelName.
Definition EnvironmentInfo.h:470
std:: tuple< EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName > Descendants
Definition EnvironmentInfo.h:332
const ModelName & modelName() const
Get ModelName.
Definition EnvironmentInfo.h:464
Architecture & architecture()
Get Architecture.
Definition EnvironmentInfo.h:451
friend std::ostream & operator<<(std::ostream &stream, const CPU &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:539
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:424
CPU & set(const ModelName &value)
Set ModelName.
Definition EnvironmentInfo.h:476
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:515
bool operator!=(const CPU &other) const
Inequality operator.
CPU & set(const Architecture &value)
Set Architecture.
Definition EnvironmentInfo.h:457
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:523
const EnvironmentInfo::Platform::CPU::Architecture & get() const
Definition EnvironmentInfo.h:487
Operating system name.
Definition EnvironmentInfo.h:581
bool operator==(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:633
friend std::ostream & operator<<(std::ostream &stream, const ID::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:627
constexpr ID(ValueType value)
Constructor.
Definition EnvironmentInfo.h:616
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:597
std::string toString() const
Get the value as string.
static const ID windows
windows
Definition EnvironmentInfo.h:603
friend std::ostream & operator<<(std::ostream &stream, const ID &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:645
static const ID unknown
unknown
Definition EnvironmentInfo.h:602
static const ID gnulinux
gnulinux
Definition EnvironmentInfo.h:604
bool operator!=(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:639
static std::set< ValueType > validValues()
All valid values of ID.
Definition EnvironmentInfo.h:607
ValueType value() const
Get the value.
Operating system version.
Definition EnvironmentInfo.h:674
bool operator>(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:730
friend std::ostream & operator<<(std::ostream &stream, const Version &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:748
bool operator!=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:718
bool operator==(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:712
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:692
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:689
bool operator>=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:742
Version(std::string value)
Constructor.
Definition EnvironmentInfo.h:701
bool operator<(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:724
bool operator<=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:736
Operation system name and version.
Definition EnvironmentInfo.h:561
std::tuple< EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version > Descendants
Definition EnvironmentInfo.h:761
friend std::ostream & operator<<(std::ostream &stream, const OS &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:967
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:951
const ID & id() const
Get ID.
Definition EnvironmentInfo.h:874
bool operator==(const OS &other) const
Equality operator.
const EnvironmentInfo::Platform::OS::Version & get() const
Definition EnvironmentInfo.h:924
Version & version()
Get Version.
Definition EnvironmentInfo.h:899
OS & set(const ID &value)
Set ID.
Definition EnvironmentInfo.h:886
std::string toString() const
Get the value as string.
ID & id()
Get ID.
Definition EnvironmentInfo.h:880
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:943
const Version & version() const
Get Version.
Definition EnvironmentInfo.h:893
OS & set(const Version &value)
Set Version.
Definition EnvironmentInfo.h:905
const EnvironmentInfo::Platform::OS::ID & get() const
Definition EnvironmentInfo.h:915
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:853
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:818
Information about the current platform.
Definition EnvironmentInfo.h:115
const EnvironmentInfo::Platform::CPU::ModelName & get() const
Definition EnvironmentInfo.h:1200
Platform & set(const OS &value)
Set OS.
Definition EnvironmentInfo.h:1159
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:1055
Platform & set(const CPU &value)
Set CPU.
Definition EnvironmentInfo.h:1126
bool operator==(const Platform &other) const
Equality operator.
Platform & set(const CPU::Architecture &value)
Set CPU::Architecture.
Definition EnvironmentInfo.h:1133
const CPU & cpu() const
Get CPU.
Definition EnvironmentInfo.h:1114
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:1244
const EnvironmentInfo::Platform::CPU::Architecture & get() const
Definition EnvironmentInfo.h:1191
Platform & set(const OS::Version &value)
Set OS::Version.
Definition EnvironmentInfo.h:1173
const OS & os() const
Get OS.
Definition EnvironmentInfo.h:1147
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:1268
const EnvironmentInfo::Platform::OS::Version & get() const
Definition EnvironmentInfo.h:1225
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:1093
const EnvironmentInfo::Platform::OS & get() const
Definition EnvironmentInfo.h:1208
bool operator!=(const Platform &other) const
Inequality operator.
const EnvironmentInfo::Platform::CPU & get() const
Definition EnvironmentInfo.h:1182
Platform & set(const OS::ID &value)
Set OS::ID.
Definition EnvironmentInfo.h:1166
const EnvironmentInfo::Platform::OS::ID & get() const
Definition EnvironmentInfo.h:1216
CPU & cpu()
Get CPU.
Definition EnvironmentInfo.h:1120
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:1252
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:985
Platform & set(const CPU::ModelName &value)
Set CPU::ModelName.
Definition EnvironmentInfo.h:1140
OS & os()
Get OS.
Definition EnvironmentInfo.h:1153
The name of the compiler.
Definition EnvironmentInfo.h:1330
static const ID clang
clang
Definition EnvironmentInfo.h:1358
friend std::ostream & operator<<(std::ostream &stream, const ID::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:1388
static const ID mingwClang
mingwClang
Definition EnvironmentInfo.h:1362
static const ID unknown
unknown
Definition EnvironmentInfo.h:1356
static const ID msvc
msvc
Definition EnvironmentInfo.h:1357
static std::set< ValueType > validValues()
All valid values of ID.
Definition EnvironmentInfo.h:1366
static const ID gcc
gcc
Definition EnvironmentInfo.h:1359
bool operator==(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:1394
friend std::ostream & operator<<(std::ostream &stream, const ID &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:1406
constexpr ID(ValueType value)
Constructor.
Definition EnvironmentInfo.h:1377
static const ID mingwGcc
mingwGcc
Definition EnvironmentInfo.h:1361
static const ID mingwUnknown
mingwUnknown
Definition EnvironmentInfo.h:1363
static const ID intel
intel
Definition EnvironmentInfo.h:1360
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1346
bool operator!=(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:1400
std::string toString() const
Get the value as string.
The version of the compiler.
Definition EnvironmentInfo.h:1437
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Version.
Definition EnvironmentInfo.h:1457
bool operator==(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1477
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:1513
Version(std::string value)
Constructor.
Definition EnvironmentInfo.h:1466
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1454
bool operator>=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1507
bool operator!=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1483
bool operator<(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1489
bool operator<=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1501
bool operator>(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:1495
Information about which compiler is being used.
Definition EnvironmentInfo.h:1310
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:1711
std::tuple< EnvironmentInfo::UserToolchain::Compiler::ID, EnvironmentInfo::UserToolchain::Compiler::Version > Descendants
Definition EnvironmentInfo.h:1526
const EnvironmentInfo::UserToolchain::Compiler::ID & get() const
Definition EnvironmentInfo.h:1682
const EnvironmentInfo::UserToolchain::Compiler::Version & get() const
Definition EnvironmentInfo.h:1692
Compiler & set(const ID &value)
Set ID.
Definition EnvironmentInfo.h:1652
const ID & id() const
Get ID.
Definition EnvironmentInfo.h:1640
std::string toString() const
Get the value as string.
Version & version()
Get Version.
Definition EnvironmentInfo.h:1665
const Version & version() const
Get Version.
Definition EnvironmentInfo.h:1659
ID & id()
Get ID.
Definition EnvironmentInfo.h:1646
friend std::ostream & operator<<(std::ostream &stream, const Compiler &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:1735
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:1584
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:1719
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:1619
bool operator!=(const Compiler &other) const
Inequality operator.
Compiler & set(const Version &value)
Set Version.
Definition EnvironmentInfo.h:1671
bool operator==(const Compiler &other) const
Equality operator.
The C++ standard being used.
Definition EnvironmentInfo.h:1757
bool operator<(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1807
const std::string & value() const
Get the value.
bool operator!=(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1801
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1772
bool operator<=(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1819
bool operator>(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1813
friend std::ostream & operator<<(std::ostream &stream, const CxxStandard &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:1831
CxxStandard(std::string value)
Constructor.
Definition EnvironmentInfo.h:1784
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for CxxStandard.
Definition EnvironmentInfo.h:1775
bool operator==(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1795
std::string toString() const
Get the value as string.
bool operator>=(const CxxStandard &other) const
Comparison operator.
Definition EnvironmentInfo.h:1825
The name of the standard library implementation.
Definition EnvironmentInfo.h:1868
static const ID libstdcxx
libstdcxx
Definition EnvironmentInfo.h:1895
static const ID msvc
msvc
Definition EnvironmentInfo.h:1893
constexpr ID(ValueType value)
Constructor.
Definition EnvironmentInfo.h:1907
friend std::ostream & operator<<(std::ostream &stream, const ID::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:1918
bool operator==(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:1924
friend std::ostream & operator<<(std::ostream &stream, const ID &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:1936
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1886
static const ID unknown
unknown
Definition EnvironmentInfo.h:1892
static std::set< ValueType > validValues()
All valid values of ID.
Definition EnvironmentInfo.h:1898
static const ID libcxx
libcxx
Definition EnvironmentInfo.h:1894
bool operator!=(const ID &other) const
Comparison operator.
Definition EnvironmentInfo.h:1930
The version of the standard library implementation.
Definition EnvironmentInfo.h:1965
bool operator<=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2029
friend std::ostream & operator<<(std::ostream &stream, const Version &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:2041
bool operator<(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2017
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Version.
Definition EnvironmentInfo.h:1985
std::string ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:1982
bool operator>=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2035
bool operator!=(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2011
Version(std::string value)
Constructor.
Definition EnvironmentInfo.h:1994
bool operator==(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2005
bool operator>(const Version &other) const
Comparison operator.
Definition EnvironmentInfo.h:2023
Information about what standard library implementation is being used.
Definition EnvironmentInfo.h:1848
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:2147
std::string toString() const
Get the value as string.
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:2112
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:2239
std::tuple< EnvironmentInfo::UserToolchain::StandardLibrary::ID, EnvironmentInfo::UserToolchain::StandardLibrary::Version > Descendants
Definition EnvironmentInfo.h:2054
const Version & version() const
Get Version.
Definition EnvironmentInfo.h:2187
StandardLibrary & set(const Version &value)
Set Version.
Definition EnvironmentInfo.h:2199
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:2247
friend std::ostream & operator<<(std::ostream &stream, const StandardLibrary &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:2263
StandardLibrary & set(const ID &value)
Set ID.
Definition EnvironmentInfo.h:2180
const ID & id() const
Get ID.
Definition EnvironmentInfo.h:2168
const EnvironmentInfo::UserToolchain::StandardLibrary::Version & get() const
Definition EnvironmentInfo.h:2220
Version & version()
Get Version.
Definition EnvironmentInfo.h:2193
bool operator!=(const StandardLibrary &other) const
Inequality operator.
ID & id()
Get ID.
Definition EnvironmentInfo.h:2174
bool operator==(const StandardLibrary &other) const
Equality operator.
const EnvironmentInfo::UserToolchain::StandardLibrary::ID & get() const
Definition EnvironmentInfo.h:2210
Information about the current toolchain.
Definition EnvironmentInfo.h:1290
UserToolchain & set(const StandardLibrary &value)
Set StandardLibrary.
Definition EnvironmentInfo.h:2478
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:2594
StandardLibrary & standardLibrary()
Get StandardLibrary.
Definition EnvironmentInfo.h:2472
const CxxStandard & cxxStandard() const
Get CxxStandard.
Definition EnvironmentInfo.h:2447
std::string toString() const
Get the value as string.
const EnvironmentInfo::UserToolchain::CxxStandard & get() const
Definition EnvironmentInfo.h:2530
UserToolchain & set(const StandardLibrary::ID &value)
Set StandardLibrary::ID.
Definition EnvironmentInfo.h:2485
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:2585
bool operator!=(const UserToolchain &other) const
Inequality operator.
UserToolchain & set(const Compiler &value)
Set Compiler.
Definition EnvironmentInfo.h:2426
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:2393
UserToolchain & set(const StandardLibrary::Version &value)
Set StandardLibrary::Version.
Definition EnvironmentInfo.h:2492
bool operator==(const UserToolchain &other) const
Equality operator.
const Compiler & compiler() const
Get Compiler.
Definition EnvironmentInfo.h:2414
const EnvironmentInfo::UserToolchain::Compiler & get() const
Definition EnvironmentInfo.h:2502
UserToolchain & set(const Compiler::ID &value)
Set Compiler::ID.
Definition EnvironmentInfo.h:2433
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:2354
const EnvironmentInfo::UserToolchain::StandardLibrary & get() const
Definition EnvironmentInfo.h:2540
const EnvironmentInfo::UserToolchain::Compiler::Version & get() const
Definition EnvironmentInfo.h:2521
UserToolchain & set(const Compiler::Version &value)
Set Compiler::Version.
Definition EnvironmentInfo.h:2440
const StandardLibrary & standardLibrary() const
Get StandardLibrary.
Definition EnvironmentInfo.h:2466
const EnvironmentInfo::UserToolchain::StandardLibrary::Version & get() const
Definition EnvironmentInfo.h:2560
Compiler & compiler()
Get Compiler.
Definition EnvironmentInfo.h:2420
const EnvironmentInfo::UserToolchain::Compiler::ID & get() const
Definition EnvironmentInfo.h:2511
const EnvironmentInfo::UserToolchain::StandardLibrary::ID & get() const
Definition EnvironmentInfo.h:2550
friend std::ostream & operator<<(std::ostream &stream, const UserToolchain &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:2611
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:2281
CxxStandard & cxxStandard()
Get CxxStandard.
Definition EnvironmentInfo.h:2453
UserToolchain & set(const CxxStandard &value)
Set CxxStandard.
Definition EnvironmentInfo.h:2459
The wrapper being used, if any.
Definition EnvironmentInfo.h:2634
static const Wrapper genicam
genicam
Definition EnvironmentInfo.h:2662
static const Wrapper dotnet
dotnet
Definition EnvironmentInfo.h:2661
ValueType
The type of the underlying value.
Definition EnvironmentInfo.h:2650
static const Wrapper python
python
Definition EnvironmentInfo.h:2660
static const Wrapper ros2
ros2
Definition EnvironmentInfo.h:2664
ValueType value() const
Get the value.
bool operator==(const Wrapper &other) const
Comparison operator.
Definition EnvironmentInfo.h:2695
friend std::ostream & operator<<(std::ostream &stream, const Wrapper &value)
Operator to serialize the value to a stream.
Definition EnvironmentInfo.h:2707
bool operator!=(const Wrapper &other) const
Comparison operator.
Definition EnvironmentInfo.h:2701
static const Wrapper studio
studio
Definition EnvironmentInfo.h:2665
Wrapper()=default
Default constructor.
static std::set< ValueType > validValues()
All valid values of Wrapper.
Definition EnvironmentInfo.h:2668
friend std::ostream & operator<<(std::ostream &stream, const Wrapper::ValueType &value)
Operator to serialize ValueType to a stream.
Definition EnvironmentInfo.h:2689
static const Wrapper none
none
Definition EnvironmentInfo.h:2659
std::string toString() const
Get the value as string.
constexpr Wrapper(ValueType value)
Constructor.
Definition EnvironmentInfo.h:2678
static const Wrapper ros1
ros1
Definition EnvironmentInfo.h:2663
Information about the current toolchain and platform.
Definition EnvironmentInfo.h:81
bool operator==(const EnvironmentInfo &other) const
Equality operator.
EnvironmentInfo & set(const UserToolchain::StandardLibrary::ID &value)
Set UserToolchain::StandardLibrary::ID.
Definition EnvironmentInfo.h:3031
const EnvironmentInfo::Platform::OS::Version & get() const
Definition EnvironmentInfo.h:3116
EnvironmentInfo & set(const Platform::OS &value)
Set Platform::OS.
Definition EnvironmentInfo.h:2956
EnvironmentInfo copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition EnvironmentInfo.h:2896
Wrapper & wrapper()
Get Wrapper.
Definition EnvironmentInfo.h:3051
void save(const std::string &fileName) const
Save to the given file.
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:3222
EnvironmentInfo & set(const Platform::CPU &value)
Set Platform::CPU.
Definition EnvironmentInfo.h:2935
std::string serialize() const
Serialize to a string.
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition EnvironmentInfo.h:3231
const EnvironmentInfo::Platform::OS & get() const
Definition EnvironmentInfo.h:3100
const EnvironmentInfo::Platform::CPU & get() const
Definition EnvironmentInfo.h:3074
const EnvironmentInfo::Wrapper & get() const
Definition EnvironmentInfo.h:3197
EnvironmentInfo & set(const UserToolchain &value)
Set UserToolchain.
Definition EnvironmentInfo.h:2989
std::tuple< EnvironmentInfo::Platform, EnvironmentInfo::Platform::CPU, EnvironmentInfo::Platform::CPU::Architecture, EnvironmentInfo::Platform::CPU::ModelName, EnvironmentInfo::Platform::OS, EnvironmentInfo::Platform::OS::ID, EnvironmentInfo::Platform::OS::Version, EnvironmentInfo::UserToolchain, EnvironmentInfo::UserToolchain::Compiler, EnvironmentInfo::UserToolchain::Compiler::ID, EnvironmentInfo::UserToolchain::Compiler::Version, EnvironmentInfo::UserToolchain::CxxStandard, EnvironmentInfo::UserToolchain::StandardLibrary, EnvironmentInfo::UserToolchain::StandardLibrary::ID, EnvironmentInfo::UserToolchain::StandardLibrary::Version, EnvironmentInfo::Wrapper > Descendants
Definition EnvironmentInfo.h:2732
EnvironmentInfo & set(const UserToolchain::StandardLibrary::Version &value)
Set UserToolchain::StandardLibrary::Version.
Definition EnvironmentInfo.h:3038
const EnvironmentInfo::Platform::OS::ID & get() const
Definition EnvironmentInfo.h:3108
EnvironmentInfo()
Default constructor.
void load(const std::string &fileName)
Load from the given file.
EnvironmentInfo & set(const Platform::CPU::Architecture &value)
Set Platform::CPU::Architecture.
Definition EnvironmentInfo.h:2942
const EnvironmentInfo::Platform::CPU::Architecture & get() const
Definition EnvironmentInfo.h:3083
const Platform & platform() const
Get Platform.
Definition EnvironmentInfo.h:2916
EnvironmentInfo & set(const UserToolchain::Compiler::ID &value)
Set UserToolchain::Compiler::ID.
Definition EnvironmentInfo.h:3003
EnvironmentInfo & set(const Platform::OS::Version &value)
Set Platform::OS::Version.
Definition EnvironmentInfo.h:2970
const EnvironmentInfo::UserToolchain & get() const
Definition EnvironmentInfo.h:3124
EnvironmentInfo & set(const Platform &value)
Set Platform.
Definition EnvironmentInfo.h:2928
const EnvironmentInfo::UserToolchain::CxxStandard & get() const
Definition EnvironmentInfo.h:3160
EnvironmentInfo & set(const UserToolchain::Compiler &value)
Set UserToolchain::Compiler.
Definition EnvironmentInfo.h:2996
const EnvironmentInfo::UserToolchain::StandardLibrary::Version & get() const
Definition EnvironmentInfo.h:3189
void set(Args &&...args)
Set multiple arguments.
Definition EnvironmentInfo.h:2849
const EnvironmentInfo::UserToolchain::Compiler::Version & get() const
Definition EnvironmentInfo.h:3151
const EnvironmentInfo::UserToolchain::Compiler::ID & get() const
Definition EnvironmentInfo.h:3142
const EnvironmentInfo::UserToolchain::Compiler & get() const
Definition EnvironmentInfo.h:3133
EnvironmentInfo & set(const UserToolchain::CxxStandard &value)
Set UserToolchain::CxxStandard.
Definition EnvironmentInfo.h:3017
static ZIVID_NODISCARD EnvironmentInfo fromSerialized(const std::string &value)
Construct a new EnvironmentInfo instance from a previously serialized string.
EnvironmentInfo & set(const UserToolchain::StandardLibrary &value)
Set UserToolchain::StandardLibrary.
Definition EnvironmentInfo.h:3024
const EnvironmentInfo::UserToolchain::StandardLibrary::ID & get() const
Definition EnvironmentInfo.h:3179
std::string toString() const
Get the value as string.
EnvironmentInfo & set(const Platform::CPU::ModelName &value)
Set Platform::CPU::ModelName.
Definition EnvironmentInfo.h:2949
const EnvironmentInfo::Platform & get() const
Definition EnvironmentInfo.h:3066
const EnvironmentInfo::UserToolchain::StandardLibrary & get() const
Definition EnvironmentInfo.h:3169
friend std::ostream & operator<<(std::ostream &stream, const EnvironmentInfo &value)
Operator to send the value as string to a stream.
Definition EnvironmentInfo.h:3248
UserToolchain & userToolchain()
Get UserToolchain.
Definition EnvironmentInfo.h:2983
EnvironmentInfo & set(const UserToolchain::Compiler::Version &value)
Set UserToolchain::Compiler::Version.
Definition EnvironmentInfo.h:3010
bool operator!=(const EnvironmentInfo &other) const
Inequality operator.
const Wrapper & wrapper() const
Get Wrapper.
Definition EnvironmentInfo.h:3045
const EnvironmentInfo::Platform::CPU::ModelName & get() const
Definition EnvironmentInfo.h:3092
const UserToolchain & userToolchain() const
Get UserToolchain.
Definition EnvironmentInfo.h:2977
Platform & platform()
Get Platform.
Definition EnvironmentInfo.h:2922
EnvironmentInfo(const std::string &fileName)
Construct EnvironmentInfo by loading from file.
EnvironmentInfo & set(const Platform::OS::ID &value)
Set Platform::OS::ID.
Definition EnvironmentInfo.h:2963
EnvironmentInfo & set(const Wrapper &value)
Set Wrapper.
Definition EnvironmentInfo.h:3057
Class describing a range of values for a given type T.
Definition Range.h:73
NodeType
Definition NodeType.h:55
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:56