Zivid C++ API 2.16.0+46cdaba6-1
FrameInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2025 (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 <optional>
53#include <set>
54#include <sstream>
55#include <string>
56#include <tuple>
57#include <utility>
58#include <vector>
59
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
76
77 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
79 {
80 public:
82 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
83
85 static constexpr const char *path{ "" };
86
88 static constexpr const char *name{ "FrameInfo" };
89
91 static constexpr const char *description{ R"description(Various information for a frame)description" };
92
93 static constexpr size_t version{ 5 };
94
95#ifndef NO_DOC
96 template<size_t>
97 struct Version;
98
99 using LatestVersion = Zivid::FrameInfo;
100
101 // Short identifier. This value is not guaranteed to be universally unique
102 // Todo(ZIVID-2808): Move this to internal DataModelExt header
103 static constexpr std::array<uint8_t, 3> binaryId{ 'f', 'i', 'f' };
104
105#endif
106
108
109 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
111 {
112 public:
114 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
115
117 static constexpr const char *path{ "Metrics" };
118
120 static constexpr const char *name{ "Metrics" };
121
123 static constexpr const char *description{ R"description(Metrics related to this capture.)description" };
124
130
131 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
133 {
134 public:
136 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
137
139 static constexpr const char *path{ "Metrics/AcquisitionTime" };
140
142 static constexpr const char *name{ "AcquisitionTime" };
143
145 static constexpr const char *description{
146 R"description(Acquisition Time is the duration from the start of the capture to when the camera has acquired the
147last image. After this time, the camera has finished its acquisition and you can move the robot,
148or capture with another camera with overlapping field of view. Acquisition Time is equal to the
149time it takes for the Camera::capture(settings) API function call to return.
150)description"
151 };
152
154 using ValueType = std::chrono::microseconds;
155
158 {
159 return { std::chrono::microseconds::min(), std::chrono::microseconds::max() };
160 }
161
163 AcquisitionTime() = default;
164
166 explicit constexpr AcquisitionTime(std::chrono::microseconds value)
167 : m_value{ value }
168 {}
169
171 std::chrono::microseconds value() const;
172
174 std::string toString() const;
175
177 bool operator==(const AcquisitionTime &other) const
178 {
179 return m_value == other.m_value;
180 }
181
183 bool operator!=(const AcquisitionTime &other) const
184 {
185 return m_value != other.m_value;
186 }
187
189 bool operator<(const AcquisitionTime &other) const
190 {
191 return m_value < other.m_value;
192 }
193
195 bool operator>(const AcquisitionTime &other) const
196 {
197 return m_value > other.m_value;
198 }
199
201 bool operator<=(const AcquisitionTime &other) const
202 {
203 return m_value <= other.m_value;
204 }
205
207 bool operator>=(const AcquisitionTime &other) const
208 {
209 return m_value >= other.m_value;
210 }
211
213 friend std::ostream &operator<<(std::ostream &stream, const AcquisitionTime &value)
214 {
215 return stream << value.toString();
216 }
217
218 private:
219 void setFromString(const std::string &value);
220
221 std::chrono::microseconds m_value{ -1 };
222
223 friend struct DataModel::Detail::Befriend<AcquisitionTime>;
224 };
225
230
231 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
233 {
234 public:
236 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
237
239 static constexpr const char *path{ "Metrics/CaptureTime" };
240
242 static constexpr const char *name{ "CaptureTime" };
243
245 static constexpr const char *description{
246 R"description(Capture Time is the duration from the start of the capture to when all of the data transfer and
247processing has completed. After this time the 3D point cloud and/or 2D color image is ready and
248available on the GPU memory, and can be copied to the system memory (RAM).
249)description"
250 };
251
253 using ValueType = std::chrono::microseconds;
254
257 {
258 return { std::chrono::microseconds::min(), std::chrono::microseconds::max() };
259 }
260
262 CaptureTime() = default;
263
265 explicit constexpr CaptureTime(std::chrono::microseconds value)
266 : m_value{ value }
267 {}
268
270 std::chrono::microseconds value() const;
271
273 std::string toString() const;
274
276 bool operator==(const CaptureTime &other) const
277 {
278 return m_value == other.m_value;
279 }
280
282 bool operator!=(const CaptureTime &other) const
283 {
284 return m_value != other.m_value;
285 }
286
288 bool operator<(const CaptureTime &other) const
289 {
290 return m_value < other.m_value;
291 }
292
294 bool operator>(const CaptureTime &other) const
295 {
296 return m_value > other.m_value;
297 }
298
300 bool operator<=(const CaptureTime &other) const
301 {
302 return m_value <= other.m_value;
303 }
304
306 bool operator>=(const CaptureTime &other) const
307 {
308 return m_value >= other.m_value;
309 }
310
312 friend std::ostream &operator<<(std::ostream &stream, const CaptureTime &value)
313 {
314 return stream << value.toString();
315 }
316
317 private:
318 void setFromString(const std::string &value);
319
320 std::chrono::microseconds m_value{ -1 };
321
322 friend struct DataModel::Detail::Befriend<CaptureTime>;
323 };
324
341
342 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
344 {
345 public:
347 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
348
350 static constexpr const char *path{ "Metrics/ReprocessingTime" };
351
353 static constexpr const char *name{ "ReprocessingTime" };
354
356 static constexpr const char *description{
357 R"description(Reprocessing re-runs the entire processing pipeline (including filters, color balance etc.) on a
358previously acquired frame. Reprocessing is available in Zivid Studio for captures with Diagnostics Mode
359enabled. The ReprocessingTime field is only set if this frame was reprocessed after it was initially
360captured, otherwise it will be unset.
361
362Reprocessing Time is the duration from the start of the reprocessing action and until all processing
363of the new frame has finished. After this time the 3D point cloud and/or 2D color image is ready and
364available on the GPU memory and can be copied to the system memory (RAM).
365
366Reprocessing Time depends on the processing settings that are enabled, which capture engine that was
367used, the pixel sampling setting and the number of acquisitions used. Reprocessing Time also depends on
368the compute power of the compute device.
369
370Note that for a frame that has been re-processed, the Acquisition Time and Capture Time refers to
371the originally captured frame. Only Reprocessing Time is updated in a reprocessed frame.
372)description"
373 };
374
376 using ValueType = std::chrono::microseconds;
377
380 {
381 return { std::chrono::microseconds::min(), std::chrono::microseconds::max() };
382 }
383
385 ReprocessingTime() = default;
386
388 explicit constexpr ReprocessingTime(std::chrono::microseconds value)
389 : m_opt{ value }
390 {}
391
396 std::chrono::microseconds value() const;
397
399 bool hasValue() const;
400
402 void reset();
403
405 std::string toString() const;
406
408 bool operator==(const ReprocessingTime &other) const
409 {
410 return m_opt == other.m_opt;
411 }
412
414 bool operator!=(const ReprocessingTime &other) const
415 {
416 return m_opt != other.m_opt;
417 }
418
420 bool operator<(const ReprocessingTime &other) const
421 {
422 return m_opt < other.m_opt;
423 }
424
426 bool operator>(const ReprocessingTime &other) const
427 {
428 return m_opt > other.m_opt;
429 }
430
432 bool operator<=(const ReprocessingTime &other) const
433 {
434 return m_opt <= other.m_opt;
435 }
436
438 bool operator>=(const ReprocessingTime &other) const
439 {
440 return m_opt >= other.m_opt;
441 }
442
444 friend std::ostream &operator<<(std::ostream &stream, const ReprocessingTime &value)
445 {
446 return stream << value.toString();
447 }
448
449 private:
450 void setFromString(const std::string &value);
451
452 std::optional<std::chrono::microseconds> m_opt;
453
454 friend struct DataModel::Detail::Befriend<ReprocessingTime>;
455 };
456
457 using Descendants = std::tuple<
461
464
478#ifndef NO_DOC
479 template<
480 typename... Args,
481 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
482 typename std::enable_if<
483 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
484 value,
485 int>::type = 0>
486#else
487 template<typename... Args>
488#endif
489 explicit Metrics(Args &&...args)
490 {
491 using namespace Zivid::Detail::TypeTraits;
492
493 static_assert(
494 AllArgsDecayedAreUnique<Args...>::value,
495 "Found duplicate types among the arguments passed to Metrics(...). "
496 "Types should be listed at most once.");
497
498 set(std::forward<Args>(args)...);
499 }
500
513#ifndef NO_DOC
514 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
515#else
516 template<typename... Args>
517#endif
518 void set(Args &&...args)
519 {
520 using namespace Zivid::Detail::TypeTraits;
521
522 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
523 static_assert(
524 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
525
526 static_assert(
527 AllArgsDecayedAreUnique<Args...>::value,
528 "Found duplicate types among the arguments passed to set(...). "
529 "Types should be listed at most once.");
530
531 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
532 }
533
547#ifndef NO_DOC
548 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
549#else
550 template<typename... Args>
551#endif
552 Metrics copyWith(Args &&...args) const
553 {
554 using namespace Zivid::Detail::TypeTraits;
555
556 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
557 static_assert(
558 AllArgsAreDescendantNodes::value,
559 "All arguments passed to copyWith(...) must be descendant nodes.");
560
561 static_assert(
562 AllArgsDecayedAreUnique<Args...>::value,
563 "Found duplicate types among the arguments passed to copyWith(...). "
564 "Types should be listed at most once.");
565
566 auto copy{ *this };
567 copy.set(std::forward<Args>(args)...);
568 return copy;
569 }
570
573 {
574 return m_acquisitionTime;
575 }
576
579 {
580 return m_acquisitionTime;
581 }
582
585 {
586 m_acquisitionTime = value;
587 return *this;
588 }
589
592 {
593 return m_captureTime;
594 }
595
598 {
599 return m_captureTime;
600 }
601
603 Metrics &set(const CaptureTime &value)
604 {
605 m_captureTime = value;
606 return *this;
607 }
608
611 {
612 return m_reprocessingTime;
613 }
614
617 {
618 return m_reprocessingTime;
619 }
620
623 {
624 m_reprocessingTime = value;
625 return *this;
626 }
627
628 template<
629 typename T,
630 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::AcquisitionTime>::value, int>::type = 0>
632 {
633 return m_acquisitionTime;
634 }
635
636 template<
637 typename T,
638 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::CaptureTime>::value, int>::type = 0>
640 {
641 return m_captureTime;
642 }
643
644 template<
645 typename T,
646 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::ReprocessingTime>::value, int>::type = 0>
648 {
649 return m_reprocessingTime;
650 }
651
652 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
654 {
655 return m_acquisitionTime;
656 }
657
658 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
660 {
661 return m_captureTime;
662 }
663
664 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
666 {
667 return m_reprocessingTime;
668 }
669
671 template<typename F>
672 void forEach(const F &f) const
673 {
674 f(m_acquisitionTime);
675 f(m_captureTime);
676 f(m_reprocessingTime);
677 }
678
680 template<typename F>
681 void forEach(const F &f)
682 {
683 f(m_acquisitionTime);
684 f(m_captureTime);
685 f(m_reprocessingTime);
686 }
687
689 bool operator==(const Metrics &other) const;
690
692 bool operator!=(const Metrics &other) const;
693
695 std::string toString() const;
696
698 friend std::ostream &operator<<(std::ostream &stream, const Metrics &value)
699 {
700 return stream << value.toString();
701 }
702
703 private:
704 void setFromString(const std::string &value);
705
706 void setFromString(const std::string &fullPath, const std::string &value);
707
708 std::string getString(const std::string &fullPath) const;
709
710 AcquisitionTime m_acquisitionTime;
711 CaptureTime m_captureTime;
712 ReprocessingTime m_reprocessingTime;
713
714 friend struct DataModel::Detail::Befriend<Metrics>;
715 };
716
718
719 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
721 {
722 public:
724 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
725
727 static constexpr const char *path{ "SoftwareVersion" };
728
730 static constexpr const char *name{ "SoftwareVersion" };
731
733 static constexpr const char *description{
734 R"description(The version information for installed software at the time of image capture)description"
735 };
736
738
739 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
741 {
742 public:
744 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
745
747 static constexpr const char *path{ "SoftwareVersion/Core" };
748
750 static constexpr const char *name{ "Core" };
751
753 static constexpr const char *description{ R"description(Core version)description" };
754
756 using ValueType = std::string;
757
760 {
761 return { 0, std::numeric_limits<ValueType::size_type>::max() };
762 }
763
765 Core() = default;
766
768 explicit Core(std::string value)
769 : m_value{ std::move(value) }
770 {}
771
773 const std::string &value() const;
774
776 std::string toString() const;
777
779 bool operator==(const Core &other) const
780 {
781 return m_value == other.m_value;
782 }
783
785 bool operator!=(const Core &other) const
786 {
787 return m_value != other.m_value;
788 }
789
791 bool operator<(const Core &other) const
792 {
793 return m_value < other.m_value;
794 }
795
797 bool operator>(const Core &other) const
798 {
799 return m_value > other.m_value;
800 }
801
803 bool operator<=(const Core &other) const
804 {
805 return m_value <= other.m_value;
806 }
807
809 bool operator>=(const Core &other) const
810 {
811 return m_value >= other.m_value;
812 }
813
815 friend std::ostream &operator<<(std::ostream &stream, const Core &value)
816 {
817 return stream << value.toString();
818 }
819
820 private:
821 void setFromString(const std::string &value);
822
823 std::string m_value{ "No-version" };
824
825 friend struct DataModel::Detail::Befriend<Core>;
826 };
827
828 using Descendants = std::tuple<FrameInfo::SoftwareVersion::Core>;
829
832
844#ifndef NO_DOC
845 template<
846 typename... Args,
847 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
848 typename std::enable_if<
849 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
850 value,
851 int>::type = 0>
852#else
853 template<typename... Args>
854#endif
855 explicit SoftwareVersion(Args &&...args)
856 {
857 using namespace Zivid::Detail::TypeTraits;
858
859 static_assert(
860 AllArgsDecayedAreUnique<Args...>::value,
861 "Found duplicate types among the arguments passed to SoftwareVersion(...). "
862 "Types should be listed at most once.");
863
864 set(std::forward<Args>(args)...);
865 }
866
877#ifndef NO_DOC
878 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
879#else
880 template<typename... Args>
881#endif
882 void set(Args &&...args)
883 {
884 using namespace Zivid::Detail::TypeTraits;
885
886 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
887 static_assert(
888 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
889
890 static_assert(
891 AllArgsDecayedAreUnique<Args...>::value,
892 "Found duplicate types among the arguments passed to set(...). "
893 "Types should be listed at most once.");
894
895 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
896 }
897
909#ifndef NO_DOC
910 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
911#else
912 template<typename... Args>
913#endif
914 SoftwareVersion copyWith(Args &&...args) const
915 {
916 using namespace Zivid::Detail::TypeTraits;
917
918 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
919 static_assert(
920 AllArgsAreDescendantNodes::value,
921 "All arguments passed to copyWith(...) must be descendant nodes.");
922
923 static_assert(
924 AllArgsDecayedAreUnique<Args...>::value,
925 "Found duplicate types among the arguments passed to copyWith(...). "
926 "Types should be listed at most once.");
927
928 auto copy{ *this };
929 copy.set(std::forward<Args>(args)...);
930 return copy;
931 }
932
934 const Core &core() const
935 {
936 return m_core;
937 }
938
941 {
942 return m_core;
943 }
944
946 SoftwareVersion &set(const Core &value)
947 {
948 m_core = value;
949 return *this;
950 }
951
952 template<
953 typename T,
954 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
956 {
957 return m_core;
958 }
959
960 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
962 {
963 return m_core;
964 }
965
967 template<typename F>
968 void forEach(const F &f) const
969 {
970 f(m_core);
971 }
972
974 template<typename F>
975 void forEach(const F &f)
976 {
977 f(m_core);
978 }
979
981 bool operator==(const SoftwareVersion &other) const;
982
984 bool operator!=(const SoftwareVersion &other) const;
985
987 std::string toString() const;
988
990 friend std::ostream &operator<<(std::ostream &stream, const SoftwareVersion &value)
991 {
992 return stream << value.toString();
993 }
994
995 private:
996 void setFromString(const std::string &value);
997
998 void setFromString(const std::string &fullPath, const std::string &value);
999
1000 std::string getString(const std::string &fullPath) const;
1001
1002 Core m_core;
1003
1004 friend struct DataModel::Detail::Befriend<SoftwareVersion>;
1005 };
1006
1008
1009 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1011 {
1012 public:
1014 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1015
1017 static constexpr const char *path{ "SystemInfo" };
1018
1020 static constexpr const char *name{ "SystemInfo" };
1021
1023 static constexpr const char *description{
1024 R"description(Information about the system that captured this frame)description"
1025 };
1026
1028
1029 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1031 {
1032 public:
1034 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1035
1037 static constexpr const char *path{ "SystemInfo/CPU" };
1038
1040 static constexpr const char *name{ "CPU" };
1041
1043 static constexpr const char *description{ R"description(CPU)description" };
1044
1046
1047 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1049 {
1050 public:
1052 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1053
1055 static constexpr const char *path{ "SystemInfo/CPU/Model" };
1056
1058 static constexpr const char *name{ "Model" };
1059
1061 static constexpr const char *description{ R"description(CPU model)description" };
1062
1064 using ValueType = std::string;
1065
1068 {
1069 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1070 }
1071
1073 Model() = default;
1074
1076 explicit Model(std::string value)
1077 : m_value{ std::move(value) }
1078 {}
1079
1081 const std::string &value() const;
1082
1084 std::string toString() const;
1085
1087 bool operator==(const Model &other) const
1088 {
1089 return m_value == other.m_value;
1090 }
1091
1093 bool operator!=(const Model &other) const
1094 {
1095 return m_value != other.m_value;
1096 }
1097
1099 bool operator<(const Model &other) const
1100 {
1101 return m_value < other.m_value;
1102 }
1103
1105 bool operator>(const Model &other) const
1106 {
1107 return m_value > other.m_value;
1108 }
1109
1111 bool operator<=(const Model &other) const
1112 {
1113 return m_value <= other.m_value;
1114 }
1115
1117 bool operator>=(const Model &other) const
1118 {
1119 return m_value >= other.m_value;
1120 }
1121
1123 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
1124 {
1125 return stream << value.toString();
1126 }
1127
1128 private:
1129 void setFromString(const std::string &value);
1130
1131 std::string m_value{};
1132
1133 friend struct DataModel::Detail::Befriend<Model>;
1134 };
1135
1136 using Descendants = std::tuple<FrameInfo::SystemInfo::CPU::Model>;
1137
1140
1152#ifndef NO_DOC
1153 template<
1154 typename... Args,
1155 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1156 typename std::enable_if<
1157 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1158 value,
1159 int>::type = 0>
1160#else
1161 template<typename... Args>
1162#endif
1163 explicit CPU(Args &&...args)
1164 {
1165 using namespace Zivid::Detail::TypeTraits;
1166
1167 static_assert(
1168 AllArgsDecayedAreUnique<Args...>::value,
1169 "Found duplicate types among the arguments passed to CPU(...). "
1170 "Types should be listed at most once.");
1171
1172 set(std::forward<Args>(args)...);
1173 }
1174
1185#ifndef NO_DOC
1186 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1187#else
1188 template<typename... Args>
1189#endif
1190 void set(Args &&...args)
1191 {
1192 using namespace Zivid::Detail::TypeTraits;
1193
1194 using AllArgsAreDescendantNodes =
1195 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1196 static_assert(
1197 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1198
1199 static_assert(
1200 AllArgsDecayedAreUnique<Args...>::value,
1201 "Found duplicate types among the arguments passed to set(...). "
1202 "Types should be listed at most once.");
1203
1204 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1205 }
1206
1218#ifndef NO_DOC
1219 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1220#else
1221 template<typename... Args>
1222#endif
1223 CPU copyWith(Args &&...args) const
1224 {
1225 using namespace Zivid::Detail::TypeTraits;
1226
1227 using AllArgsAreDescendantNodes =
1228 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1229 static_assert(
1230 AllArgsAreDescendantNodes::value,
1231 "All arguments passed to copyWith(...) must be descendant nodes.");
1232
1233 static_assert(
1234 AllArgsDecayedAreUnique<Args...>::value,
1235 "Found duplicate types among the arguments passed to copyWith(...). "
1236 "Types should be listed at most once.");
1237
1238 auto copy{ *this };
1239 copy.set(std::forward<Args>(args)...);
1240 return copy;
1241 }
1242
1244 const Model &model() const
1245 {
1246 return m_model;
1247 }
1248
1251 {
1252 return m_model;
1253 }
1254
1256 CPU &set(const Model &value)
1257 {
1258 m_model = value;
1259 return *this;
1260 }
1261
1262 template<
1263 typename T,
1264 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1266 {
1267 return m_model;
1268 }
1269
1270 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1272 {
1273 return m_model;
1274 }
1275
1277 template<typename F>
1278 void forEach(const F &f) const
1279 {
1280 f(m_model);
1281 }
1282
1284 template<typename F>
1285 void forEach(const F &f)
1286 {
1287 f(m_model);
1288 }
1289
1291 bool operator==(const CPU &other) const;
1292
1294 bool operator!=(const CPU &other) const;
1295
1297 std::string toString() const;
1298
1300 friend std::ostream &operator<<(std::ostream &stream, const CPU &value)
1301 {
1302 return stream << value.toString();
1303 }
1304
1305 private:
1306 void setFromString(const std::string &value);
1307
1308 void setFromString(const std::string &fullPath, const std::string &value);
1309
1310 std::string getString(const std::string &fullPath) const;
1311
1312 Model m_model;
1313
1314 friend struct DataModel::Detail::Befriend<CPU>;
1315 };
1316
1318
1319 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1321 {
1322 public:
1324 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1325
1327 static constexpr const char *path{ "SystemInfo/ComputeDevice" };
1328
1330 static constexpr const char *name{ "ComputeDevice" };
1331
1333 static constexpr const char *description{ R"description(Compute device)description" };
1334
1336
1337 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1339 {
1340 public:
1342 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1343
1345 static constexpr const char *path{ "SystemInfo/ComputeDevice/Model" };
1346
1348 static constexpr const char *name{ "Model" };
1349
1351 static constexpr const char *description{ R"description(Compute device model)description" };
1352
1354 using ValueType = std::string;
1355
1358 {
1359 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1360 }
1361
1363 Model() = default;
1364
1366 explicit Model(std::string value)
1367 : m_value{ std::move(value) }
1368 {}
1369
1371 const std::string &value() const;
1372
1374 std::string toString() const;
1375
1377 bool operator==(const Model &other) const
1378 {
1379 return m_value == other.m_value;
1380 }
1381
1383 bool operator!=(const Model &other) const
1384 {
1385 return m_value != other.m_value;
1386 }
1387
1389 bool operator<(const Model &other) const
1390 {
1391 return m_value < other.m_value;
1392 }
1393
1395 bool operator>(const Model &other) const
1396 {
1397 return m_value > other.m_value;
1398 }
1399
1401 bool operator<=(const Model &other) const
1402 {
1403 return m_value <= other.m_value;
1404 }
1405
1407 bool operator>=(const Model &other) const
1408 {
1409 return m_value >= other.m_value;
1410 }
1411
1413 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
1414 {
1415 return stream << value.toString();
1416 }
1417
1418 private:
1419 void setFromString(const std::string &value);
1420
1421 std::string m_value{};
1422
1423 friend struct DataModel::Detail::Befriend<Model>;
1424 };
1425
1427
1428 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1430 {
1431 public:
1433 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1434
1436 static constexpr const char *path{ "SystemInfo/ComputeDevice/Vendor" };
1437
1439 static constexpr const char *name{ "Vendor" };
1440
1442 static constexpr const char *description{ R"description(Compute device vendor)description" };
1443
1445 using ValueType = std::string;
1446
1449 {
1450 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1451 }
1452
1454 Vendor() = default;
1455
1457 explicit Vendor(std::string value)
1458 : m_value{ std::move(value) }
1459 {}
1460
1462 const std::string &value() const;
1463
1465 std::string toString() const;
1466
1468 bool operator==(const Vendor &other) const
1469 {
1470 return m_value == other.m_value;
1471 }
1472
1474 bool operator!=(const Vendor &other) const
1475 {
1476 return m_value != other.m_value;
1477 }
1478
1480 bool operator<(const Vendor &other) const
1481 {
1482 return m_value < other.m_value;
1483 }
1484
1486 bool operator>(const Vendor &other) const
1487 {
1488 return m_value > other.m_value;
1489 }
1490
1492 bool operator<=(const Vendor &other) const
1493 {
1494 return m_value <= other.m_value;
1495 }
1496
1498 bool operator>=(const Vendor &other) const
1499 {
1500 return m_value >= other.m_value;
1501 }
1502
1504 friend std::ostream &operator<<(std::ostream &stream, const Vendor &value)
1505 {
1506 return stream << value.toString();
1507 }
1508
1509 private:
1510 void setFromString(const std::string &value);
1511
1512 std::string m_value{};
1513
1514 friend struct DataModel::Detail::Befriend<Vendor>;
1515 };
1516
1517 using Descendants = std::
1518 tuple<FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor>;
1519
1522
1535#ifndef NO_DOC
1536 template<
1537 typename... Args,
1538 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1539 typename std::enable_if<
1540 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1541 value,
1542 int>::type = 0>
1543#else
1544 template<typename... Args>
1545#endif
1546 explicit ComputeDevice(Args &&...args)
1547 {
1548 using namespace Zivid::Detail::TypeTraits;
1549
1550 static_assert(
1551 AllArgsDecayedAreUnique<Args...>::value,
1552 "Found duplicate types among the arguments passed to ComputeDevice(...). "
1553 "Types should be listed at most once.");
1554
1555 set(std::forward<Args>(args)...);
1556 }
1557
1569#ifndef NO_DOC
1570 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1571#else
1572 template<typename... Args>
1573#endif
1574 void set(Args &&...args)
1575 {
1576 using namespace Zivid::Detail::TypeTraits;
1577
1578 using AllArgsAreDescendantNodes =
1579 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1580 static_assert(
1581 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1582
1583 static_assert(
1584 AllArgsDecayedAreUnique<Args...>::value,
1585 "Found duplicate types among the arguments passed to set(...). "
1586 "Types should be listed at most once.");
1587
1588 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1589 }
1590
1603#ifndef NO_DOC
1604 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1605#else
1606 template<typename... Args>
1607#endif
1608 ComputeDevice copyWith(Args &&...args) const
1609 {
1610 using namespace Zivid::Detail::TypeTraits;
1611
1612 using AllArgsAreDescendantNodes =
1613 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1614 static_assert(
1615 AllArgsAreDescendantNodes::value,
1616 "All arguments passed to copyWith(...) must be descendant nodes.");
1617
1618 static_assert(
1619 AllArgsDecayedAreUnique<Args...>::value,
1620 "Found duplicate types among the arguments passed to copyWith(...). "
1621 "Types should be listed at most once.");
1622
1623 auto copy{ *this };
1624 copy.set(std::forward<Args>(args)...);
1625 return copy;
1626 }
1627
1629 const Model &model() const
1630 {
1631 return m_model;
1632 }
1633
1636 {
1637 return m_model;
1638 }
1639
1641 ComputeDevice &set(const Model &value)
1642 {
1643 m_model = value;
1644 return *this;
1645 }
1646
1648 const Vendor &vendor() const
1649 {
1650 return m_vendor;
1651 }
1652
1655 {
1656 return m_vendor;
1657 }
1658
1660 ComputeDevice &set(const Vendor &value)
1661 {
1662 m_vendor = value;
1663 return *this;
1664 }
1665
1666 template<
1667 typename T,
1668 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1669 type = 0>
1671 {
1672 return m_model;
1673 }
1674
1675 template<
1676 typename T,
1677 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1678 type = 0>
1680 {
1681 return m_vendor;
1682 }
1683
1684 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1686 {
1687 return m_model;
1688 }
1689
1690 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1692 {
1693 return m_vendor;
1694 }
1695
1697 template<typename F>
1698 void forEach(const F &f) const
1699 {
1700 f(m_model);
1701 f(m_vendor);
1702 }
1703
1705 template<typename F>
1706 void forEach(const F &f)
1707 {
1708 f(m_model);
1709 f(m_vendor);
1710 }
1711
1713 bool operator==(const ComputeDevice &other) const;
1714
1716 bool operator!=(const ComputeDevice &other) const;
1717
1719 std::string toString() const;
1720
1722 friend std::ostream &operator<<(std::ostream &stream, const ComputeDevice &value)
1723 {
1724 return stream << value.toString();
1725 }
1726
1727 private:
1728 void setFromString(const std::string &value);
1729
1730 void setFromString(const std::string &fullPath, const std::string &value);
1731
1732 std::string getString(const std::string &fullPath) const;
1733
1734 Model m_model;
1735 Vendor m_vendor;
1736
1737 friend struct DataModel::Detail::Befriend<ComputeDevice>;
1738 };
1739
1741
1742 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1744 {
1745 public:
1747 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1748
1750 static constexpr const char *path{ "SystemInfo/OperatingSystem" };
1751
1753 static constexpr const char *name{ "OperatingSystem" };
1754
1756 static constexpr const char *description{ R"description(Operating system)description" };
1757
1759 using ValueType = std::string;
1760
1763 {
1764 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1765 }
1766
1768 OperatingSystem() = default;
1769
1771 explicit OperatingSystem(std::string value)
1772 : m_value{ std::move(value) }
1773 {}
1774
1776 const std::string &value() const;
1777
1779 std::string toString() const;
1780
1782 bool operator==(const OperatingSystem &other) const
1783 {
1784 return m_value == other.m_value;
1785 }
1786
1788 bool operator!=(const OperatingSystem &other) const
1789 {
1790 return m_value != other.m_value;
1791 }
1792
1794 bool operator<(const OperatingSystem &other) const
1795 {
1796 return m_value < other.m_value;
1797 }
1798
1800 bool operator>(const OperatingSystem &other) const
1801 {
1802 return m_value > other.m_value;
1803 }
1804
1806 bool operator<=(const OperatingSystem &other) const
1807 {
1808 return m_value <= other.m_value;
1809 }
1810
1812 bool operator>=(const OperatingSystem &other) const
1813 {
1814 return m_value >= other.m_value;
1815 }
1816
1818 friend std::ostream &operator<<(std::ostream &stream, const OperatingSystem &value)
1819 {
1820 return stream << value.toString();
1821 }
1822
1823 private:
1824 void setFromString(const std::string &value);
1825
1826 std::string m_value{};
1827
1828 friend struct DataModel::Detail::Befriend<OperatingSystem>;
1829 };
1830
1831 using Descendants = std::tuple<
1838
1841
1858#ifndef NO_DOC
1859 template<
1860 typename... Args,
1861 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1862 typename std::enable_if<
1863 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1864 value,
1865 int>::type = 0>
1866#else
1867 template<typename... Args>
1868#endif
1869 explicit SystemInfo(Args &&...args)
1870 {
1871 using namespace Zivid::Detail::TypeTraits;
1872
1873 static_assert(
1874 AllArgsDecayedAreUnique<Args...>::value,
1875 "Found duplicate types among the arguments passed to SystemInfo(...). "
1876 "Types should be listed at most once.");
1877
1878 set(std::forward<Args>(args)...);
1879 }
1880
1896#ifndef NO_DOC
1897 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1898#else
1899 template<typename... Args>
1900#endif
1901 void set(Args &&...args)
1902 {
1903 using namespace Zivid::Detail::TypeTraits;
1904
1905 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1906 static_assert(
1907 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1908
1909 static_assert(
1910 AllArgsDecayedAreUnique<Args...>::value,
1911 "Found duplicate types among the arguments passed to set(...). "
1912 "Types should be listed at most once.");
1913
1914 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1915 }
1916
1933#ifndef NO_DOC
1934 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1935#else
1936 template<typename... Args>
1937#endif
1938 SystemInfo copyWith(Args &&...args) const
1939 {
1940 using namespace Zivid::Detail::TypeTraits;
1941
1942 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1943 static_assert(
1944 AllArgsAreDescendantNodes::value,
1945 "All arguments passed to copyWith(...) must be descendant nodes.");
1946
1947 static_assert(
1948 AllArgsDecayedAreUnique<Args...>::value,
1949 "Found duplicate types among the arguments passed to copyWith(...). "
1950 "Types should be listed at most once.");
1951
1952 auto copy{ *this };
1953 copy.set(std::forward<Args>(args)...);
1954 return copy;
1955 }
1956
1958 const CPU &cpu() const
1959 {
1960 return m_cpu;
1961 }
1962
1965 {
1966 return m_cpu;
1967 }
1968
1970 SystemInfo &set(const CPU &value)
1971 {
1972 m_cpu = value;
1973 return *this;
1974 }
1975
1978 {
1979 m_cpu.set(value);
1980 return *this;
1981 }
1982
1985 {
1986 return m_computeDevice;
1987 }
1988
1991 {
1992 return m_computeDevice;
1993 }
1994
1997 {
1998 m_computeDevice = value;
1999 return *this;
2000 }
2001
2004 {
2005 m_computeDevice.set(value);
2006 return *this;
2007 }
2008
2011 {
2012 m_computeDevice.set(value);
2013 return *this;
2014 }
2015
2018 {
2019 return m_operatingSystem;
2020 }
2021
2024 {
2025 return m_operatingSystem;
2026 }
2027
2030 {
2031 m_operatingSystem = value;
2032 return *this;
2033 }
2034
2035 template<
2036 typename T,
2037 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
2039 {
2040 return m_cpu;
2041 }
2042
2043 template<
2044 typename T,
2045 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
2047 {
2048 return m_cpu.get<FrameInfo::SystemInfo::CPU::Model>();
2049 }
2050
2051 template<
2052 typename T,
2053 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
2055 {
2056 return m_computeDevice;
2057 }
2058
2059 template<
2060 typename T,
2061 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
2062 type = 0>
2064 {
2065 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
2066 }
2067
2068 template<
2069 typename T,
2070 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
2071 type = 0>
2073 {
2074 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
2075 }
2076
2077 template<
2078 typename T,
2079 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
2081 {
2082 return m_operatingSystem;
2083 }
2084
2085 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2087 {
2088 return m_cpu;
2089 }
2090
2091 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2093 {
2094 return m_computeDevice;
2095 }
2096
2097 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2099 {
2100 return m_operatingSystem;
2101 }
2102
2104 template<typename F>
2105 void forEach(const F &f) const
2106 {
2107 f(m_cpu);
2108 f(m_computeDevice);
2109 f(m_operatingSystem);
2110 }
2111
2113 template<typename F>
2114 void forEach(const F &f)
2115 {
2116 f(m_cpu);
2117 f(m_computeDevice);
2118 f(m_operatingSystem);
2119 }
2120
2122 bool operator==(const SystemInfo &other) const;
2123
2125 bool operator!=(const SystemInfo &other) const;
2126
2128 std::string toString() const;
2129
2131 friend std::ostream &operator<<(std::ostream &stream, const SystemInfo &value)
2132 {
2133 return stream << value.toString();
2134 }
2135
2136 private:
2137 void setFromString(const std::string &value);
2138
2139 void setFromString(const std::string &fullPath, const std::string &value);
2140
2141 std::string getString(const std::string &fullPath) const;
2142
2143 CPU m_cpu;
2144 ComputeDevice m_computeDevice;
2145 OperatingSystem m_operatingSystem;
2146
2147 friend struct DataModel::Detail::Befriend<SystemInfo>;
2148 };
2149
2151
2152 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2154 {
2155 public:
2157 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
2158
2160 static constexpr const char *path{ "TimeStamp" };
2161
2163 static constexpr const char *name{ "TimeStamp" };
2164
2166 static constexpr const char *description{ R"description(The time of frame capture)description" };
2167
2169 using ValueType = std::chrono::system_clock::time_point;
2170
2173 {
2174 return { std::chrono::system_clock::time_point::min(), std::chrono::system_clock::time_point::max() };
2175 }
2176
2178 TimeStamp() = default;
2179
2181 explicit constexpr TimeStamp(std::chrono::system_clock::time_point value)
2182 : m_value{ value }
2183 {}
2184
2186 std::chrono::system_clock::time_point value() const;
2187
2189 std::string toString() const;
2190
2192 bool operator==(const TimeStamp &other) const
2193 {
2194 return m_value == other.m_value;
2195 }
2196
2198 bool operator!=(const TimeStamp &other) const
2199 {
2200 return m_value != other.m_value;
2201 }
2202
2204 bool operator<(const TimeStamp &other) const
2205 {
2206 return m_value < other.m_value;
2207 }
2208
2210 bool operator>(const TimeStamp &other) const
2211 {
2212 return m_value > other.m_value;
2213 }
2214
2216 bool operator<=(const TimeStamp &other) const
2217 {
2218 return m_value <= other.m_value;
2219 }
2220
2222 bool operator>=(const TimeStamp &other) const
2223 {
2224 return m_value >= other.m_value;
2225 }
2226
2228 friend std::ostream &operator<<(std::ostream &stream, const TimeStamp &value)
2229 {
2230 return stream << value.toString();
2231 }
2232
2233 private:
2234 void setFromString(const std::string &value);
2235
2236 std::chrono::system_clock::time_point m_value{};
2237
2238 friend struct DataModel::Detail::Befriend<TimeStamp>;
2239 };
2240
2241 using Descendants = std::tuple<
2256
2259
2261 explicit FrameInfo(const std::string &fileName);
2262
2268 [[nodiscard]] static FrameInfo fromSerialized(const std::string &value);
2269
2275 std::string serialize() const;
2276
2301#ifndef NO_DOC
2302 template<
2303 typename... Args,
2304 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2305 typename std::enable_if<
2306 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2307 int>::type = 0>
2308#else
2309 template<typename... Args>
2310#endif
2311 explicit FrameInfo(Args &&...args)
2312 {
2313 using namespace Zivid::Detail::TypeTraits;
2314
2315 static_assert(
2316 AllArgsDecayedAreUnique<Args...>::value,
2317 "Found duplicate types among the arguments passed to FrameInfo(...). "
2318 "Types should be listed at most once.");
2319
2320 set(std::forward<Args>(args)...);
2321 }
2322
2346#ifndef NO_DOC
2347 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2348#else
2349 template<typename... Args>
2350#endif
2351 void set(Args &&...args)
2352 {
2353 using namespace Zivid::Detail::TypeTraits;
2354
2355 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2356 static_assert(
2357 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2358
2359 static_assert(
2360 AllArgsDecayedAreUnique<Args...>::value,
2361 "Found duplicate types among the arguments passed to set(...). "
2362 "Types should be listed at most once.");
2363
2364 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2365 }
2366
2391#ifndef NO_DOC
2392 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2393#else
2394 template<typename... Args>
2395#endif
2396 FrameInfo copyWith(Args &&...args) const
2397 {
2398 using namespace Zivid::Detail::TypeTraits;
2399
2400 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2401 static_assert(
2402 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
2403
2404 static_assert(
2405 AllArgsDecayedAreUnique<Args...>::value,
2406 "Found duplicate types among the arguments passed to copyWith(...). "
2407 "Types should be listed at most once.");
2408
2409 auto copy{ *this };
2410 copy.set(std::forward<Args>(args)...);
2411 return copy;
2412 }
2413
2415 const Metrics &metrics() const
2416 {
2417 return m_metrics;
2418 }
2419
2422 {
2423 return m_metrics;
2424 }
2425
2427 FrameInfo &set(const Metrics &value)
2428 {
2429 m_metrics = value;
2430 return *this;
2431 }
2432
2435 {
2436 m_metrics.set(value);
2437 return *this;
2438 }
2439
2442 {
2443 m_metrics.set(value);
2444 return *this;
2445 }
2446
2449 {
2450 m_metrics.set(value);
2451 return *this;
2452 }
2453
2456 {
2457 return m_softwareVersion;
2458 }
2459
2462 {
2463 return m_softwareVersion;
2464 }
2465
2468 {
2469 m_softwareVersion = value;
2470 return *this;
2471 }
2472
2475 {
2476 m_softwareVersion.set(value);
2477 return *this;
2478 }
2479
2481 const SystemInfo &systemInfo() const
2482 {
2483 return m_systemInfo;
2484 }
2485
2488 {
2489 return m_systemInfo;
2490 }
2491
2493 FrameInfo &set(const SystemInfo &value)
2494 {
2495 m_systemInfo = value;
2496 return *this;
2497 }
2498
2501 {
2502 m_systemInfo.set(value);
2503 return *this;
2504 }
2505
2508 {
2509 m_systemInfo.set(value);
2510 return *this;
2511 }
2512
2515 {
2516 m_systemInfo.set(value);
2517 return *this;
2518 }
2519
2522 {
2523 m_systemInfo.set(value);
2524 return *this;
2525 }
2526
2529 {
2530 m_systemInfo.set(value);
2531 return *this;
2532 }
2533
2536 {
2537 m_systemInfo.set(value);
2538 return *this;
2539 }
2540
2542 const TimeStamp &timeStamp() const
2543 {
2544 return m_timeStamp;
2545 }
2546
2549 {
2550 return m_timeStamp;
2551 }
2552
2554 FrameInfo &set(const TimeStamp &value)
2555 {
2556 m_timeStamp = value;
2557 return *this;
2558 }
2559
2560 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::Metrics>::value, int>::type = 0>
2562 {
2563 return m_metrics;
2564 }
2565
2566 template<
2567 typename T,
2568 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::AcquisitionTime>::value, int>::type = 0>
2570 {
2571 return m_metrics.get<FrameInfo::Metrics::AcquisitionTime>();
2572 }
2573
2574 template<
2575 typename T,
2576 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::CaptureTime>::value, int>::type = 0>
2578 {
2579 return m_metrics.get<FrameInfo::Metrics::CaptureTime>();
2580 }
2581
2582 template<
2583 typename T,
2584 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::ReprocessingTime>::value, int>::type = 0>
2586 {
2587 return m_metrics.get<FrameInfo::Metrics::ReprocessingTime>();
2588 }
2589
2590 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion>::value, int>::type = 0>
2592 {
2593 return m_softwareVersion;
2594 }
2595
2596 template<
2597 typename T,
2598 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
2600 {
2601 return m_softwareVersion.get<FrameInfo::SoftwareVersion::Core>();
2602 }
2603
2604 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo>::value, int>::type = 0>
2606 {
2607 return m_systemInfo;
2608 }
2609
2610 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
2612 {
2613 return m_systemInfo.get<FrameInfo::SystemInfo::CPU>();
2614 }
2615
2616 template<
2617 typename T,
2618 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
2620 {
2621 return m_systemInfo.get<FrameInfo::SystemInfo::CPU::Model>();
2622 }
2623
2624 template<
2625 typename T,
2626 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
2628 {
2629 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice>();
2630 }
2631
2632 template<
2633 typename T,
2634 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::type = 0>
2636 {
2637 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
2638 }
2639
2640 template<
2641 typename T,
2642 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::type =
2643 0>
2645 {
2646 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
2647 }
2648
2649 template<
2650 typename T,
2651 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
2653 {
2654 return m_systemInfo.get<FrameInfo::SystemInfo::OperatingSystem>();
2655 }
2656
2657 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::TimeStamp>::value, int>::type = 0>
2659 {
2660 return m_timeStamp;
2661 }
2662
2663 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2665 {
2666 return m_metrics;
2667 }
2668
2669 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2671 {
2672 return m_softwareVersion;
2673 }
2674
2675 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2677 {
2678 return m_systemInfo;
2679 }
2680
2681 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
2683 {
2684 return m_timeStamp;
2685 }
2686
2688 template<typename F>
2689 void forEach(const F &f) const
2690 {
2691 f(m_metrics);
2692 f(m_softwareVersion);
2693 f(m_systemInfo);
2694 f(m_timeStamp);
2695 }
2696
2698 template<typename F>
2699 void forEach(const F &f)
2700 {
2701 f(m_metrics);
2702 f(m_softwareVersion);
2703 f(m_systemInfo);
2704 f(m_timeStamp);
2705 }
2706
2708 bool operator==(const FrameInfo &other) const;
2709
2711 bool operator!=(const FrameInfo &other) const;
2712
2714 std::string toString() const;
2715
2717 friend std::ostream &operator<<(std::ostream &stream, const FrameInfo &value)
2718 {
2719 return stream << value.toString();
2720 }
2721
2723 void save(const std::string &fileName) const;
2724
2726 void load(const std::string &fileName);
2727
2728 private:
2729 void setFromString(const std::string &value);
2730
2731 void setFromString(const std::string &fullPath, const std::string &value);
2732
2733 std::string getString(const std::string &fullPath) const;
2734
2735 Metrics m_metrics;
2736 SoftwareVersion m_softwareVersion;
2737 SystemInfo m_systemInfo;
2738 TimeStamp m_timeStamp;
2739
2740 friend struct DataModel::Detail::Befriend<FrameInfo>;
2741 };
2742
2743#ifndef NO_DOC
2744 template<>
2745 struct FrameInfo::Version<5>
2746 {
2747 using Type = FrameInfo;
2748 };
2749#endif
2750
2751} // namespace Zivid
2752
2753#ifndef NO_DOC
2755namespace Zivid::Detail
2756{
2757
2758 ZIVID_CORE_EXPORT void save(const Zivid::FrameInfo &dataModel, std::ostream &ostream);
2759 ZIVID_CORE_EXPORT void load(Zivid::FrameInfo &dataModel, std::istream &istream);
2760
2761 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::FrameInfo &source);
2762 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(Zivid::FrameInfo &dest, const std::vector<uint8_t> &data);
2763
2764} // namespace Zivid::Detail
2765#endif
2766
2767#ifdef _MSC_VER
2768# pragma warning(pop)
2769#endif
2770
2771#ifndef NO_DOC
2772# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2773namespace std // NOLINT
2774{
2775
2776 template<>
2777 struct tuple_size<Zivid::FrameInfo::Metrics> : integral_constant<size_t, 3>
2778 {};
2779
2780 template<size_t i>
2781 struct tuple_element<i, Zivid::FrameInfo::Metrics>
2782 {
2783 static_assert(i < tuple_size<Zivid::FrameInfo::Metrics>::value, "Index must be less than 3");
2784
2785 using type // NOLINT
2786 = decltype(declval<Zivid::FrameInfo::Metrics>().get<i>());
2787 };
2788
2789 template<>
2790 struct tuple_size<Zivid::FrameInfo::SoftwareVersion> : integral_constant<size_t, 1>
2791 {};
2792
2793 template<size_t i>
2794 struct tuple_element<i, Zivid::FrameInfo::SoftwareVersion>
2795 {
2796 static_assert(i < tuple_size<Zivid::FrameInfo::SoftwareVersion>::value, "Index must be less than 1");
2797
2798 using type // NOLINT
2799 = decltype(declval<Zivid::FrameInfo::SoftwareVersion>().get<i>());
2800 };
2801
2802 template<>
2803 struct tuple_size<Zivid::FrameInfo::SystemInfo> : integral_constant<size_t, 3>
2804 {};
2805
2806 template<size_t i>
2807 struct tuple_element<i, Zivid::FrameInfo::SystemInfo>
2808 {
2809 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo>::value, "Index must be less than 3");
2810
2811 using type // NOLINT
2812 = decltype(declval<Zivid::FrameInfo::SystemInfo>().get<i>());
2813 };
2814
2815 template<>
2816 struct tuple_size<Zivid::FrameInfo::SystemInfo::CPU> : integral_constant<size_t, 1>
2817 {};
2818
2819 template<size_t i>
2820 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::CPU>
2821 {
2822 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::CPU>::value, "Index must be less than 1");
2823
2824 using type // NOLINT
2825 = decltype(declval<Zivid::FrameInfo::SystemInfo::CPU>().get<i>());
2826 };
2827
2828 template<>
2829 struct tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice> : integral_constant<size_t, 2>
2830 {};
2831
2832 template<size_t i>
2833 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::ComputeDevice>
2834 {
2835 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice>::value, "Index must be less than 2");
2836
2837 using type // NOLINT
2838 = decltype(declval<Zivid::FrameInfo::SystemInfo::ComputeDevice>().get<i>());
2839 };
2840
2841 template<>
2842 struct tuple_size<Zivid::FrameInfo> : integral_constant<size_t, 4>
2843 {};
2844
2845 template<size_t i>
2846 struct tuple_element<i, Zivid::FrameInfo>
2847 {
2848 static_assert(i < tuple_size<Zivid::FrameInfo>::value, "Index must be less than 4");
2849
2850 using type // NOLINT
2851 = decltype(declval<Zivid::FrameInfo>().get<i>());
2852 };
2853
2854} // namespace std
2855# endif
2856#endif
2857
2858// If we have access to the DataModel library, automatically include internal DataModel
2859// header. This header is necessary for serialization and deserialization.
2860#if defined(__has_include) && !defined(NO_DOC)
2861# if __has_include("Zivid/FrameInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
2862# include "Zivid/FrameInfoInternal.h"
2863# endif
2864#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Contains information about the compute device used by Zivid::Application.
Definition ComputeDevice.h:58
Acquisition Time is the duration from the start of the capture to when the camera has acquired the la...
Definition FrameInfo.h:133
AcquisitionTime()=default
Default constructor.
bool operator<(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:189
bool operator<=(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:201
std::chrono::microseconds ValueType
The type of the underlying value.
Definition FrameInfo.h:154
bool operator>=(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:207
std::chrono::microseconds value() const
Get the value.
bool operator>(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:195
bool operator==(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:177
bool operator!=(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:183
constexpr AcquisitionTime(std::chrono::microseconds value)
Constructor.
Definition FrameInfo.h:166
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for AcquisitionTime.
Definition FrameInfo.h:157
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const AcquisitionTime &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:213
Capture Time is the duration from the start of the capture to when all of the data transfer and proce...
Definition FrameInfo.h:233
constexpr CaptureTime(std::chrono::microseconds value)
Constructor.
Definition FrameInfo.h:265
std::string toString() const
Get the value as string.
CaptureTime()=default
Default constructor.
bool operator<(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:288
std::chrono::microseconds ValueType
The type of the underlying value.
Definition FrameInfo.h:253
bool operator>(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:294
bool operator==(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:276
bool operator<=(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:300
bool operator>=(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:306
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for CaptureTime.
Definition FrameInfo.h:256
bool operator!=(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:282
std::chrono::microseconds value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const CaptureTime &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:312
Reprocessing re-runs the entire processing pipeline (including filters, color balance etc....
Definition FrameInfo.h:344
bool operator<(const ReprocessingTime &other) const
Comparison operator.
Definition FrameInfo.h:420
constexpr ReprocessingTime(std::chrono::microseconds value)
Constructor.
Definition FrameInfo.h:388
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for ReprocessingTime.
Definition FrameInfo.h:379
bool operator>=(const ReprocessingTime &other) const
Comparison operator.
Definition FrameInfo.h:438
bool hasValue() const
Check if the value is set.
bool operator>(const ReprocessingTime &other) const
Comparison operator.
Definition FrameInfo.h:426
std::string toString() const
Get the value as string.
void reset()
Reset the node to unset state.
std::chrono::microseconds value() const
Get the value.
bool operator<=(const ReprocessingTime &other) const
Comparison operator.
Definition FrameInfo.h:432
friend std::ostream & operator<<(std::ostream &stream, const ReprocessingTime &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:444
std::chrono::microseconds ValueType
The type of the underlying value.
Definition FrameInfo.h:376
bool operator==(const ReprocessingTime &other) const
Comparison operator.
Definition FrameInfo.h:408
ReprocessingTime()=default
Default constructor.
bool operator!=(const ReprocessingTime &other) const
Comparison operator.
Definition FrameInfo.h:414
Metrics related to this capture.
Definition FrameInfo.h:111
std::tuple< FrameInfo::Metrics::AcquisitionTime, FrameInfo::Metrics::CaptureTime, FrameInfo::Metrics::ReprocessingTime > Descendants
Definition FrameInfo.h:457
friend std::ostream & operator<<(std::ostream &stream, const Metrics &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:698
bool operator!=(const Metrics &other) const
Inequality operator.
Metrics()
Default constructor.
const FrameInfo::Metrics::ReprocessingTime & get() const
Definition FrameInfo.h:647
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:672
Metrics copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition FrameInfo.h:552
const CaptureTime & captureTime() const
Get CaptureTime.
Definition FrameInfo.h:591
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:681
CaptureTime & captureTime()
Get CaptureTime.
Definition FrameInfo.h:597
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:518
Metrics & set(const CaptureTime &value)
Set CaptureTime.
Definition FrameInfo.h:603
const AcquisitionTime & acquisitionTime() const
Get AcquisitionTime.
Definition FrameInfo.h:572
const ReprocessingTime & reprocessingTime() const
Get ReprocessingTime.
Definition FrameInfo.h:610
const FrameInfo::Metrics::CaptureTime & get() const
Definition FrameInfo.h:639
AcquisitionTime & acquisitionTime()
Get AcquisitionTime.
Definition FrameInfo.h:578
std::string toString() const
Get the value as string.
Metrics & set(const AcquisitionTime &value)
Set AcquisitionTime.
Definition FrameInfo.h:584
Metrics & set(const ReprocessingTime &value)
Set ReprocessingTime.
Definition FrameInfo.h:622
bool operator==(const Metrics &other) const
Equality operator.
ReprocessingTime & reprocessingTime()
Get ReprocessingTime.
Definition FrameInfo.h:616
const FrameInfo::Metrics::AcquisitionTime & get() const
Definition FrameInfo.h:631
Core version.
Definition FrameInfo.h:741
std::string toString() const
Get the value as string.
bool operator>=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:809
const std::string & value() const
Get the value.
bool operator!=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:785
Core(std::string value)
Constructor.
Definition FrameInfo.h:768
bool operator==(const Core &other) const
Comparison operator.
Definition FrameInfo.h:779
Core()=default
Default constructor.
bool operator>(const Core &other) const
Comparison operator.
Definition FrameInfo.h:797
bool operator<(const Core &other) const
Comparison operator.
Definition FrameInfo.h:791
friend std::ostream & operator<<(std::ostream &stream, const Core &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:815
bool operator<=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:803
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:756
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Core.
Definition FrameInfo.h:759
The version information for installed software at the time of image capture.
Definition FrameInfo.h:721
const Core & core() const
Get Core.
Definition FrameInfo.h:934
friend std::ostream & operator<<(std::ostream &stream, const SoftwareVersion &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:990
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:975
SoftwareVersion()
Default constructor.
const FrameInfo::SoftwareVersion::Core & get() const
Definition FrameInfo.h:955
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:914
Core & core()
Get Core.
Definition FrameInfo.h:940
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:968
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:882
std::tuple< FrameInfo::SoftwareVersion::Core > Descendants
Definition FrameInfo.h:828
SoftwareVersion & set(const Core &value)
Set Core.
Definition FrameInfo.h:946
std::string toString() const
Get the value as string.
CPU model.
Definition FrameInfo.h:1049
const std::string & value() const
Get the value.
bool operator!=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1093
Model()=default
Default constructor.
bool operator<(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1099
std::string toString() const
Get the value as string.
bool operator==(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1087
bool operator>=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1117
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:1123
bool operator<=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1111
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model.
Definition FrameInfo.h:1067
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1064
Model(std::string value)
Constructor.
Definition FrameInfo.h:1076
bool operator>(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1105
CPU.
Definition FrameInfo.h:1031
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1285
const Model & model() const
Get Model.
Definition FrameInfo.h:1244
std::tuple< FrameInfo::SystemInfo::CPU::Model > Descendants
Definition FrameInfo.h:1136
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:1278
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:1300
CPU & set(const Model &value)
Set Model.
Definition FrameInfo.h:1256
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1190
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:1223
Model & model()
Get Model.
Definition FrameInfo.h:1250
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:1265
Compute device model.
Definition FrameInfo.h:1339
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model.
Definition FrameInfo.h:1357
std::string toString() const
Get the value as string.
bool operator<=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1401
Model(std::string value)
Constructor.
Definition FrameInfo.h:1366
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1354
const std::string & value() const
Get the value.
bool operator==(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1377
bool operator!=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1383
bool operator>=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1407
bool operator>(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1395
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:1413
bool operator<(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1389
Compute device vendor.
Definition FrameInfo.h:1430
bool operator>(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1486
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Vendor.
Definition FrameInfo.h:1448
friend std::ostream & operator<<(std::ostream &stream, const Vendor &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:1504
bool operator>=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1498
bool operator<(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1480
bool operator==(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1468
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1445
std::string toString() const
Get the value as string.
bool operator<=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1492
const std::string & value() const
Get the value.
bool operator!=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1474
Vendor(std::string value)
Constructor.
Definition FrameInfo.h:1457
Compute device.
Definition FrameInfo.h:1321
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1574
ComputeDevice & set(const Model &value)
Set Model.
Definition FrameInfo.h:1641
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:1698
const Vendor & vendor() const
Get Vendor.
Definition FrameInfo.h:1648
std:: tuple< FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor > Descendants
Definition FrameInfo.h:1517
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1706
Model & model()
Get Model.
Definition FrameInfo.h:1635
Vendor & vendor()
Get Vendor.
Definition FrameInfo.h:1654
bool operator==(const ComputeDevice &other) const
Equality operator.
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1679
const Model & model() const
Get Model.
Definition FrameInfo.h:1629
friend std::ostream & operator<<(std::ostream &stream, const ComputeDevice &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:1722
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:1660
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:1608
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1670
Operating system.
Definition FrameInfo.h:1744
bool operator>(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1800
OperatingSystem(std::string value)
Constructor.
Definition FrameInfo.h:1771
bool operator!=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1788
bool operator<(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1794
bool operator>=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1812
bool operator==(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1782
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1759
OperatingSystem()=default
Default constructor.
bool operator<=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1806
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:1818
std::string toString() const
Get the value as string.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for OperatingSystem.
Definition FrameInfo.h:1762
Information about the system that captured this frame.
Definition FrameInfo.h:1011
SystemInfo & set(const CPU::Model &value)
Set CPU::Model.
Definition FrameInfo.h:1977
std::string toString() const
Get the value as string.
const FrameInfo::SystemInfo::CPU & get() const
Definition FrameInfo.h:2038
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:2105
ComputeDevice & computeDevice()
Get ComputeDevice.
Definition FrameInfo.h:1990
SystemInfo & set(const ComputeDevice &value)
Set ComputeDevice.
Definition FrameInfo.h:1996
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:2072
SystemInfo & set(const CPU &value)
Set CPU.
Definition FrameInfo.h:1970
bool operator==(const SystemInfo &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1901
friend std::ostream & operator<<(std::ostream &stream, const SystemInfo &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:2131
const ComputeDevice & computeDevice() const
Get ComputeDevice.
Definition FrameInfo.h:1984
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:2114
SystemInfo & set(const ComputeDevice::Vendor &value)
Set ComputeDevice::Vendor.
Definition FrameInfo.h:2010
SystemInfo & set(const OperatingSystem &value)
Set OperatingSystem.
Definition FrameInfo.h:2029
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:1938
bool operator!=(const SystemInfo &other) const
Inequality operator.
SystemInfo & set(const ComputeDevice::Model &value)
Set ComputeDevice::Model.
Definition FrameInfo.h:2003
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition FrameInfo.h:2080
CPU & cpu()
Get CPU.
Definition FrameInfo.h:1964
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition FrameInfo.h:2054
const OperatingSystem & operatingSystem() const
Get OperatingSystem.
Definition FrameInfo.h:2017
OperatingSystem & operatingSystem()
Get OperatingSystem.
Definition FrameInfo.h:2023
SystemInfo()
Default constructor.
const CPU & cpu() const
Get CPU.
Definition FrameInfo.h:1958
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:2063
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:1831
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:2046
The time of frame capture.
Definition FrameInfo.h:2154
std::chrono::system_clock::time_point value() const
Get the value.
bool operator>(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2210
bool operator<(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2204
bool operator<=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2216
static constexpr Range< std::chrono::system_clock::time_point > validRange()
The range of valid values for TimeStamp.
Definition FrameInfo.h:2172
bool operator>=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2222
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:2228
TimeStamp()=default
Default constructor.
constexpr TimeStamp(std::chrono::system_clock::time_point value)
Constructor.
Definition FrameInfo.h:2181
bool operator!=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2198
bool operator==(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2192
std::chrono::system_clock::time_point ValueType
The type of the underlying value.
Definition FrameInfo.h:2169
Various information for a frame.
Definition FrameInfo.h:79
const FrameInfo::Metrics::ReprocessingTime & get() const
Definition FrameInfo.h:2585
TimeStamp & timeStamp()
Get TimeStamp.
Definition FrameInfo.h:2548
std::string toString() const
Get the value as string.
Metrics & metrics()
Get Metrics.
Definition FrameInfo.h:2421
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:2689
const FrameInfo::SoftwareVersion::Core & get() const
Definition FrameInfo.h:2599
const FrameInfo::Metrics & get() const
Definition FrameInfo.h:2561
const FrameInfo::Metrics::CaptureTime & get() const
Definition FrameInfo.h:2577
FrameInfo & set(const SystemInfo::ComputeDevice &value)
Set SystemInfo::ComputeDevice.
Definition FrameInfo.h:2514
FrameInfo()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:2351
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:2635
const FrameInfo::Metrics::AcquisitionTime & get() const
Definition FrameInfo.h:2569
FrameInfo & set(const SystemInfo::OperatingSystem &value)
Set SystemInfo::OperatingSystem.
Definition FrameInfo.h:2535
void save(const std::string &fileName) const
Save to the given file.
const SystemInfo & systemInfo() const
Get SystemInfo.
Definition FrameInfo.h:2481
FrameInfo & set(const Metrics::CaptureTime &value)
Set Metrics::CaptureTime.
Definition FrameInfo.h:2441
FrameInfo & set(const SystemInfo &value)
Set SystemInfo.
Definition FrameInfo.h:2493
const TimeStamp & timeStamp() const
Get TimeStamp.
Definition FrameInfo.h:2542
SoftwareVersion & softwareVersion()
Get SoftwareVersion.
Definition FrameInfo.h:2461
FrameInfo(const std::string &fileName)
Construct FrameInfo by loading from file.
std::string serialize() const
Serialize to a string.
FrameInfo & set(const SystemInfo::ComputeDevice::Vendor &value)
Set SystemInfo::ComputeDevice::Vendor.
Definition FrameInfo.h:2528
const FrameInfo::SoftwareVersion & get() const
Definition FrameInfo.h:2591
friend std::ostream & operator<<(std::ostream &stream, const FrameInfo &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:2717
FrameInfo & set(const TimeStamp &value)
Set TimeStamp.
Definition FrameInfo.h:2554
FrameInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition FrameInfo.h:2311
const FrameInfo::TimeStamp & get() const
Definition FrameInfo.h:2658
const SoftwareVersion & softwareVersion() const
Get SoftwareVersion.
Definition FrameInfo.h:2455
FrameInfo & set(const SystemInfo::CPU::Model &value)
Set SystemInfo::CPU::Model.
Definition FrameInfo.h:2507
static FrameInfo fromSerialized(const std::string &value)
Construct a new FrameInfo instance from a previously serialized string.
FrameInfo & set(const SystemInfo::ComputeDevice::Model &value)
Set SystemInfo::ComputeDevice::Model.
Definition FrameInfo.h:2521
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:2619
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:2644
FrameInfo & set(const SoftwareVersion &value)
Set SoftwareVersion.
Definition FrameInfo.h:2467
const FrameInfo::SystemInfo & get() const
Definition FrameInfo.h:2605
FrameInfo & set(const Metrics::ReprocessingTime &value)
Set Metrics::ReprocessingTime.
Definition FrameInfo.h:2448
std::tuple< FrameInfo::Metrics, FrameInfo::Metrics::AcquisitionTime, FrameInfo::Metrics::CaptureTime, FrameInfo::Metrics::ReprocessingTime, 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:2241
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition FrameInfo.h:2627
FrameInfo & set(const SoftwareVersion::Core &value)
Set SoftwareVersion::Core.
Definition FrameInfo.h:2474
SystemInfo & systemInfo()
Get SystemInfo.
Definition FrameInfo.h:2487
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:2699
FrameInfo & set(const Metrics::AcquisitionTime &value)
Set Metrics::AcquisitionTime.
Definition FrameInfo.h:2434
bool operator==(const FrameInfo &other) const
Equality operator.
FrameInfo & set(const SystemInfo::CPU &value)
Set SystemInfo::CPU.
Definition FrameInfo.h:2500
const FrameInfo::SystemInfo::CPU & get() const
Definition FrameInfo.h:2611
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:2396
FrameInfo & set(const Metrics &value)
Set Metrics.
Definition FrameInfo.h:2427
const Metrics & metrics() const
Get Metrics.
Definition FrameInfo.h:2415
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition FrameInfo.h:2652
Class describing a range of values for a given type T.
Definition Range.h:75
NodeType
Definition NodeType.h:49
Definition EnvironmentInfo.h:74
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:84