Zivid C++ API 2.9.0+4dbba385-1
Defining the Future of 3D Machine Vision
FrameInfo.h
Go to the documentation of this file.
1
2
3/*******************************************************************************
4
5 * This file is part of the Zivid 3D Camera API
6
7 *
8
9 * Copyright 2015-2023 (C) Zivid AS
10
11 * All rights reserved.
12
13 *
14
15 * Zivid Software License, v1.0
16
17 *
18
19 * Redistribution and use in source and binary forms, with or without
20
21 * modification, are permitted provided that the following conditions are met:
22
23 *
24
25 * 1. Redistributions of source code must retain the above copyright notice,
26
27 * this list of conditions and the following disclaimer.
28
29 *
30
31 * 2. Redistributions in binary form must reproduce the above copyright notice,
32
33 * this list of conditions and the following disclaimer in the documentation
34
35 * and/or other materials provided with the distribution.
36
37 *
38
39 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
40
41 * to endorse or promote products derived from this software without specific
42
43 * prior written permission.
44
45 *
46
47 * 4. This software, with or without modification, must not be used with any
48
49 * other 3D camera than from Zivid AS.
50
51 *
52
53 * 5. Any software provided in binary form under this license must not be
54
55 * reverse engineered, decompiled, modified and/or disassembled.
56
57 *
58
59 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
60
61 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
62
63 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
64
65 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
66
67 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68
69 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
70
71 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
72
73 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74
75 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76
77 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78
79 *
80
81 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
82
83 * Info: http://www.zivid.com
84
85 ******************************************************************************/
86
87
88
89#pragma once
90
91#include <array>
92#include <chrono>
93#include <cmath>
94#include <ctime>
95#include <iomanip>
96#include <memory>
97#include <set>
98#include <sstream>
99#include <string>
100#include <tuple>
101#include <utility>
102#include <vector>
103
109#include "Zivid/Range.h"
110
111#ifdef _MSC_VER
112# pragma warning(push)
113# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
114#endif
115
116namespace Zivid
117{
118
120
121 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
123 {
124 public:
127
129 static constexpr const char *path{ "" };
130
132 static constexpr const char *name{ "FrameInfo" };
133
135 static constexpr const char *description{ R"description(Various information for a frame)description" };
136
137 static constexpr size_t version{ 3 };
138
139#ifndef NO_DOC
140 template<size_t>
141 struct Version;
142
143 using LatestVersion = Zivid::FrameInfo;
144
145 // Short identifier. This value is not guaranteed to be universally unique
146 // Todo(ZIVID-2808): Move this to internal DataModelExt header
147 static constexpr std::array<uint8_t, 3> binaryId{ 'f', 'i', 'f' };
148
149#endif
150
152
153 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
155 {
156 public:
159
161 static constexpr const char *path{ "SoftwareVersion" };
162
164 static constexpr const char *name{ "SoftwareVersion" };
165
167 static constexpr const char *description{
168 R"description(The version information for installed software at the time of image capture)description"
169 };
170
172
173 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
175 {
176 public:
179
181 static constexpr const char *path{ "SoftwareVersion/Core" };
182
184 static constexpr const char *name{ "Core" };
185
187 static constexpr const char *description{ R"description(Core version)description" };
188
190 using ValueType = std::string;
191
194 {
195 return { 0, std::numeric_limits<ValueType::size_type>::max() };
196 }
197
199 Core() = default;
200
202 explicit Core(std::string value)
203 : m_value{ std::move(value) }
204 {}
205
207 const std::string &value() const;
208
210 std::string toString() const;
211
213 bool operator==(const Core &other) const
214 {
215 return m_value == other.m_value;
216 }
217
219 bool operator!=(const Core &other) const
220 {
221 return m_value != other.m_value;
222 }
223
225 bool operator<(const Core &other) const
226 {
227 return m_value < other.m_value;
228 }
229
231 bool operator>(const Core &other) const
232 {
233 return m_value > other.m_value;
234 }
235
237 bool operator<=(const Core &other) const
238 {
239 return m_value <= other.m_value;
240 }
241
243 bool operator>=(const Core &other) const
244 {
245 return m_value >= other.m_value;
246 }
247
249 friend std::ostream &operator<<(std::ostream &stream, const Core &value)
250 {
251 return stream << value.toString();
252 }
253
254 private:
255 void setFromString(const std::string &value);
256
257 std::string m_value{ "No-version" };
258
259 friend struct DataModel::Detail::Befriend<Core>;
260 };
261
262 using Descendants = std::tuple<FrameInfo::SoftwareVersion::Core>;
263
266
278#ifndef NO_DOC
279 template<
280 typename... Args,
281 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
282 typename std::enable_if<
283 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
284 value,
285 int>::type = 0>
286#else
287 template<typename... Args>
288#endif
289 explicit SoftwareVersion(Args &&...args)
290 {
291 using namespace Zivid::Detail::TypeTraits;
292
293 static_assert(
294 AllArgsDecayedAreUnique<Args...>::value,
295 "Found duplicate types among the arguments passed to SoftwareVersion(...). "
296 "Types should be listed at most once.");
297
298 set(std::forward<Args>(args)...);
299 }
300
311#ifndef NO_DOC
312 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
313#else
314 template<typename... Args>
315#endif
316 void set(Args &&...args)
317 {
318 using namespace Zivid::Detail::TypeTraits;
319
320 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
321 static_assert(
322 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
323
324 static_assert(
325 AllArgsDecayedAreUnique<Args...>::value,
326 "Found duplicate types among the arguments passed to set(...). "
327 "Types should be listed at most once.");
328
329 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
330 }
331
343#ifndef NO_DOC
344 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
345#else
346 template<typename... Args>
347#endif
348 SoftwareVersion copyWith(Args &&...args) const
349 {
350 using namespace Zivid::Detail::TypeTraits;
351
352 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
353 static_assert(
354 AllArgsAreDescendantNodes::value,
355 "All arguments passed to copyWith(...) must be descendant nodes.");
356
357 static_assert(
358 AllArgsDecayedAreUnique<Args...>::value,
359 "Found duplicate types among the arguments passed to copyWith(...). "
360 "Types should be listed at most once.");
361
362 auto copy{ *this };
363 copy.set(std::forward<Args>(args)...);
364 return copy;
365 }
366
368 const Core &core() const
369 {
370 return m_core;
371 }
372
375 {
376 return m_core;
377 }
378
380 SoftwareVersion &set(const Core &value)
381 {
382 m_core = value;
383 return *this;
384 }
385
386 template<
387 typename T,
388 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
390 {
391 return m_core;
392 }
393
394 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
396 {
397 return m_core;
398 }
399
401 template<typename F>
402 void forEach(const F &f) const
403 {
404 f(m_core);
405 }
406
408 template<typename F>
409 void forEach(const F &f)
410 {
411 f(m_core);
412 }
413
415 bool operator==(const SoftwareVersion &other) const;
416
418 bool operator!=(const SoftwareVersion &other) const;
419
421 std::string toString() const;
422
424 friend std::ostream &operator<<(std::ostream &stream, const SoftwareVersion &value)
425 {
426 return stream << value.toString();
427 }
428
429 private:
430 void setFromString(const std::string &value);
431
432 void setFromString(const std::string &fullPath, const std::string &value);
433
434 std::string getString(const std::string &fullPath) const;
435
436 Core m_core;
437
438 friend struct DataModel::Detail::Befriend<SoftwareVersion>;
439 };
440
442
443 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
445 {
446 public:
449
451 static constexpr const char *path{ "SystemInfo" };
452
454 static constexpr const char *name{ "SystemInfo" };
455
457 static constexpr const char *description{
458 R"description(Information about the system that captured this frame)description"
459 };
460
462
463 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
465 {
466 public:
469
471 static constexpr const char *path{ "SystemInfo/CPU" };
472
474 static constexpr const char *name{ "CPU" };
475
477 static constexpr const char *description{ R"description(CPU)description" };
478
480
481 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
483 {
484 public:
487
489 static constexpr const char *path{ "SystemInfo/CPU/Model" };
490
492 static constexpr const char *name{ "Model" };
493
495 static constexpr const char *description{ R"description(CPU model)description" };
496
498 using ValueType = std::string;
499
502 {
503 return { 0, std::numeric_limits<ValueType::size_type>::max() };
504 }
505
507 Model() = default;
508
510 explicit Model(std::string value)
511 : m_value{ std::move(value) }
512 {}
513
515 const std::string &value() const;
516
518 std::string toString() const;
519
521 bool operator==(const Model &other) const
522 {
523 return m_value == other.m_value;
524 }
525
527 bool operator!=(const Model &other) const
528 {
529 return m_value != other.m_value;
530 }
531
533 bool operator<(const Model &other) const
534 {
535 return m_value < other.m_value;
536 }
537
539 bool operator>(const Model &other) const
540 {
541 return m_value > other.m_value;
542 }
543
545 bool operator<=(const Model &other) const
546 {
547 return m_value <= other.m_value;
548 }
549
551 bool operator>=(const Model &other) const
552 {
553 return m_value >= other.m_value;
554 }
555
557 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
558 {
559 return stream << value.toString();
560 }
561
562 private:
563 void setFromString(const std::string &value);
564
565 std::string m_value{};
566
567 friend struct DataModel::Detail::Befriend<Model>;
568 };
569
570 using Descendants = std::tuple<FrameInfo::SystemInfo::CPU::Model>;
571
574
586#ifndef NO_DOC
587 template<
588 typename... Args,
589 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
590 typename std::enable_if<
591 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
592 value,
593 int>::type = 0>
594#else
595 template<typename... Args>
596#endif
597 explicit CPU(Args &&...args)
598 {
599 using namespace Zivid::Detail::TypeTraits;
600
601 static_assert(
602 AllArgsDecayedAreUnique<Args...>::value,
603 "Found duplicate types among the arguments passed to CPU(...). "
604 "Types should be listed at most once.");
605
606 set(std::forward<Args>(args)...);
607 }
608
619#ifndef NO_DOC
620 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
621#else
622 template<typename... Args>
623#endif
624 void set(Args &&...args)
625 {
626 using namespace Zivid::Detail::TypeTraits;
627
628 using AllArgsAreDescendantNodes =
629 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
630 static_assert(
631 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
632
633 static_assert(
634 AllArgsDecayedAreUnique<Args...>::value,
635 "Found duplicate types among the arguments passed to set(...). "
636 "Types should be listed at most once.");
637
638 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
639 }
640
652#ifndef NO_DOC
653 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
654#else
655 template<typename... Args>
656#endif
657 CPU copyWith(Args &&...args) const
658 {
659 using namespace Zivid::Detail::TypeTraits;
660
661 using AllArgsAreDescendantNodes =
662 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
663 static_assert(
664 AllArgsAreDescendantNodes::value,
665 "All arguments passed to copyWith(...) must be descendant nodes.");
666
667 static_assert(
668 AllArgsDecayedAreUnique<Args...>::value,
669 "Found duplicate types among the arguments passed to copyWith(...). "
670 "Types should be listed at most once.");
671
672 auto copy{ *this };
673 copy.set(std::forward<Args>(args)...);
674 return copy;
675 }
676
678 const Model &model() const
679 {
680 return m_model;
681 }
682
685 {
686 return m_model;
687 }
688
690 CPU &set(const Model &value)
691 {
692 m_model = value;
693 return *this;
694 }
695
696 template<
697 typename T,
698 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
700 {
701 return m_model;
702 }
703
704 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
706 {
707 return m_model;
708 }
709
711 template<typename F>
712 void forEach(const F &f) const
713 {
714 f(m_model);
715 }
716
718 template<typename F>
719 void forEach(const F &f)
720 {
721 f(m_model);
722 }
723
725 bool operator==(const CPU &other) const;
726
728 bool operator!=(const CPU &other) const;
729
731 std::string toString() const;
732
734 friend std::ostream &operator<<(std::ostream &stream, const CPU &value)
735 {
736 return stream << value.toString();
737 }
738
739 private:
740 void setFromString(const std::string &value);
741
742 void setFromString(const std::string &fullPath, const std::string &value);
743
744 std::string getString(const std::string &fullPath) const;
745
746 Model m_model;
747
748 friend struct DataModel::Detail::Befriend<CPU>;
749 };
750
752
753 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
755 {
756 public:
759
761 static constexpr const char *path{ "SystemInfo/ComputeDevice" };
762
764 static constexpr const char *name{ "ComputeDevice" };
765
767 static constexpr const char *description{ R"description(Compute device)description" };
768
770
771 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
773 {
774 public:
777
779 static constexpr const char *path{ "SystemInfo/ComputeDevice/Model" };
780
782 static constexpr const char *name{ "Model" };
783
785 static constexpr const char *description{ R"description(Compute device model)description" };
786
788 using ValueType = std::string;
789
792 {
793 return { 0, std::numeric_limits<ValueType::size_type>::max() };
794 }
795
797 Model() = default;
798
800 explicit Model(std::string value)
801 : m_value{ std::move(value) }
802 {}
803
805 const std::string &value() const;
806
808 std::string toString() const;
809
811 bool operator==(const Model &other) const
812 {
813 return m_value == other.m_value;
814 }
815
817 bool operator!=(const Model &other) const
818 {
819 return m_value != other.m_value;
820 }
821
823 bool operator<(const Model &other) const
824 {
825 return m_value < other.m_value;
826 }
827
829 bool operator>(const Model &other) const
830 {
831 return m_value > other.m_value;
832 }
833
835 bool operator<=(const Model &other) const
836 {
837 return m_value <= other.m_value;
838 }
839
841 bool operator>=(const Model &other) const
842 {
843 return m_value >= other.m_value;
844 }
845
847 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
848 {
849 return stream << value.toString();
850 }
851
852 private:
853 void setFromString(const std::string &value);
854
855 std::string m_value{};
856
857 friend struct DataModel::Detail::Befriend<Model>;
858 };
859
861
862 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
864 {
865 public:
868
870 static constexpr const char *path{ "SystemInfo/ComputeDevice/Vendor" };
871
873 static constexpr const char *name{ "Vendor" };
874
876 static constexpr const char *description{ R"description(Compute device vendor)description" };
877
879 using ValueType = std::string;
880
883 {
884 return { 0, std::numeric_limits<ValueType::size_type>::max() };
885 }
886
888 Vendor() = default;
889
891 explicit Vendor(std::string value)
892 : m_value{ std::move(value) }
893 {}
894
896 const std::string &value() const;
897
899 std::string toString() const;
900
902 bool operator==(const Vendor &other) const
903 {
904 return m_value == other.m_value;
905 }
906
908 bool operator!=(const Vendor &other) const
909 {
910 return m_value != other.m_value;
911 }
912
914 bool operator<(const Vendor &other) const
915 {
916 return m_value < other.m_value;
917 }
918
920 bool operator>(const Vendor &other) const
921 {
922 return m_value > other.m_value;
923 }
924
926 bool operator<=(const Vendor &other) const
927 {
928 return m_value <= other.m_value;
929 }
930
932 bool operator>=(const Vendor &other) const
933 {
934 return m_value >= other.m_value;
935 }
936
938 friend std::ostream &operator<<(std::ostream &stream, const Vendor &value)
939 {
940 return stream << value.toString();
941 }
942
943 private:
944 void setFromString(const std::string &value);
945
946 std::string m_value{};
947
948 friend struct DataModel::Detail::Befriend<Vendor>;
949 };
950
951 using Descendants = std::
952 tuple<FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor>;
953
956
969#ifndef NO_DOC
970 template<
971 typename... Args,
972 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
973 typename std::enable_if<
974 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
975 value,
976 int>::type = 0>
977#else
978 template<typename... Args>
979#endif
980 explicit ComputeDevice(Args &&...args)
981 {
982 using namespace Zivid::Detail::TypeTraits;
983
984 static_assert(
985 AllArgsDecayedAreUnique<Args...>::value,
986 "Found duplicate types among the arguments passed to ComputeDevice(...). "
987 "Types should be listed at most once.");
988
989 set(std::forward<Args>(args)...);
990 }
991
1003#ifndef NO_DOC
1004 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1005#else
1006 template<typename... Args>
1007#endif
1008 void set(Args &&...args)
1009 {
1010 using namespace Zivid::Detail::TypeTraits;
1011
1012 using AllArgsAreDescendantNodes =
1013 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1014 static_assert(
1015 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1016
1017 static_assert(
1018 AllArgsDecayedAreUnique<Args...>::value,
1019 "Found duplicate types among the arguments passed to set(...). "
1020 "Types should be listed at most once.");
1021
1022 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1023 }
1024
1037#ifndef NO_DOC
1038 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1039#else
1040 template<typename... Args>
1041#endif
1042 ComputeDevice copyWith(Args &&...args) const
1043 {
1044 using namespace Zivid::Detail::TypeTraits;
1045
1046 using AllArgsAreDescendantNodes =
1047 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1048 static_assert(
1049 AllArgsAreDescendantNodes::value,
1050 "All arguments passed to copyWith(...) must be descendant nodes.");
1051
1052 static_assert(
1053 AllArgsDecayedAreUnique<Args...>::value,
1054 "Found duplicate types among the arguments passed to copyWith(...). "
1055 "Types should be listed at most once.");
1056
1057 auto copy{ *this };
1058 copy.set(std::forward<Args>(args)...);
1059 return copy;
1060 }
1061
1063 const Model &model() const
1064 {
1065 return m_model;
1066 }
1067
1070 {
1071 return m_model;
1072 }
1073
1075 ComputeDevice &set(const Model &value)
1076 {
1077 m_model = value;
1078 return *this;
1079 }
1080
1082 const Vendor &vendor() const
1083 {
1084 return m_vendor;
1085 }
1086
1089 {
1090 return m_vendor;
1091 }
1092
1094 ComputeDevice &set(const Vendor &value)
1095 {
1096 m_vendor = value;
1097 return *this;
1098 }
1099
1100 template<
1101 typename T,
1102 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1103 type = 0>
1105 {
1106 return m_model;
1107 }
1108
1109 template<
1110 typename T,
1111 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1112 type = 0>
1114 {
1115 return m_vendor;
1116 }
1117
1118 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1120 {
1121 return m_model;
1122 }
1123
1124 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1126 {
1127 return m_vendor;
1128 }
1129
1131 template<typename F>
1132 void forEach(const F &f) const
1133 {
1134 f(m_model);
1135 f(m_vendor);
1136 }
1137
1139 template<typename F>
1140 void forEach(const F &f)
1141 {
1142 f(m_model);
1143 f(m_vendor);
1144 }
1145
1147 bool operator==(const ComputeDevice &other) const;
1148
1150 bool operator!=(const ComputeDevice &other) const;
1151
1153 std::string toString() const;
1154
1156 friend std::ostream &operator<<(std::ostream &stream, const ComputeDevice &value)
1157 {
1158 return stream << value.toString();
1159 }
1160
1161 private:
1162 void setFromString(const std::string &value);
1163
1164 void setFromString(const std::string &fullPath, const std::string &value);
1165
1166 std::string getString(const std::string &fullPath) const;
1167
1168 Model m_model;
1169 Vendor m_vendor;
1170
1171 friend struct DataModel::Detail::Befriend<ComputeDevice>;
1172 };
1173
1175
1176 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1178 {
1179 public:
1182
1184 static constexpr const char *path{ "SystemInfo/OperatingSystem" };
1185
1187 static constexpr const char *name{ "OperatingSystem" };
1188
1190 static constexpr const char *description{ R"description(Operating system)description" };
1191
1193 using ValueType = std::string;
1194
1197 {
1198 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1199 }
1200
1202 OperatingSystem() = default;
1203
1205 explicit OperatingSystem(std::string value)
1206 : m_value{ std::move(value) }
1207 {}
1208
1210 const std::string &value() const;
1211
1213 std::string toString() const;
1214
1216 bool operator==(const OperatingSystem &other) const
1217 {
1218 return m_value == other.m_value;
1219 }
1220
1222 bool operator!=(const OperatingSystem &other) const
1223 {
1224 return m_value != other.m_value;
1225 }
1226
1228 bool operator<(const OperatingSystem &other) const
1229 {
1230 return m_value < other.m_value;
1231 }
1232
1234 bool operator>(const OperatingSystem &other) const
1235 {
1236 return m_value > other.m_value;
1237 }
1238
1240 bool operator<=(const OperatingSystem &other) const
1241 {
1242 return m_value <= other.m_value;
1243 }
1244
1246 bool operator>=(const OperatingSystem &other) const
1247 {
1248 return m_value >= other.m_value;
1249 }
1250
1252 friend std::ostream &operator<<(std::ostream &stream, const OperatingSystem &value)
1253 {
1254 return stream << value.toString();
1255 }
1256
1257 private:
1258 void setFromString(const std::string &value);
1259
1260 std::string m_value{};
1261
1262 friend struct DataModel::Detail::Befriend<OperatingSystem>;
1263 };
1264
1265 using Descendants = std::tuple<
1272
1275
1292#ifndef NO_DOC
1293 template<
1294 typename... Args,
1295 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1296 typename std::enable_if<
1297 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1298 value,
1299 int>::type = 0>
1300#else
1301 template<typename... Args>
1302#endif
1303 explicit SystemInfo(Args &&...args)
1304 {
1305 using namespace Zivid::Detail::TypeTraits;
1306
1307 static_assert(
1308 AllArgsDecayedAreUnique<Args...>::value,
1309 "Found duplicate types among the arguments passed to SystemInfo(...). "
1310 "Types should be listed at most once.");
1311
1312 set(std::forward<Args>(args)...);
1313 }
1314
1330#ifndef NO_DOC
1331 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1332#else
1333 template<typename... Args>
1334#endif
1335 void set(Args &&...args)
1336 {
1337 using namespace Zivid::Detail::TypeTraits;
1338
1339 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1340 static_assert(
1341 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1342
1343 static_assert(
1344 AllArgsDecayedAreUnique<Args...>::value,
1345 "Found duplicate types among the arguments passed to set(...). "
1346 "Types should be listed at most once.");
1347
1348 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1349 }
1350
1367#ifndef NO_DOC
1368 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1369#else
1370 template<typename... Args>
1371#endif
1372 SystemInfo copyWith(Args &&...args) const
1373 {
1374 using namespace Zivid::Detail::TypeTraits;
1375
1376 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1377 static_assert(
1378 AllArgsAreDescendantNodes::value,
1379 "All arguments passed to copyWith(...) must be descendant nodes.");
1380
1381 static_assert(
1382 AllArgsDecayedAreUnique<Args...>::value,
1383 "Found duplicate types among the arguments passed to copyWith(...). "
1384 "Types should be listed at most once.");
1385
1386 auto copy{ *this };
1387 copy.set(std::forward<Args>(args)...);
1388 return copy;
1389 }
1390
1392 const CPU &cpu() const
1393 {
1394 return m_cpu;
1395 }
1396
1399 {
1400 return m_cpu;
1401 }
1402
1404 SystemInfo &set(const CPU &value)
1405 {
1406 m_cpu = value;
1407 return *this;
1408 }
1409
1412 {
1413 m_cpu.set(value);
1414 return *this;
1415 }
1416
1419 {
1420 return m_computeDevice;
1421 }
1422
1425 {
1426 return m_computeDevice;
1427 }
1428
1431 {
1432 m_computeDevice = value;
1433 return *this;
1434 }
1435
1438 {
1439 m_computeDevice.set(value);
1440 return *this;
1441 }
1442
1445 {
1446 m_computeDevice.set(value);
1447 return *this;
1448 }
1449
1452 {
1453 return m_operatingSystem;
1454 }
1455
1458 {
1459 return m_operatingSystem;
1460 }
1461
1464 {
1465 m_operatingSystem = value;
1466 return *this;
1467 }
1468
1469 template<
1470 typename T,
1471 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1473 {
1474 return m_cpu;
1475 }
1476
1477 template<
1478 typename T,
1479 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1481 {
1482 return m_cpu.get<FrameInfo::SystemInfo::CPU::Model>();
1483 }
1484
1485 template<
1486 typename T,
1487 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1489 {
1490 return m_computeDevice;
1491 }
1492
1493 template<
1494 typename T,
1495 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1496 type = 0>
1498 {
1499 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1500 }
1501
1502 template<
1503 typename T,
1504 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1505 type = 0>
1507 {
1508 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1509 }
1510
1511 template<
1512 typename T,
1513 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1515 {
1516 return m_operatingSystem;
1517 }
1518
1519 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1521 {
1522 return m_cpu;
1523 }
1524
1525 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1527 {
1528 return m_computeDevice;
1529 }
1530
1531 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1533 {
1534 return m_operatingSystem;
1535 }
1536
1538 template<typename F>
1539 void forEach(const F &f) const
1540 {
1541 f(m_cpu);
1542 f(m_computeDevice);
1543 f(m_operatingSystem);
1544 }
1545
1547 template<typename F>
1548 void forEach(const F &f)
1549 {
1550 f(m_cpu);
1551 f(m_computeDevice);
1552 f(m_operatingSystem);
1553 }
1554
1556 bool operator==(const SystemInfo &other) const;
1557
1559 bool operator!=(const SystemInfo &other) const;
1560
1562 std::string toString() const;
1563
1565 friend std::ostream &operator<<(std::ostream &stream, const SystemInfo &value)
1566 {
1567 return stream << value.toString();
1568 }
1569
1570 private:
1571 void setFromString(const std::string &value);
1572
1573 void setFromString(const std::string &fullPath, const std::string &value);
1574
1575 std::string getString(const std::string &fullPath) const;
1576
1577 CPU m_cpu;
1578 ComputeDevice m_computeDevice;
1579 OperatingSystem m_operatingSystem;
1580
1581 friend struct DataModel::Detail::Befriend<SystemInfo>;
1582 };
1583
1585
1586 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1588 {
1589 public:
1592
1594 static constexpr const char *path{ "TimeStamp" };
1595
1597 static constexpr const char *name{ "TimeStamp" };
1598
1600 static constexpr const char *description{ R"description(The time of frame capture)description" };
1601
1603 using ValueType = std::chrono::system_clock::time_point;
1604
1607 {
1608 return { std::chrono::system_clock::time_point::min(), std::chrono::system_clock::time_point::max() };
1609 }
1610
1612 TimeStamp() = default;
1613
1615 explicit constexpr TimeStamp(std::chrono::system_clock::time_point value)
1616 : m_value{ value }
1617 {}
1618
1620 std::chrono::system_clock::time_point value() const;
1621
1623 std::string toString() const;
1624
1626 bool operator==(const TimeStamp &other) const
1627 {
1628 return m_value == other.m_value;
1629 }
1630
1632 bool operator!=(const TimeStamp &other) const
1633 {
1634 return m_value != other.m_value;
1635 }
1636
1638 bool operator<(const TimeStamp &other) const
1639 {
1640 return m_value < other.m_value;
1641 }
1642
1644 bool operator>(const TimeStamp &other) const
1645 {
1646 return m_value > other.m_value;
1647 }
1648
1650 bool operator<=(const TimeStamp &other) const
1651 {
1652 return m_value <= other.m_value;
1653 }
1654
1656 bool operator>=(const TimeStamp &other) const
1657 {
1658 return m_value >= other.m_value;
1659 }
1660
1662 friend std::ostream &operator<<(std::ostream &stream, const TimeStamp &value)
1663 {
1664 return stream << value.toString();
1665 }
1666
1667 private:
1668 void setFromString(const std::string &value);
1669
1670 std::chrono::system_clock::time_point m_value{};
1671
1672 friend struct DataModel::Detail::Befriend<TimeStamp>;
1673 };
1674
1675 using Descendants = std::tuple<
1686
1689
1691 explicit FrameInfo(const std::string &fileName);
1692
1713#ifndef NO_DOC
1714 template<
1715 typename... Args,
1716 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1717 typename std::enable_if<
1718 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1719 int>::type = 0>
1720#else
1721 template<typename... Args>
1722#endif
1723 explicit FrameInfo(Args &&...args)
1724 {
1725 using namespace Zivid::Detail::TypeTraits;
1726
1727 static_assert(
1728 AllArgsDecayedAreUnique<Args...>::value,
1729 "Found duplicate types among the arguments passed to FrameInfo(...). "
1730 "Types should be listed at most once.");
1731
1732 set(std::forward<Args>(args)...);
1733 }
1734
1754#ifndef NO_DOC
1755 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1756#else
1757 template<typename... Args>
1758#endif
1759 void set(Args &&...args)
1760 {
1761 using namespace Zivid::Detail::TypeTraits;
1762
1763 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1764 static_assert(
1765 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1766
1767 static_assert(
1768 AllArgsDecayedAreUnique<Args...>::value,
1769 "Found duplicate types among the arguments passed to set(...). "
1770 "Types should be listed at most once.");
1771
1772 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1773 }
1774
1795#ifndef NO_DOC
1796 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1797#else
1798 template<typename... Args>
1799#endif
1800 FrameInfo copyWith(Args &&...args) const
1801 {
1802 using namespace Zivid::Detail::TypeTraits;
1803
1804 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1805 static_assert(
1806 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1807
1808 static_assert(
1809 AllArgsDecayedAreUnique<Args...>::value,
1810 "Found duplicate types among the arguments passed to copyWith(...). "
1811 "Types should be listed at most once.");
1812
1813 auto copy{ *this };
1814 copy.set(std::forward<Args>(args)...);
1815 return copy;
1816 }
1817
1820 {
1821 return m_softwareVersion;
1822 }
1823
1826 {
1827 return m_softwareVersion;
1828 }
1829
1832 {
1833 m_softwareVersion = value;
1834 return *this;
1835 }
1836
1839 {
1840 m_softwareVersion.set(value);
1841 return *this;
1842 }
1843
1845 const SystemInfo &systemInfo() const
1846 {
1847 return m_systemInfo;
1848 }
1849
1852 {
1853 return m_systemInfo;
1854 }
1855
1857 FrameInfo &set(const SystemInfo &value)
1858 {
1859 m_systemInfo = value;
1860 return *this;
1861 }
1862
1865 {
1866 m_systemInfo.set(value);
1867 return *this;
1868 }
1869
1872 {
1873 m_systemInfo.set(value);
1874 return *this;
1875 }
1876
1879 {
1880 m_systemInfo.set(value);
1881 return *this;
1882 }
1883
1886 {
1887 m_systemInfo.set(value);
1888 return *this;
1889 }
1890
1893 {
1894 m_systemInfo.set(value);
1895 return *this;
1896 }
1897
1900 {
1901 m_systemInfo.set(value);
1902 return *this;
1903 }
1904
1906 const TimeStamp &timeStamp() const
1907 {
1908 return m_timeStamp;
1909 }
1910
1913 {
1914 return m_timeStamp;
1915 }
1916
1918 FrameInfo &set(const TimeStamp &value)
1919 {
1920 m_timeStamp = value;
1921 return *this;
1922 }
1923
1924 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion>::value, int>::type = 0>
1926 {
1927 return m_softwareVersion;
1928 }
1929
1930 template<
1931 typename T,
1932 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
1934 {
1935 return m_softwareVersion.get<FrameInfo::SoftwareVersion::Core>();
1936 }
1937
1938 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo>::value, int>::type = 0>
1940 {
1941 return m_systemInfo;
1942 }
1943
1944 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1946 {
1947 return m_systemInfo.get<FrameInfo::SystemInfo::CPU>();
1948 }
1949
1950 template<
1951 typename T,
1952 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1954 {
1955 return m_systemInfo.get<FrameInfo::SystemInfo::CPU::Model>();
1956 }
1957
1958 template<
1959 typename T,
1960 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1962 {
1963 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice>();
1964 }
1965
1966 template<
1967 typename T,
1968 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::type = 0>
1970 {
1971 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1972 }
1973
1974 template<
1975 typename T,
1976 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::type =
1977 0>
1979 {
1980 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1981 }
1982
1983 template<
1984 typename T,
1985 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1987 {
1988 return m_systemInfo.get<FrameInfo::SystemInfo::OperatingSystem>();
1989 }
1990
1991 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::TimeStamp>::value, int>::type = 0>
1993 {
1994 return m_timeStamp;
1995 }
1996
1997 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1999 {
2000 return m_softwareVersion;
2001 }
2002
2003 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2005 {
2006 return m_systemInfo;
2007 }
2008
2009 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2011 {
2012 return m_timeStamp;
2013 }
2014
2016 template<typename F>
2017 void forEach(const F &f) const
2018 {
2019 f(m_softwareVersion);
2020 f(m_systemInfo);
2021 f(m_timeStamp);
2022 }
2023
2025 template<typename F>
2026 void forEach(const F &f)
2027 {
2028 f(m_softwareVersion);
2029 f(m_systemInfo);
2030 f(m_timeStamp);
2031 }
2032
2034 bool operator==(const FrameInfo &other) const;
2035
2037 bool operator!=(const FrameInfo &other) const;
2038
2040 std::string toString() const;
2041
2043 friend std::ostream &operator<<(std::ostream &stream, const FrameInfo &value)
2044 {
2045 return stream << value.toString();
2046 }
2047
2049 void save(const std::string &fileName) const;
2050
2052 void load(const std::string &fileName);
2053
2054 private:
2055 void setFromString(const std::string &value);
2056
2057 void setFromString(const std::string &fullPath, const std::string &value);
2058
2059 std::string getString(const std::string &fullPath) const;
2060
2061 SoftwareVersion m_softwareVersion;
2062 SystemInfo m_systemInfo;
2063 TimeStamp m_timeStamp;
2064
2065 friend struct DataModel::Detail::Befriend<FrameInfo>;
2066 };
2067
2068#ifndef NO_DOC
2070 namespace Detail
2071 {
2072 ZIVID_CORE_EXPORT void save(const FrameInfo &dataModel, std::ostream &ostream);
2073 ZIVID_CORE_EXPORT void load(FrameInfo &dataModel, std::istream &istream);
2074 } // namespace Detail
2075#endif
2076
2077#ifndef NO_DOC
2078 template<>
2079 struct FrameInfo::Version<3>
2080 {
2081 using Type = FrameInfo;
2082 };
2083#endif
2084
2085} // namespace Zivid
2086
2087#ifdef _MSC_VER
2088# pragma warning(pop)
2089#endif
2090
2091#ifndef NO_DOC
2092# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2093namespace std // NOLINT
2094{
2095
2096 template<>
2097 struct tuple_size<Zivid::FrameInfo::SoftwareVersion> : integral_constant<size_t, 1>
2098 {};
2099
2100 template<size_t i>
2101 struct tuple_element<i, Zivid::FrameInfo::SoftwareVersion>
2102 {
2103 static_assert(i < tuple_size<Zivid::FrameInfo::SoftwareVersion>::value, "Index must be less than 1");
2104
2105 using type // NOLINT
2106 = decltype(declval<Zivid::FrameInfo::SoftwareVersion>().get<i>());
2107 };
2108
2109 template<>
2110 struct tuple_size<Zivid::FrameInfo::SystemInfo> : integral_constant<size_t, 3>
2111 {};
2112
2113 template<size_t i>
2114 struct tuple_element<i, Zivid::FrameInfo::SystemInfo>
2115 {
2116 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo>::value, "Index must be less than 3");
2117
2118 using type // NOLINT
2119 = decltype(declval<Zivid::FrameInfo::SystemInfo>().get<i>());
2120 };
2121
2122 template<>
2123 struct tuple_size<Zivid::FrameInfo::SystemInfo::CPU> : integral_constant<size_t, 1>
2124 {};
2125
2126 template<size_t i>
2127 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::CPU>
2128 {
2129 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::CPU>::value, "Index must be less than 1");
2130
2131 using type // NOLINT
2132 = decltype(declval<Zivid::FrameInfo::SystemInfo::CPU>().get<i>());
2133 };
2134
2135 template<>
2136 struct tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice> : integral_constant<size_t, 2>
2137 {};
2138
2139 template<size_t i>
2140 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::ComputeDevice>
2141 {
2142 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice>::value, "Index must be less than 2");
2143
2144 using type // NOLINT
2145 = decltype(declval<Zivid::FrameInfo::SystemInfo::ComputeDevice>().get<i>());
2146 };
2147
2148 template<>
2149 struct tuple_size<Zivid::FrameInfo> : integral_constant<size_t, 3>
2150 {};
2151
2152 template<size_t i>
2153 struct tuple_element<i, Zivid::FrameInfo>
2154 {
2155 static_assert(i < tuple_size<Zivid::FrameInfo>::value, "Index must be less than 3");
2156
2157 using type // NOLINT
2158 = decltype(declval<Zivid::FrameInfo>().get<i>());
2159 };
2160
2161} // namespace std
2162# endif
2163#endif
2164
2165// If we have access to the DataModel library, automatically include internal DataModel
2166// header. This header is necessary for serialization and deserialization.
2167#if defined(__has_include) && !defined(NO_DOC)
2168# if __has_include("Zivid/FrameInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
2169# include "Zivid/FrameInfoInternal.h"
2170# endif
2171#endif
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Contains information about the compute device used by Zivid::Application.
Definition: ComputeDevice.h:103
Core version
Definition: FrameInfo.h:175
std::string toString() const
Get the value as string
bool operator>=(const Core &other) const
Comparison operator
Definition: FrameInfo.h:243
const std::string & value() const
Get the value
bool operator!=(const Core &other) const
Comparison operator
Definition: FrameInfo.h:219
Core(std::string value)
Constructor
Definition: FrameInfo.h:202
bool operator==(const Core &other) const
Comparison operator
Definition: FrameInfo.h:213
Core()=default
Default constructor
bool operator>(const Core &other) const
Comparison operator
Definition: FrameInfo.h:231
bool operator<(const Core &other) const
Comparison operator
Definition: FrameInfo.h:225
friend std::ostream & operator<<(std::ostream &stream, const Core &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:249
bool operator<=(const Core &other) const
Comparison operator
Definition: FrameInfo.h:237
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:190
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Core
Definition: FrameInfo.h:193
The version information for installed software at the time of image capture
Definition: FrameInfo.h:155
const Core & core() const
Get Core
Definition: FrameInfo.h:368
friend std::ostream & operator<<(std::ostream &stream, const SoftwareVersion &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:424
bool operator!=(const SoftwareVersion &other) const
Inequality operator
bool operator==(const SoftwareVersion &other) const
Equality operator
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:409
SoftwareVersion()
Default constructor
const FrameInfo::SoftwareVersion::Core & get() const
Definition: FrameInfo.h:389
SoftwareVersion copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: FrameInfo.h:348
Core & core()
Get Core
Definition: FrameInfo.h:374
SoftwareVersion(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:289
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:402
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:316
std::tuple< FrameInfo::SoftwareVersion::Core > Descendants
Definition: FrameInfo.h:262
SoftwareVersion & set(const Core &value)
Set Core
Definition: FrameInfo.h:380
std::string toString() const
Get the value as string
CPU model
Definition: FrameInfo.h:483
const std::string & value() const
Get the value
bool operator!=(const Model &other) const
Comparison operator
Definition: FrameInfo.h:527
Model()=default
Default constructor
bool operator<(const Model &other) const
Comparison operator
Definition: FrameInfo.h:533
std::string toString() const
Get the value as string
bool operator==(const Model &other) const
Comparison operator
Definition: FrameInfo.h:521
bool operator>=(const Model &other) const
Comparison operator
Definition: FrameInfo.h:551
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:557
bool operator<=(const Model &other) const
Comparison operator
Definition: FrameInfo.h:545
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model
Definition: FrameInfo.h:501
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:498
Model(std::string value)
Constructor
Definition: FrameInfo.h:510
bool operator>(const Model &other) const
Comparison operator
Definition: FrameInfo.h:539
CPU
Definition: FrameInfo.h:465
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:719
const Model & model() const
Get Model
Definition: FrameInfo.h:678
std::tuple< FrameInfo::SystemInfo::CPU::Model > Descendants
Definition: FrameInfo.h:570
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:712
bool operator!=(const CPU &other) const
Inequality operator
std::string toString() const
Get the value as string
bool operator==(const CPU &other) const
Equality operator
friend std::ostream & operator<<(std::ostream &stream, const CPU &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:734
CPU(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:597
CPU & set(const Model &value)
Set Model
Definition: FrameInfo.h:690
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:624
CPU copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: FrameInfo.h:657
Model & model()
Get Model
Definition: FrameInfo.h:684
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition: FrameInfo.h:699
Compute device model
Definition: FrameInfo.h:773
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model
Definition: FrameInfo.h:791
std::string toString() const
Get the value as string
bool operator<=(const Model &other) const
Comparison operator
Definition: FrameInfo.h:835
Model(std::string value)
Constructor
Definition: FrameInfo.h:800
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:788
const std::string & value() const
Get the value
bool operator==(const Model &other) const
Comparison operator
Definition: FrameInfo.h:811
bool operator!=(const Model &other) const
Comparison operator
Definition: FrameInfo.h:817
bool operator>=(const Model &other) const
Comparison operator
Definition: FrameInfo.h:841
bool operator>(const Model &other) const
Comparison operator
Definition: FrameInfo.h:829
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:847
bool operator<(const Model &other) const
Comparison operator
Definition: FrameInfo.h:823
Compute device vendor
Definition: FrameInfo.h:864
bool operator>(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:920
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Vendor
Definition: FrameInfo.h:882
friend std::ostream & operator<<(std::ostream &stream, const Vendor &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:938
bool operator>=(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:932
bool operator<(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:914
bool operator==(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:902
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:879
std::string toString() const
Get the value as string
bool operator<=(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:926
const std::string & value() const
Get the value
bool operator!=(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:908
Vendor(std::string value)
Constructor
Definition: FrameInfo.h:891
Compute device
Definition: FrameInfo.h:755
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:1008
ComputeDevice & set(const Model &value)
Set Model
Definition: FrameInfo.h:1075
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:1132
const Vendor & vendor() const
Get Vendor
Definition: FrameInfo.h:1082
ComputeDevice(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:980
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:1140
Model & model()
Get Model
Definition: FrameInfo.h:1069
Vendor & vendor()
Get Vendor
Definition: FrameInfo.h:1088
bool operator==(const ComputeDevice &other) const
Equality operator
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition: FrameInfo.h:1113
const Model & model() const
Get Model
Definition: FrameInfo.h:1063
friend std::ostream & operator<<(std::ostream &stream, const ComputeDevice &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:1156
std::tuple< FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor > Descendants
Definition: FrameInfo.h:952
bool operator!=(const ComputeDevice &other) const
Inequality operator
std::string toString() const
Get the value as string
ComputeDevice & set(const Vendor &value)
Set Vendor
Definition: FrameInfo.h:1094
ComputeDevice copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: FrameInfo.h:1042
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition: FrameInfo.h:1104
Operating system
Definition: FrameInfo.h:1178
bool operator>(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1234
OperatingSystem(std::string value)
Constructor
Definition: FrameInfo.h:1205
bool operator!=(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1222
bool operator<(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1228
bool operator>=(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1246
bool operator==(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1216
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:1193
OperatingSystem()=default
Default constructor
bool operator<=(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1240
const std::string & value() const
Get the value
friend std::ostream & operator<<(std::ostream &stream, const OperatingSystem &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:1252
std::string toString() const
Get the value as string
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for OperatingSystem
Definition: FrameInfo.h:1196
Information about the system that captured this frame
Definition: FrameInfo.h:445
SystemInfo & set(const CPU::Model &value)
Set CPU::Model
Definition: FrameInfo.h:1411
std::string toString() const
Get the value as string
const FrameInfo::SystemInfo::CPU & get() const
Definition: FrameInfo.h:1472
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:1539
ComputeDevice & computeDevice()
Get ComputeDevice
Definition: FrameInfo.h:1424
SystemInfo & set(const ComputeDevice &value)
Set ComputeDevice
Definition: FrameInfo.h:1430
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition: FrameInfo.h:1506
SystemInfo & set(const CPU &value)
Set CPU
Definition: FrameInfo.h:1404
bool operator==(const SystemInfo &other) const
Equality operator
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:1335
friend std::ostream & operator<<(std::ostream &stream, const SystemInfo &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:1565
const ComputeDevice & computeDevice() const
Get ComputeDevice
Definition: FrameInfo.h:1418
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:1548
SystemInfo & set(const ComputeDevice::Vendor &value)
Set ComputeDevice::Vendor
Definition: FrameInfo.h:1444
SystemInfo & set(const OperatingSystem &value)
Set OperatingSystem
Definition: FrameInfo.h:1463
SystemInfo copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: FrameInfo.h:1372
bool operator!=(const SystemInfo &other) const
Inequality operator
SystemInfo & set(const ComputeDevice::Model &value)
Set ComputeDevice::Model
Definition: FrameInfo.h:1437
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition: FrameInfo.h:1514
CPU & cpu()
Get CPU
Definition: FrameInfo.h:1398
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition: FrameInfo.h:1488
SystemInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:1303
const OperatingSystem & operatingSystem() const
Get OperatingSystem
Definition: FrameInfo.h:1451
OperatingSystem & operatingSystem()
Get OperatingSystem
Definition: FrameInfo.h:1457
SystemInfo()
Default constructor
const CPU & cpu() const
Get CPU
Definition: FrameInfo.h:1392
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition: FrameInfo.h:1497
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition: FrameInfo.h:1480
std::tuple< FrameInfo::SystemInfo::CPU, FrameInfo::SystemInfo::CPU::Model, FrameInfo::SystemInfo::ComputeDevice, FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor, FrameInfo::SystemInfo::OperatingSystem > Descendants
Definition: FrameInfo.h:1271
The time of frame capture
Definition: FrameInfo.h:1588
std::chrono::system_clock::time_point value() const
Get the value
bool operator>(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1644
bool operator<(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1638
bool operator<=(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1650
static constexpr Range< std::chrono::system_clock::time_point > validRange()
The range of valid values for TimeStamp
Definition: FrameInfo.h:1606
bool operator>=(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1656
std::string toString() const
Get the value as string
friend std::ostream & operator<<(std::ostream &stream, const TimeStamp &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:1662
TimeStamp()=default
Default constructor
constexpr TimeStamp(std::chrono::system_clock::time_point value)
Constructor
Definition: FrameInfo.h:1615
bool operator!=(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1632
bool operator==(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1626
std::chrono::system_clock::time_point ValueType
The type of the underlying value
Definition: FrameInfo.h:1603
Various information for a frame
Definition: FrameInfo.h:123
TimeStamp & timeStamp()
Get TimeStamp
Definition: FrameInfo.h:1912
std::string toString() const
Get the value as string
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:2017
const FrameInfo::SoftwareVersion::Core & get() const
Definition: FrameInfo.h:1933
FrameInfo & set(const SystemInfo::ComputeDevice &value)
Set SystemInfo::ComputeDevice
Definition: FrameInfo.h:1878
FrameInfo()
Default constructor
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:1759
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition: FrameInfo.h:1969
FrameInfo & set(const SystemInfo::OperatingSystem &value)
Set SystemInfo::OperatingSystem
Definition: FrameInfo.h:1899
void save(const std::string &fileName) const
Save to the given file
const SystemInfo & systemInfo() const
Get SystemInfo
Definition: FrameInfo.h:1845
FrameInfo & set(const SystemInfo &value)
Set SystemInfo
Definition: FrameInfo.h:1857
const TimeStamp & timeStamp() const
Get TimeStamp
Definition: FrameInfo.h:1906
SoftwareVersion & softwareVersion()
Get SoftwareVersion
Definition: FrameInfo.h:1825
FrameInfo(const std::string &fileName)
Construct FrameInfo by loading from file
FrameInfo & set(const SystemInfo::ComputeDevice::Vendor &value)
Set SystemInfo::ComputeDevice::Vendor
Definition: FrameInfo.h:1892
const FrameInfo::SoftwareVersion & get() const
Definition: FrameInfo.h:1925
friend std::ostream & operator<<(std::ostream &stream, const FrameInfo &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:2043
FrameInfo & set(const TimeStamp &value)
Set TimeStamp
Definition: FrameInfo.h:1918
FrameInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:1723
const FrameInfo::TimeStamp & get() const
Definition: FrameInfo.h:1992
const SoftwareVersion & softwareVersion() const
Get SoftwareVersion
Definition: FrameInfo.h:1819
FrameInfo & set(const SystemInfo::CPU::Model &value)
Set SystemInfo::CPU::Model
Definition: FrameInfo.h:1871
FrameInfo & set(const SystemInfo::ComputeDevice::Model &value)
Set SystemInfo::ComputeDevice::Model
Definition: FrameInfo.h:1885
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition: FrameInfo.h:1953
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition: FrameInfo.h:1978
FrameInfo & set(const SoftwareVersion &value)
Set SoftwareVersion
Definition: FrameInfo.h:1831
const FrameInfo::SystemInfo & get() const
Definition: FrameInfo.h:1939
std::tuple< FrameInfo::SoftwareVersion, FrameInfo::SoftwareVersion::Core, FrameInfo::SystemInfo, FrameInfo::SystemInfo::CPU, FrameInfo::SystemInfo::CPU::Model, FrameInfo::SystemInfo::ComputeDevice, FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor, FrameInfo::SystemInfo::OperatingSystem, FrameInfo::TimeStamp > Descendants
Definition: FrameInfo.h:1685
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition: FrameInfo.h:1961
FrameInfo & set(const SoftwareVersion::Core &value)
Set SoftwareVersion::Core
Definition: FrameInfo.h:1838
SystemInfo & systemInfo()
Get SystemInfo
Definition: FrameInfo.h:1851
bool operator!=(const FrameInfo &other) const
Inequality operator
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:2026
bool operator==(const FrameInfo &other) const
Equality operator
FrameInfo & set(const SystemInfo::CPU &value)
Set SystemInfo::CPU
Definition: FrameInfo.h:1864
const FrameInfo::SystemInfo::CPU & get() const
Definition: FrameInfo.h:1945
void load(const std::string &fileName)
Load from the given file
FrameInfo copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: FrameInfo.h:1800
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition: FrameInfo.h:1986
Class describing a range of values for a given type T
Definition: Range.h:118
NodeType
Definition: NodeType.h:100
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99