Zivid C++ API 2.14.0+e4a0c4a9-1
FrameInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2024 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <set>
53#include <sstream>
54#include <string>
55#include <tuple>
56#include <utility>
57#include <vector>
58
64#include "Zivid/Range.h"
65
66#ifdef _MSC_VER
67# pragma warning(push)
68# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
69#endif
70
71namespace Zivid
72{
73
75
76 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
78 {
79 public:
81 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
82
84 static constexpr const char *path{ "" };
85
87 static constexpr const char *name{ "FrameInfo" };
88
90 static constexpr const char *description{ R"description(Various information for a frame)description" };
91
92 static constexpr size_t version{ 4 };
93
94#ifndef NO_DOC
95 template<size_t>
96 struct Version;
97
98 using LatestVersion = Zivid::FrameInfo;
99
100 // Short identifier. This value is not guaranteed to be universally unique
101 // Todo(ZIVID-2808): Move this to internal DataModelExt header
102 static constexpr std::array<uint8_t, 3> binaryId{ 'f', 'i', 'f' };
103
104#endif
105
107
108 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
110 {
111 public:
113 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
114
116 static constexpr const char *path{ "Metrics" };
117
119 static constexpr const char *name{ "Metrics" };
120
122 static constexpr const char *description{ R"description(Metrics related to this capture.)description" };
123
129
130 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
132 {
133 public:
135 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
136
138 static constexpr const char *path{ "Metrics/AcquisitionTime" };
139
141 static constexpr const char *name{ "AcquisitionTime" };
142
144 static constexpr const char *description{
145 R"description(Acquisition Time is the duration from the start of the capture to when the camera has acquired the
146last image. After this time, the camera has finished its acquisition and you can move the robot,
147or capture with another camera with overlapping field of view. Acquisition Time is equal to the
148time it takes for the Camera::capture(settings) API function call to return.
149)description"
150 };
151
153 using ValueType = std::chrono::microseconds;
154
157 {
158 return { std::chrono::microseconds::min(), std::chrono::microseconds::max() };
159 }
160
162 AcquisitionTime() = default;
163
165 explicit constexpr AcquisitionTime(std::chrono::microseconds value)
166 : m_value{ value }
167 {}
168
170 std::chrono::microseconds value() const;
171
173 std::string toString() const;
174
176 bool operator==(const AcquisitionTime &other) const
177 {
178 return m_value == other.m_value;
179 }
180
182 bool operator!=(const AcquisitionTime &other) const
183 {
184 return m_value != other.m_value;
185 }
186
188 bool operator<(const AcquisitionTime &other) const
189 {
190 return m_value < other.m_value;
191 }
192
194 bool operator>(const AcquisitionTime &other) const
195 {
196 return m_value > other.m_value;
197 }
198
200 bool operator<=(const AcquisitionTime &other) const
201 {
202 return m_value <= other.m_value;
203 }
204
206 bool operator>=(const AcquisitionTime &other) const
207 {
208 return m_value >= other.m_value;
209 }
210
212 friend std::ostream &operator<<(std::ostream &stream, const AcquisitionTime &value)
213 {
214 return stream << value.toString();
215 }
216
217 private:
218 void setFromString(const std::string &value);
219
220 std::chrono::microseconds m_value{ -1 };
221
222 friend struct DataModel::Detail::Befriend<AcquisitionTime>;
223 };
224
229
230 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
232 {
233 public:
235 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
236
238 static constexpr const char *path{ "Metrics/CaptureTime" };
239
241 static constexpr const char *name{ "CaptureTime" };
242
244 static constexpr const char *description{
245 R"description(Capture Time is the duration from the start of the capture to when all of the data transfer and
246processing has completed. After this time the 3D point cloud and/or 2D color image is ready and
247available on the GPU memory, and can be copied to the system memory (RAM).
248)description"
249 };
250
252 using ValueType = std::chrono::microseconds;
253
256 {
257 return { std::chrono::microseconds::min(), std::chrono::microseconds::max() };
258 }
259
261 CaptureTime() = default;
262
264 explicit constexpr CaptureTime(std::chrono::microseconds value)
265 : m_value{ value }
266 {}
267
269 std::chrono::microseconds value() const;
270
272 std::string toString() const;
273
275 bool operator==(const CaptureTime &other) const
276 {
277 return m_value == other.m_value;
278 }
279
281 bool operator!=(const CaptureTime &other) const
282 {
283 return m_value != other.m_value;
284 }
285
287 bool operator<(const CaptureTime &other) const
288 {
289 return m_value < other.m_value;
290 }
291
293 bool operator>(const CaptureTime &other) const
294 {
295 return m_value > other.m_value;
296 }
297
299 bool operator<=(const CaptureTime &other) const
300 {
301 return m_value <= other.m_value;
302 }
303
305 bool operator>=(const CaptureTime &other) const
306 {
307 return m_value >= other.m_value;
308 }
309
311 friend std::ostream &operator<<(std::ostream &stream, const CaptureTime &value)
312 {
313 return stream << value.toString();
314 }
315
316 private:
317 void setFromString(const std::string &value);
318
319 std::chrono::microseconds m_value{ -1 };
320
321 friend struct DataModel::Detail::Befriend<CaptureTime>;
322 };
323
324 using Descendants = std::tuple<FrameInfo::Metrics::AcquisitionTime, FrameInfo::Metrics::CaptureTime>;
325
328
341#ifndef NO_DOC
342 template<
343 typename... Args,
344 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
345 typename std::enable_if<
346 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
347 value,
348 int>::type = 0>
349#else
350 template<typename... Args>
351#endif
352 explicit Metrics(Args &&...args)
353 {
354 using namespace Zivid::Detail::TypeTraits;
355
356 static_assert(
357 AllArgsDecayedAreUnique<Args...>::value,
358 "Found duplicate types among the arguments passed to Metrics(...). "
359 "Types should be listed at most once.");
360
361 set(std::forward<Args>(args)...);
362 }
363
375#ifndef NO_DOC
376 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
377#else
378 template<typename... Args>
379#endif
380 void set(Args &&...args)
381 {
382 using namespace Zivid::Detail::TypeTraits;
383
384 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
385 static_assert(
386 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
387
388 static_assert(
389 AllArgsDecayedAreUnique<Args...>::value,
390 "Found duplicate types among the arguments passed to set(...). "
391 "Types should be listed at most once.");
392
393 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
394 }
395
408#ifndef NO_DOC
409 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
410#else
411 template<typename... Args>
412#endif
413 Metrics copyWith(Args &&...args) const
414 {
415 using namespace Zivid::Detail::TypeTraits;
416
417 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
418 static_assert(
419 AllArgsAreDescendantNodes::value,
420 "All arguments passed to copyWith(...) must be descendant nodes.");
421
422 static_assert(
423 AllArgsDecayedAreUnique<Args...>::value,
424 "Found duplicate types among the arguments passed to copyWith(...). "
425 "Types should be listed at most once.");
426
427 auto copy{ *this };
428 copy.set(std::forward<Args>(args)...);
429 return copy;
430 }
431
434 {
435 return m_acquisitionTime;
436 }
437
440 {
441 return m_acquisitionTime;
442 }
443
446 {
447 m_acquisitionTime = value;
448 return *this;
449 }
450
453 {
454 return m_captureTime;
455 }
456
459 {
460 return m_captureTime;
461 }
462
464 Metrics &set(const CaptureTime &value)
465 {
466 m_captureTime = value;
467 return *this;
468 }
469
470 template<
471 typename T,
472 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::AcquisitionTime>::value, int>::type = 0>
474 {
475 return m_acquisitionTime;
476 }
477
478 template<
479 typename T,
480 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::CaptureTime>::value, int>::type = 0>
482 {
483 return m_captureTime;
484 }
485
486 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
488 {
489 return m_acquisitionTime;
490 }
491
492 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
494 {
495 return m_captureTime;
496 }
497
499 template<typename F>
500 void forEach(const F &f) const
501 {
502 f(m_acquisitionTime);
503 f(m_captureTime);
504 }
505
507 template<typename F>
508 void forEach(const F &f)
509 {
510 f(m_acquisitionTime);
511 f(m_captureTime);
512 }
513
515 bool operator==(const Metrics &other) const;
516
518 bool operator!=(const Metrics &other) const;
519
521 std::string toString() const;
522
524 friend std::ostream &operator<<(std::ostream &stream, const Metrics &value)
525 {
526 return stream << value.toString();
527 }
528
529 private:
530 void setFromString(const std::string &value);
531
532 void setFromString(const std::string &fullPath, const std::string &value);
533
534 std::string getString(const std::string &fullPath) const;
535
536 AcquisitionTime m_acquisitionTime;
537 CaptureTime m_captureTime;
538
539 friend struct DataModel::Detail::Befriend<Metrics>;
540 };
541
543
544 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
546 {
547 public:
549 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
550
552 static constexpr const char *path{ "SoftwareVersion" };
553
555 static constexpr const char *name{ "SoftwareVersion" };
556
558 static constexpr const char *description{
559 R"description(The version information for installed software at the time of image capture)description"
560 };
561
563
564 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
566 {
567 public:
569 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
570
572 static constexpr const char *path{ "SoftwareVersion/Core" };
573
575 static constexpr const char *name{ "Core" };
576
578 static constexpr const char *description{ R"description(Core version)description" };
579
581 using ValueType = std::string;
582
585 {
586 return { 0, std::numeric_limits<ValueType::size_type>::max() };
587 }
588
590 Core() = default;
591
593 explicit Core(std::string value)
594 : m_value{ std::move(value) }
595 {}
596
598 const std::string &value() const;
599
601 std::string toString() const;
602
604 bool operator==(const Core &other) const
605 {
606 return m_value == other.m_value;
607 }
608
610 bool operator!=(const Core &other) const
611 {
612 return m_value != other.m_value;
613 }
614
616 bool operator<(const Core &other) const
617 {
618 return m_value < other.m_value;
619 }
620
622 bool operator>(const Core &other) const
623 {
624 return m_value > other.m_value;
625 }
626
628 bool operator<=(const Core &other) const
629 {
630 return m_value <= other.m_value;
631 }
632
634 bool operator>=(const Core &other) const
635 {
636 return m_value >= other.m_value;
637 }
638
640 friend std::ostream &operator<<(std::ostream &stream, const Core &value)
641 {
642 return stream << value.toString();
643 }
644
645 private:
646 void setFromString(const std::string &value);
647
648 std::string m_value{ "No-version" };
649
650 friend struct DataModel::Detail::Befriend<Core>;
651 };
652
653 using Descendants = std::tuple<FrameInfo::SoftwareVersion::Core>;
654
657
669#ifndef NO_DOC
670 template<
671 typename... Args,
672 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
673 typename std::enable_if<
674 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
675 value,
676 int>::type = 0>
677#else
678 template<typename... Args>
679#endif
680 explicit SoftwareVersion(Args &&...args)
681 {
682 using namespace Zivid::Detail::TypeTraits;
683
684 static_assert(
685 AllArgsDecayedAreUnique<Args...>::value,
686 "Found duplicate types among the arguments passed to SoftwareVersion(...). "
687 "Types should be listed at most once.");
688
689 set(std::forward<Args>(args)...);
690 }
691
702#ifndef NO_DOC
703 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
704#else
705 template<typename... Args>
706#endif
707 void set(Args &&...args)
708 {
709 using namespace Zivid::Detail::TypeTraits;
710
711 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
712 static_assert(
713 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
714
715 static_assert(
716 AllArgsDecayedAreUnique<Args...>::value,
717 "Found duplicate types among the arguments passed to set(...). "
718 "Types should be listed at most once.");
719
720 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
721 }
722
734#ifndef NO_DOC
735 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
736#else
737 template<typename... Args>
738#endif
739 SoftwareVersion copyWith(Args &&...args) const
740 {
741 using namespace Zivid::Detail::TypeTraits;
742
743 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
744 static_assert(
745 AllArgsAreDescendantNodes::value,
746 "All arguments passed to copyWith(...) must be descendant nodes.");
747
748 static_assert(
749 AllArgsDecayedAreUnique<Args...>::value,
750 "Found duplicate types among the arguments passed to copyWith(...). "
751 "Types should be listed at most once.");
752
753 auto copy{ *this };
754 copy.set(std::forward<Args>(args)...);
755 return copy;
756 }
757
759 const Core &core() const
760 {
761 return m_core;
762 }
763
766 {
767 return m_core;
768 }
769
771 SoftwareVersion &set(const Core &value)
772 {
773 m_core = value;
774 return *this;
775 }
776
777 template<
778 typename T,
779 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
781 {
782 return m_core;
783 }
784
785 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
787 {
788 return m_core;
789 }
790
792 template<typename F>
793 void forEach(const F &f) const
794 {
795 f(m_core);
796 }
797
799 template<typename F>
800 void forEach(const F &f)
801 {
802 f(m_core);
803 }
804
806 bool operator==(const SoftwareVersion &other) const;
807
809 bool operator!=(const SoftwareVersion &other) const;
810
812 std::string toString() const;
813
815 friend std::ostream &operator<<(std::ostream &stream, const SoftwareVersion &value)
816 {
817 return stream << value.toString();
818 }
819
820 private:
821 void setFromString(const std::string &value);
822
823 void setFromString(const std::string &fullPath, const std::string &value);
824
825 std::string getString(const std::string &fullPath) const;
826
827 Core m_core;
828
829 friend struct DataModel::Detail::Befriend<SoftwareVersion>;
830 };
831
833
834 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
836 {
837 public:
839 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
840
842 static constexpr const char *path{ "SystemInfo" };
843
845 static constexpr const char *name{ "SystemInfo" };
846
848 static constexpr const char *description{
849 R"description(Information about the system that captured this frame)description"
850 };
851
853
854 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
856 {
857 public:
859 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
860
862 static constexpr const char *path{ "SystemInfo/CPU" };
863
865 static constexpr const char *name{ "CPU" };
866
868 static constexpr const char *description{ R"description(CPU)description" };
869
871
872 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
874 {
875 public:
877 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
878
880 static constexpr const char *path{ "SystemInfo/CPU/Model" };
881
883 static constexpr const char *name{ "Model" };
884
886 static constexpr const char *description{ R"description(CPU model)description" };
887
889 using ValueType = std::string;
890
893 {
894 return { 0, std::numeric_limits<ValueType::size_type>::max() };
895 }
896
898 Model() = default;
899
901 explicit Model(std::string value)
902 : m_value{ std::move(value) }
903 {}
904
906 const std::string &value() const;
907
909 std::string toString() const;
910
912 bool operator==(const Model &other) const
913 {
914 return m_value == other.m_value;
915 }
916
918 bool operator!=(const Model &other) const
919 {
920 return m_value != other.m_value;
921 }
922
924 bool operator<(const Model &other) const
925 {
926 return m_value < other.m_value;
927 }
928
930 bool operator>(const Model &other) const
931 {
932 return m_value > other.m_value;
933 }
934
936 bool operator<=(const Model &other) const
937 {
938 return m_value <= other.m_value;
939 }
940
942 bool operator>=(const Model &other) const
943 {
944 return m_value >= other.m_value;
945 }
946
948 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
949 {
950 return stream << value.toString();
951 }
952
953 private:
954 void setFromString(const std::string &value);
955
956 std::string m_value{};
957
958 friend struct DataModel::Detail::Befriend<Model>;
959 };
960
961 using Descendants = std::tuple<FrameInfo::SystemInfo::CPU::Model>;
962
965
977#ifndef NO_DOC
978 template<
979 typename... Args,
980 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
981 typename std::enable_if<
982 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
983 value,
984 int>::type = 0>
985#else
986 template<typename... Args>
987#endif
988 explicit CPU(Args &&...args)
989 {
990 using namespace Zivid::Detail::TypeTraits;
991
992 static_assert(
993 AllArgsDecayedAreUnique<Args...>::value,
994 "Found duplicate types among the arguments passed to CPU(...). "
995 "Types should be listed at most once.");
996
997 set(std::forward<Args>(args)...);
998 }
999
1010#ifndef NO_DOC
1011 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1012#else
1013 template<typename... Args>
1014#endif
1015 void set(Args &&...args)
1016 {
1017 using namespace Zivid::Detail::TypeTraits;
1018
1019 using AllArgsAreDescendantNodes =
1020 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1021 static_assert(
1022 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1023
1024 static_assert(
1025 AllArgsDecayedAreUnique<Args...>::value,
1026 "Found duplicate types among the arguments passed to set(...). "
1027 "Types should be listed at most once.");
1028
1029 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1030 }
1031
1043#ifndef NO_DOC
1044 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1045#else
1046 template<typename... Args>
1047#endif
1048 CPU copyWith(Args &&...args) const
1049 {
1050 using namespace Zivid::Detail::TypeTraits;
1051
1052 using AllArgsAreDescendantNodes =
1053 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1054 static_assert(
1055 AllArgsAreDescendantNodes::value,
1056 "All arguments passed to copyWith(...) must be descendant nodes.");
1057
1058 static_assert(
1059 AllArgsDecayedAreUnique<Args...>::value,
1060 "Found duplicate types among the arguments passed to copyWith(...). "
1061 "Types should be listed at most once.");
1062
1063 auto copy{ *this };
1064 copy.set(std::forward<Args>(args)...);
1065 return copy;
1066 }
1067
1069 const Model &model() const
1070 {
1071 return m_model;
1072 }
1073
1076 {
1077 return m_model;
1078 }
1079
1081 CPU &set(const Model &value)
1082 {
1083 m_model = value;
1084 return *this;
1085 }
1086
1087 template<
1088 typename T,
1089 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1091 {
1092 return m_model;
1093 }
1094
1095 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1097 {
1098 return m_model;
1099 }
1100
1102 template<typename F>
1103 void forEach(const F &f) const
1104 {
1105 f(m_model);
1106 }
1107
1109 template<typename F>
1110 void forEach(const F &f)
1111 {
1112 f(m_model);
1113 }
1114
1116 bool operator==(const CPU &other) const;
1117
1119 bool operator!=(const CPU &other) const;
1120
1122 std::string toString() const;
1123
1125 friend std::ostream &operator<<(std::ostream &stream, const CPU &value)
1126 {
1127 return stream << value.toString();
1128 }
1129
1130 private:
1131 void setFromString(const std::string &value);
1132
1133 void setFromString(const std::string &fullPath, const std::string &value);
1134
1135 std::string getString(const std::string &fullPath) const;
1136
1137 Model m_model;
1138
1139 friend struct DataModel::Detail::Befriend<CPU>;
1140 };
1141
1143
1144 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1146 {
1147 public:
1149 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1150
1152 static constexpr const char *path{ "SystemInfo/ComputeDevice" };
1153
1155 static constexpr const char *name{ "ComputeDevice" };
1156
1158 static constexpr const char *description{ R"description(Compute device)description" };
1159
1161
1162 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1164 {
1165 public:
1167 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1168
1170 static constexpr const char *path{ "SystemInfo/ComputeDevice/Model" };
1171
1173 static constexpr const char *name{ "Model" };
1174
1176 static constexpr const char *description{ R"description(Compute device model)description" };
1177
1179 using ValueType = std::string;
1180
1183 {
1184 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1185 }
1186
1188 Model() = default;
1189
1191 explicit Model(std::string value)
1192 : m_value{ std::move(value) }
1193 {}
1194
1196 const std::string &value() const;
1197
1199 std::string toString() const;
1200
1202 bool operator==(const Model &other) const
1203 {
1204 return m_value == other.m_value;
1205 }
1206
1208 bool operator!=(const Model &other) const
1209 {
1210 return m_value != other.m_value;
1211 }
1212
1214 bool operator<(const Model &other) const
1215 {
1216 return m_value < other.m_value;
1217 }
1218
1220 bool operator>(const Model &other) const
1221 {
1222 return m_value > other.m_value;
1223 }
1224
1226 bool operator<=(const Model &other) const
1227 {
1228 return m_value <= other.m_value;
1229 }
1230
1232 bool operator>=(const Model &other) const
1233 {
1234 return m_value >= other.m_value;
1235 }
1236
1238 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
1239 {
1240 return stream << value.toString();
1241 }
1242
1243 private:
1244 void setFromString(const std::string &value);
1245
1246 std::string m_value{};
1247
1248 friend struct DataModel::Detail::Befriend<Model>;
1249 };
1250
1252
1253 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1255 {
1256 public:
1258 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1259
1261 static constexpr const char *path{ "SystemInfo/ComputeDevice/Vendor" };
1262
1264 static constexpr const char *name{ "Vendor" };
1265
1267 static constexpr const char *description{ R"description(Compute device vendor)description" };
1268
1270 using ValueType = std::string;
1271
1274 {
1275 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1276 }
1277
1279 Vendor() = default;
1280
1282 explicit Vendor(std::string value)
1283 : m_value{ std::move(value) }
1284 {}
1285
1287 const std::string &value() const;
1288
1290 std::string toString() const;
1291
1293 bool operator==(const Vendor &other) const
1294 {
1295 return m_value == other.m_value;
1296 }
1297
1299 bool operator!=(const Vendor &other) const
1300 {
1301 return m_value != other.m_value;
1302 }
1303
1305 bool operator<(const Vendor &other) const
1306 {
1307 return m_value < other.m_value;
1308 }
1309
1311 bool operator>(const Vendor &other) const
1312 {
1313 return m_value > other.m_value;
1314 }
1315
1317 bool operator<=(const Vendor &other) const
1318 {
1319 return m_value <= other.m_value;
1320 }
1321
1323 bool operator>=(const Vendor &other) const
1324 {
1325 return m_value >= other.m_value;
1326 }
1327
1329 friend std::ostream &operator<<(std::ostream &stream, const Vendor &value)
1330 {
1331 return stream << value.toString();
1332 }
1333
1334 private:
1335 void setFromString(const std::string &value);
1336
1337 std::string m_value{};
1338
1339 friend struct DataModel::Detail::Befriend<Vendor>;
1340 };
1341
1342 using Descendants = std::
1343 tuple<FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor>;
1344
1347
1360#ifndef NO_DOC
1361 template<
1362 typename... Args,
1363 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1364 typename std::enable_if<
1365 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1366 value,
1367 int>::type = 0>
1368#else
1369 template<typename... Args>
1370#endif
1371 explicit ComputeDevice(Args &&...args)
1372 {
1373 using namespace Zivid::Detail::TypeTraits;
1374
1375 static_assert(
1376 AllArgsDecayedAreUnique<Args...>::value,
1377 "Found duplicate types among the arguments passed to ComputeDevice(...). "
1378 "Types should be listed at most once.");
1379
1380 set(std::forward<Args>(args)...);
1381 }
1382
1394#ifndef NO_DOC
1395 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1396#else
1397 template<typename... Args>
1398#endif
1399 void set(Args &&...args)
1400 {
1401 using namespace Zivid::Detail::TypeTraits;
1402
1403 using AllArgsAreDescendantNodes =
1404 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1405 static_assert(
1406 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1407
1408 static_assert(
1409 AllArgsDecayedAreUnique<Args...>::value,
1410 "Found duplicate types among the arguments passed to set(...). "
1411 "Types should be listed at most once.");
1412
1413 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1414 }
1415
1428#ifndef NO_DOC
1429 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1430#else
1431 template<typename... Args>
1432#endif
1433 ComputeDevice copyWith(Args &&...args) const
1434 {
1435 using namespace Zivid::Detail::TypeTraits;
1436
1437 using AllArgsAreDescendantNodes =
1438 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1439 static_assert(
1440 AllArgsAreDescendantNodes::value,
1441 "All arguments passed to copyWith(...) must be descendant nodes.");
1442
1443 static_assert(
1444 AllArgsDecayedAreUnique<Args...>::value,
1445 "Found duplicate types among the arguments passed to copyWith(...). "
1446 "Types should be listed at most once.");
1447
1448 auto copy{ *this };
1449 copy.set(std::forward<Args>(args)...);
1450 return copy;
1451 }
1452
1454 const Model &model() const
1455 {
1456 return m_model;
1457 }
1458
1461 {
1462 return m_model;
1463 }
1464
1466 ComputeDevice &set(const Model &value)
1467 {
1468 m_model = value;
1469 return *this;
1470 }
1471
1473 const Vendor &vendor() const
1474 {
1475 return m_vendor;
1476 }
1477
1480 {
1481 return m_vendor;
1482 }
1483
1485 ComputeDevice &set(const Vendor &value)
1486 {
1487 m_vendor = value;
1488 return *this;
1489 }
1490
1491 template<
1492 typename T,
1493 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1494 type = 0>
1496 {
1497 return m_model;
1498 }
1499
1500 template<
1501 typename T,
1502 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1503 type = 0>
1505 {
1506 return m_vendor;
1507 }
1508
1509 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1511 {
1512 return m_model;
1513 }
1514
1515 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1517 {
1518 return m_vendor;
1519 }
1520
1522 template<typename F>
1523 void forEach(const F &f) const
1524 {
1525 f(m_model);
1526 f(m_vendor);
1527 }
1528
1530 template<typename F>
1531 void forEach(const F &f)
1532 {
1533 f(m_model);
1534 f(m_vendor);
1535 }
1536
1538 bool operator==(const ComputeDevice &other) const;
1539
1541 bool operator!=(const ComputeDevice &other) const;
1542
1544 std::string toString() const;
1545
1547 friend std::ostream &operator<<(std::ostream &stream, const ComputeDevice &value)
1548 {
1549 return stream << value.toString();
1550 }
1551
1552 private:
1553 void setFromString(const std::string &value);
1554
1555 void setFromString(const std::string &fullPath, const std::string &value);
1556
1557 std::string getString(const std::string &fullPath) const;
1558
1559 Model m_model;
1560 Vendor m_vendor;
1561
1562 friend struct DataModel::Detail::Befriend<ComputeDevice>;
1563 };
1564
1566
1567 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1569 {
1570 public:
1572 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1573
1575 static constexpr const char *path{ "SystemInfo/OperatingSystem" };
1576
1578 static constexpr const char *name{ "OperatingSystem" };
1579
1581 static constexpr const char *description{ R"description(Operating system)description" };
1582
1584 using ValueType = std::string;
1585
1588 {
1589 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1590 }
1591
1593 OperatingSystem() = default;
1594
1596 explicit OperatingSystem(std::string value)
1597 : m_value{ std::move(value) }
1598 {}
1599
1601 const std::string &value() const;
1602
1604 std::string toString() const;
1605
1607 bool operator==(const OperatingSystem &other) const
1608 {
1609 return m_value == other.m_value;
1610 }
1611
1613 bool operator!=(const OperatingSystem &other) const
1614 {
1615 return m_value != other.m_value;
1616 }
1617
1619 bool operator<(const OperatingSystem &other) const
1620 {
1621 return m_value < other.m_value;
1622 }
1623
1625 bool operator>(const OperatingSystem &other) const
1626 {
1627 return m_value > other.m_value;
1628 }
1629
1631 bool operator<=(const OperatingSystem &other) const
1632 {
1633 return m_value <= other.m_value;
1634 }
1635
1637 bool operator>=(const OperatingSystem &other) const
1638 {
1639 return m_value >= other.m_value;
1640 }
1641
1643 friend std::ostream &operator<<(std::ostream &stream, const OperatingSystem &value)
1644 {
1645 return stream << value.toString();
1646 }
1647
1648 private:
1649 void setFromString(const std::string &value);
1650
1651 std::string m_value{};
1652
1653 friend struct DataModel::Detail::Befriend<OperatingSystem>;
1654 };
1655
1656 using Descendants = std::tuple<
1663
1666
1683#ifndef NO_DOC
1684 template<
1685 typename... Args,
1686 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1687 typename std::enable_if<
1688 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1689 value,
1690 int>::type = 0>
1691#else
1692 template<typename... Args>
1693#endif
1694 explicit SystemInfo(Args &&...args)
1695 {
1696 using namespace Zivid::Detail::TypeTraits;
1697
1698 static_assert(
1699 AllArgsDecayedAreUnique<Args...>::value,
1700 "Found duplicate types among the arguments passed to SystemInfo(...). "
1701 "Types should be listed at most once.");
1702
1703 set(std::forward<Args>(args)...);
1704 }
1705
1721#ifndef NO_DOC
1722 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1723#else
1724 template<typename... Args>
1725#endif
1726 void set(Args &&...args)
1727 {
1728 using namespace Zivid::Detail::TypeTraits;
1729
1730 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1731 static_assert(
1732 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1733
1734 static_assert(
1735 AllArgsDecayedAreUnique<Args...>::value,
1736 "Found duplicate types among the arguments passed to set(...). "
1737 "Types should be listed at most once.");
1738
1739 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1740 }
1741
1758#ifndef NO_DOC
1759 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1760#else
1761 template<typename... Args>
1762#endif
1763 SystemInfo copyWith(Args &&...args) const
1764 {
1765 using namespace Zivid::Detail::TypeTraits;
1766
1767 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1768 static_assert(
1769 AllArgsAreDescendantNodes::value,
1770 "All arguments passed to copyWith(...) must be descendant nodes.");
1771
1772 static_assert(
1773 AllArgsDecayedAreUnique<Args...>::value,
1774 "Found duplicate types among the arguments passed to copyWith(...). "
1775 "Types should be listed at most once.");
1776
1777 auto copy{ *this };
1778 copy.set(std::forward<Args>(args)...);
1779 return copy;
1780 }
1781
1783 const CPU &cpu() const
1784 {
1785 return m_cpu;
1786 }
1787
1790 {
1791 return m_cpu;
1792 }
1793
1795 SystemInfo &set(const CPU &value)
1796 {
1797 m_cpu = value;
1798 return *this;
1799 }
1800
1803 {
1804 m_cpu.set(value);
1805 return *this;
1806 }
1807
1810 {
1811 return m_computeDevice;
1812 }
1813
1816 {
1817 return m_computeDevice;
1818 }
1819
1822 {
1823 m_computeDevice = value;
1824 return *this;
1825 }
1826
1829 {
1830 m_computeDevice.set(value);
1831 return *this;
1832 }
1833
1836 {
1837 m_computeDevice.set(value);
1838 return *this;
1839 }
1840
1843 {
1844 return m_operatingSystem;
1845 }
1846
1849 {
1850 return m_operatingSystem;
1851 }
1852
1855 {
1856 m_operatingSystem = value;
1857 return *this;
1858 }
1859
1860 template<
1861 typename T,
1862 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1864 {
1865 return m_cpu;
1866 }
1867
1868 template<
1869 typename T,
1870 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1872 {
1873 return m_cpu.get<FrameInfo::SystemInfo::CPU::Model>();
1874 }
1875
1876 template<
1877 typename T,
1878 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1880 {
1881 return m_computeDevice;
1882 }
1883
1884 template<
1885 typename T,
1886 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1887 type = 0>
1889 {
1890 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1891 }
1892
1893 template<
1894 typename T,
1895 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1896 type = 0>
1898 {
1899 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1900 }
1901
1902 template<
1903 typename T,
1904 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1906 {
1907 return m_operatingSystem;
1908 }
1909
1910 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1912 {
1913 return m_cpu;
1914 }
1915
1916 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1918 {
1919 return m_computeDevice;
1920 }
1921
1922 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1924 {
1925 return m_operatingSystem;
1926 }
1927
1929 template<typename F>
1930 void forEach(const F &f) const
1931 {
1932 f(m_cpu);
1933 f(m_computeDevice);
1934 f(m_operatingSystem);
1935 }
1936
1938 template<typename F>
1939 void forEach(const F &f)
1940 {
1941 f(m_cpu);
1942 f(m_computeDevice);
1943 f(m_operatingSystem);
1944 }
1945
1947 bool operator==(const SystemInfo &other) const;
1948
1950 bool operator!=(const SystemInfo &other) const;
1951
1953 std::string toString() const;
1954
1956 friend std::ostream &operator<<(std::ostream &stream, const SystemInfo &value)
1957 {
1958 return stream << value.toString();
1959 }
1960
1961 private:
1962 void setFromString(const std::string &value);
1963
1964 void setFromString(const std::string &fullPath, const std::string &value);
1965
1966 std::string getString(const std::string &fullPath) const;
1967
1968 CPU m_cpu;
1969 ComputeDevice m_computeDevice;
1970 OperatingSystem m_operatingSystem;
1971
1972 friend struct DataModel::Detail::Befriend<SystemInfo>;
1973 };
1974
1976
1977 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1979 {
1980 public:
1982 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1983
1985 static constexpr const char *path{ "TimeStamp" };
1986
1988 static constexpr const char *name{ "TimeStamp" };
1989
1991 static constexpr const char *description{ R"description(The time of frame capture)description" };
1992
1994 using ValueType = std::chrono::system_clock::time_point;
1995
1998 {
1999 return { std::chrono::system_clock::time_point::min(), std::chrono::system_clock::time_point::max() };
2000 }
2001
2003 TimeStamp() = default;
2004
2006 explicit constexpr TimeStamp(std::chrono::system_clock::time_point value)
2007 : m_value{ value }
2008 {}
2009
2011 std::chrono::system_clock::time_point value() const;
2012
2014 std::string toString() const;
2015
2017 bool operator==(const TimeStamp &other) const
2018 {
2019 return m_value == other.m_value;
2020 }
2021
2023 bool operator!=(const TimeStamp &other) const
2024 {
2025 return m_value != other.m_value;
2026 }
2027
2029 bool operator<(const TimeStamp &other) const
2030 {
2031 return m_value < other.m_value;
2032 }
2033
2035 bool operator>(const TimeStamp &other) const
2036 {
2037 return m_value > other.m_value;
2038 }
2039
2041 bool operator<=(const TimeStamp &other) const
2042 {
2043 return m_value <= other.m_value;
2044 }
2045
2047 bool operator>=(const TimeStamp &other) const
2048 {
2049 return m_value >= other.m_value;
2050 }
2051
2053 friend std::ostream &operator<<(std::ostream &stream, const TimeStamp &value)
2054 {
2055 return stream << value.toString();
2056 }
2057
2058 private:
2059 void setFromString(const std::string &value);
2060
2061 std::chrono::system_clock::time_point m_value{};
2062
2063 friend struct DataModel::Detail::Befriend<TimeStamp>;
2064 };
2065
2066 using Descendants = std::tuple<
2080
2083
2085 explicit FrameInfo(const std::string &fileName);
2086
2092 [[nodiscard]] static FrameInfo fromSerialized(const std::string &value);
2093
2099 std::string serialize() const;
2100
2124#ifndef NO_DOC
2125 template<
2126 typename... Args,
2127 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2128 typename std::enable_if<
2129 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2130 int>::type = 0>
2131#else
2132 template<typename... Args>
2133#endif
2134 explicit FrameInfo(Args &&...args)
2135 {
2136 using namespace Zivid::Detail::TypeTraits;
2137
2138 static_assert(
2139 AllArgsDecayedAreUnique<Args...>::value,
2140 "Found duplicate types among the arguments passed to FrameInfo(...). "
2141 "Types should be listed at most once.");
2142
2143 set(std::forward<Args>(args)...);
2144 }
2145
2168#ifndef NO_DOC
2169 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2170#else
2171 template<typename... Args>
2172#endif
2173 void set(Args &&...args)
2174 {
2175 using namespace Zivid::Detail::TypeTraits;
2176
2177 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2178 static_assert(
2179 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2180
2181 static_assert(
2182 AllArgsDecayedAreUnique<Args...>::value,
2183 "Found duplicate types among the arguments passed to set(...). "
2184 "Types should be listed at most once.");
2185
2186 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2187 }
2188
2212#ifndef NO_DOC
2213 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2214#else
2215 template<typename... Args>
2216#endif
2217 FrameInfo copyWith(Args &&...args) const
2218 {
2219 using namespace Zivid::Detail::TypeTraits;
2220
2221 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2222 static_assert(
2223 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
2224
2225 static_assert(
2226 AllArgsDecayedAreUnique<Args...>::value,
2227 "Found duplicate types among the arguments passed to copyWith(...). "
2228 "Types should be listed at most once.");
2229
2230 auto copy{ *this };
2231 copy.set(std::forward<Args>(args)...);
2232 return copy;
2233 }
2234
2236 const Metrics &metrics() const
2237 {
2238 return m_metrics;
2239 }
2240
2243 {
2244 return m_metrics;
2245 }
2246
2248 FrameInfo &set(const Metrics &value)
2249 {
2250 m_metrics = value;
2251 return *this;
2252 }
2253
2256 {
2257 m_metrics.set(value);
2258 return *this;
2259 }
2260
2263 {
2264 m_metrics.set(value);
2265 return *this;
2266 }
2267
2270 {
2271 return m_softwareVersion;
2272 }
2273
2276 {
2277 return m_softwareVersion;
2278 }
2279
2282 {
2283 m_softwareVersion = value;
2284 return *this;
2285 }
2286
2289 {
2290 m_softwareVersion.set(value);
2291 return *this;
2292 }
2293
2295 const SystemInfo &systemInfo() const
2296 {
2297 return m_systemInfo;
2298 }
2299
2302 {
2303 return m_systemInfo;
2304 }
2305
2307 FrameInfo &set(const SystemInfo &value)
2308 {
2309 m_systemInfo = value;
2310 return *this;
2311 }
2312
2315 {
2316 m_systemInfo.set(value);
2317 return *this;
2318 }
2319
2322 {
2323 m_systemInfo.set(value);
2324 return *this;
2325 }
2326
2329 {
2330 m_systemInfo.set(value);
2331 return *this;
2332 }
2333
2336 {
2337 m_systemInfo.set(value);
2338 return *this;
2339 }
2340
2343 {
2344 m_systemInfo.set(value);
2345 return *this;
2346 }
2347
2350 {
2351 m_systemInfo.set(value);
2352 return *this;
2353 }
2354
2356 const TimeStamp &timeStamp() const
2357 {
2358 return m_timeStamp;
2359 }
2360
2363 {
2364 return m_timeStamp;
2365 }
2366
2368 FrameInfo &set(const TimeStamp &value)
2369 {
2370 m_timeStamp = value;
2371 return *this;
2372 }
2373
2374 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::Metrics>::value, int>::type = 0>
2376 {
2377 return m_metrics;
2378 }
2379
2380 template<
2381 typename T,
2382 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::AcquisitionTime>::value, int>::type = 0>
2384 {
2385 return m_metrics.get<FrameInfo::Metrics::AcquisitionTime>();
2386 }
2387
2388 template<
2389 typename T,
2390 typename std::enable_if<std::is_same<T, FrameInfo::Metrics::CaptureTime>::value, int>::type = 0>
2392 {
2393 return m_metrics.get<FrameInfo::Metrics::CaptureTime>();
2394 }
2395
2396 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion>::value, int>::type = 0>
2398 {
2399 return m_softwareVersion;
2400 }
2401
2402 template<
2403 typename T,
2404 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
2406 {
2407 return m_softwareVersion.get<FrameInfo::SoftwareVersion::Core>();
2408 }
2409
2410 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo>::value, int>::type = 0>
2412 {
2413 return m_systemInfo;
2414 }
2415
2416 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
2418 {
2419 return m_systemInfo.get<FrameInfo::SystemInfo::CPU>();
2420 }
2421
2422 template<
2423 typename T,
2424 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
2426 {
2427 return m_systemInfo.get<FrameInfo::SystemInfo::CPU::Model>();
2428 }
2429
2430 template<
2431 typename T,
2432 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
2434 {
2435 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice>();
2436 }
2437
2438 template<
2439 typename T,
2440 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::type = 0>
2442 {
2443 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
2444 }
2445
2446 template<
2447 typename T,
2448 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::type =
2449 0>
2451 {
2452 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
2453 }
2454
2455 template<
2456 typename T,
2457 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
2459 {
2460 return m_systemInfo.get<FrameInfo::SystemInfo::OperatingSystem>();
2461 }
2462
2463 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::TimeStamp>::value, int>::type = 0>
2465 {
2466 return m_timeStamp;
2467 }
2468
2469 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2471 {
2472 return m_metrics;
2473 }
2474
2475 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2477 {
2478 return m_softwareVersion;
2479 }
2480
2481 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2483 {
2484 return m_systemInfo;
2485 }
2486
2487 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
2489 {
2490 return m_timeStamp;
2491 }
2492
2494 template<typename F>
2495 void forEach(const F &f) const
2496 {
2497 f(m_metrics);
2498 f(m_softwareVersion);
2499 f(m_systemInfo);
2500 f(m_timeStamp);
2501 }
2502
2504 template<typename F>
2505 void forEach(const F &f)
2506 {
2507 f(m_metrics);
2508 f(m_softwareVersion);
2509 f(m_systemInfo);
2510 f(m_timeStamp);
2511 }
2512
2514 bool operator==(const FrameInfo &other) const;
2515
2517 bool operator!=(const FrameInfo &other) const;
2518
2520 std::string toString() const;
2521
2523 friend std::ostream &operator<<(std::ostream &stream, const FrameInfo &value)
2524 {
2525 return stream << value.toString();
2526 }
2527
2529 void save(const std::string &fileName) const;
2530
2532 void load(const std::string &fileName);
2533
2534 private:
2535 void setFromString(const std::string &value);
2536
2537 void setFromString(const std::string &fullPath, const std::string &value);
2538
2539 std::string getString(const std::string &fullPath) const;
2540
2541 Metrics m_metrics;
2542 SoftwareVersion m_softwareVersion;
2543 SystemInfo m_systemInfo;
2544 TimeStamp m_timeStamp;
2545
2546 friend struct DataModel::Detail::Befriend<FrameInfo>;
2547 };
2548
2549#ifndef NO_DOC
2550 template<>
2551 struct FrameInfo::Version<4>
2552 {
2553 using Type = FrameInfo;
2554 };
2555#endif
2556
2557} // namespace Zivid
2558
2559#ifndef NO_DOC
2561namespace Zivid::Detail
2562{
2563
2564 ZIVID_CORE_EXPORT void save(const Zivid::FrameInfo &dataModel, std::ostream &ostream);
2565 ZIVID_CORE_EXPORT void load(Zivid::FrameInfo &dataModel, std::istream &istream);
2566
2567 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::FrameInfo &source);
2568 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(Zivid::FrameInfo &dest, const std::vector<uint8_t> &data);
2569
2570} // namespace Zivid::Detail
2571#endif
2572
2573#ifdef _MSC_VER
2574# pragma warning(pop)
2575#endif
2576
2577#ifndef NO_DOC
2578# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2579namespace std // NOLINT
2580{
2581
2582 template<>
2583 struct tuple_size<Zivid::FrameInfo::Metrics> : integral_constant<size_t, 2>
2584 {};
2585
2586 template<size_t i>
2587 struct tuple_element<i, Zivid::FrameInfo::Metrics>
2588 {
2589 static_assert(i < tuple_size<Zivid::FrameInfo::Metrics>::value, "Index must be less than 2");
2590
2591 using type // NOLINT
2592 = decltype(declval<Zivid::FrameInfo::Metrics>().get<i>());
2593 };
2594
2595 template<>
2596 struct tuple_size<Zivid::FrameInfo::SoftwareVersion> : integral_constant<size_t, 1>
2597 {};
2598
2599 template<size_t i>
2600 struct tuple_element<i, Zivid::FrameInfo::SoftwareVersion>
2601 {
2602 static_assert(i < tuple_size<Zivid::FrameInfo::SoftwareVersion>::value, "Index must be less than 1");
2603
2604 using type // NOLINT
2605 = decltype(declval<Zivid::FrameInfo::SoftwareVersion>().get<i>());
2606 };
2607
2608 template<>
2609 struct tuple_size<Zivid::FrameInfo::SystemInfo> : integral_constant<size_t, 3>
2610 {};
2611
2612 template<size_t i>
2613 struct tuple_element<i, Zivid::FrameInfo::SystemInfo>
2614 {
2615 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo>::value, "Index must be less than 3");
2616
2617 using type // NOLINT
2618 = decltype(declval<Zivid::FrameInfo::SystemInfo>().get<i>());
2619 };
2620
2621 template<>
2622 struct tuple_size<Zivid::FrameInfo::SystemInfo::CPU> : integral_constant<size_t, 1>
2623 {};
2624
2625 template<size_t i>
2626 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::CPU>
2627 {
2628 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::CPU>::value, "Index must be less than 1");
2629
2630 using type // NOLINT
2631 = decltype(declval<Zivid::FrameInfo::SystemInfo::CPU>().get<i>());
2632 };
2633
2634 template<>
2635 struct tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice> : integral_constant<size_t, 2>
2636 {};
2637
2638 template<size_t i>
2639 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::ComputeDevice>
2640 {
2641 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice>::value, "Index must be less than 2");
2642
2643 using type // NOLINT
2644 = decltype(declval<Zivid::FrameInfo::SystemInfo::ComputeDevice>().get<i>());
2645 };
2646
2647 template<>
2648 struct tuple_size<Zivid::FrameInfo> : integral_constant<size_t, 4>
2649 {};
2650
2651 template<size_t i>
2652 struct tuple_element<i, Zivid::FrameInfo>
2653 {
2654 static_assert(i < tuple_size<Zivid::FrameInfo>::value, "Index must be less than 4");
2655
2656 using type // NOLINT
2657 = decltype(declval<Zivid::FrameInfo>().get<i>());
2658 };
2659
2660} // namespace std
2661# endif
2662#endif
2663
2664// If we have access to the DataModel library, automatically include internal DataModel
2665// header. This header is necessary for serialization and deserialization.
2666#if defined(__has_include) && !defined(NO_DOC)
2667# if __has_include("Zivid/FrameInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
2668# include "Zivid/FrameInfoInternal.h"
2669# endif
2670#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:132
AcquisitionTime()=default
Default constructor.
bool operator<(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:188
bool operator<=(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:200
std::chrono::microseconds ValueType
The type of the underlying value.
Definition FrameInfo.h:153
bool operator>=(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:206
std::chrono::microseconds value() const
Get the value.
bool operator>(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:194
bool operator==(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:176
bool operator!=(const AcquisitionTime &other) const
Comparison operator.
Definition FrameInfo.h:182
constexpr AcquisitionTime(std::chrono::microseconds value)
Constructor.
Definition FrameInfo.h:165
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for AcquisitionTime.
Definition FrameInfo.h:156
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:212
Capture Time is the duration from the start of the capture to when all of the data transfer and proce...
Definition FrameInfo.h:232
constexpr CaptureTime(std::chrono::microseconds value)
Constructor.
Definition FrameInfo.h:264
std::string toString() const
Get the value as string.
CaptureTime()=default
Default constructor.
bool operator<(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:287
std::chrono::microseconds ValueType
The type of the underlying value.
Definition FrameInfo.h:252
bool operator>(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:293
bool operator==(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:275
bool operator<=(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:299
bool operator>=(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:305
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for CaptureTime.
Definition FrameInfo.h:255
bool operator!=(const CaptureTime &other) const
Comparison operator.
Definition FrameInfo.h:281
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:311
Metrics related to this capture.
Definition FrameInfo.h:110
friend std::ostream & operator<<(std::ostream &stream, const Metrics &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:524
bool operator!=(const Metrics &other) const
Inequality operator.
Metrics()
Default constructor.
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:500
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:413
const CaptureTime & captureTime() const
Get CaptureTime.
Definition FrameInfo.h:452
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:508
CaptureTime & captureTime()
Get CaptureTime.
Definition FrameInfo.h:458
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:380
Metrics & set(const CaptureTime &value)
Set CaptureTime.
Definition FrameInfo.h:464
const AcquisitionTime & acquisitionTime() const
Get AcquisitionTime.
Definition FrameInfo.h:433
const FrameInfo::Metrics::CaptureTime & get() const
Definition FrameInfo.h:481
AcquisitionTime & acquisitionTime()
Get AcquisitionTime.
Definition FrameInfo.h:439
std::string toString() const
Get the value as string.
std::tuple< FrameInfo::Metrics::AcquisitionTime, FrameInfo::Metrics::CaptureTime > Descendants
Definition FrameInfo.h:324
Metrics & set(const AcquisitionTime &value)
Set AcquisitionTime.
Definition FrameInfo.h:445
bool operator==(const Metrics &other) const
Equality operator.
const FrameInfo::Metrics::AcquisitionTime & get() const
Definition FrameInfo.h:473
Core version.
Definition FrameInfo.h:566
std::string toString() const
Get the value as string.
bool operator>=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:634
const std::string & value() const
Get the value.
bool operator!=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:610
Core(std::string value)
Constructor.
Definition FrameInfo.h:593
bool operator==(const Core &other) const
Comparison operator.
Definition FrameInfo.h:604
Core()=default
Default constructor.
bool operator>(const Core &other) const
Comparison operator.
Definition FrameInfo.h:622
bool operator<(const Core &other) const
Comparison operator.
Definition FrameInfo.h:616
friend std::ostream & operator<<(std::ostream &stream, const Core &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:640
bool operator<=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:628
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:581
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Core.
Definition FrameInfo.h:584
The version information for installed software at the time of image capture.
Definition FrameInfo.h:546
const Core & core() const
Get Core.
Definition FrameInfo.h:759
friend std::ostream & operator<<(std::ostream &stream, const SoftwareVersion &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:815
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:800
SoftwareVersion()
Default constructor.
const FrameInfo::SoftwareVersion::Core & get() const
Definition FrameInfo.h:780
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:739
Core & core()
Get Core.
Definition FrameInfo.h:765
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:793
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:707
std::tuple< FrameInfo::SoftwareVersion::Core > Descendants
Definition FrameInfo.h:653
SoftwareVersion & set(const Core &value)
Set Core.
Definition FrameInfo.h:771
std::string toString() const
Get the value as string.
CPU model.
Definition FrameInfo.h:874
const std::string & value() const
Get the value.
bool operator!=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:918
Model()=default
Default constructor.
bool operator<(const Model &other) const
Comparison operator.
Definition FrameInfo.h:924
std::string toString() const
Get the value as string.
bool operator==(const Model &other) const
Comparison operator.
Definition FrameInfo.h:912
bool operator>=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:942
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:948
bool operator<=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:936
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model.
Definition FrameInfo.h:892
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:889
Model(std::string value)
Constructor.
Definition FrameInfo.h:901
bool operator>(const Model &other) const
Comparison operator.
Definition FrameInfo.h:930
CPU.
Definition FrameInfo.h:856
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1110
const Model & model() const
Get Model.
Definition FrameInfo.h:1069
std::tuple< FrameInfo::SystemInfo::CPU::Model > Descendants
Definition FrameInfo.h:961
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:1103
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:1125
CPU & set(const Model &value)
Set Model.
Definition FrameInfo.h:1081
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1015
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:1048
Model & model()
Get Model.
Definition FrameInfo.h:1075
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:1090
Compute device model.
Definition FrameInfo.h:1164
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model.
Definition FrameInfo.h:1182
std::string toString() const
Get the value as string.
bool operator<=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1226
Model(std::string value)
Constructor.
Definition FrameInfo.h:1191
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1179
const std::string & value() const
Get the value.
bool operator==(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1202
bool operator!=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1208
bool operator>=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1232
bool operator>(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1220
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:1238
bool operator<(const Model &other) const
Comparison operator.
Definition FrameInfo.h:1214
Compute device vendor.
Definition FrameInfo.h:1255
bool operator>(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1311
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Vendor.
Definition FrameInfo.h:1273
friend std::ostream & operator<<(std::ostream &stream, const Vendor &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:1329
bool operator>=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1323
bool operator<(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1305
bool operator==(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1293
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1270
std::string toString() const
Get the value as string.
bool operator<=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1317
const std::string & value() const
Get the value.
bool operator!=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:1299
Vendor(std::string value)
Constructor.
Definition FrameInfo.h:1282
Compute device.
Definition FrameInfo.h:1146
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1399
ComputeDevice & set(const Model &value)
Set Model.
Definition FrameInfo.h:1466
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:1523
const Vendor & vendor() const
Get Vendor.
Definition FrameInfo.h:1473
std:: tuple< FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor > Descendants
Definition FrameInfo.h:1342
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1531
Model & model()
Get Model.
Definition FrameInfo.h:1460
Vendor & vendor()
Get Vendor.
Definition FrameInfo.h:1479
bool operator==(const ComputeDevice &other) const
Equality operator.
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1504
const Model & model() const
Get Model.
Definition FrameInfo.h:1454
friend std::ostream & operator<<(std::ostream &stream, const ComputeDevice &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:1547
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:1485
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:1433
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1495
Operating system.
Definition FrameInfo.h:1569
bool operator>(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1625
OperatingSystem(std::string value)
Constructor.
Definition FrameInfo.h:1596
bool operator!=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1613
bool operator<(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1619
bool operator>=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1637
bool operator==(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1607
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1584
OperatingSystem()=default
Default constructor.
bool operator<=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1631
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:1643
std::string toString() const
Get the value as string.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for OperatingSystem.
Definition FrameInfo.h:1587
Information about the system that captured this frame.
Definition FrameInfo.h:836
SystemInfo & set(const CPU::Model &value)
Set CPU::Model.
Definition FrameInfo.h:1802
std::string toString() const
Get the value as string.
const FrameInfo::SystemInfo::CPU & get() const
Definition FrameInfo.h:1863
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:1930
ComputeDevice & computeDevice()
Get ComputeDevice.
Definition FrameInfo.h:1815
SystemInfo & set(const ComputeDevice &value)
Set ComputeDevice.
Definition FrameInfo.h:1821
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1897
SystemInfo & set(const CPU &value)
Set CPU.
Definition FrameInfo.h:1795
bool operator==(const SystemInfo &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1726
friend std::ostream & operator<<(std::ostream &stream, const SystemInfo &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:1956
const ComputeDevice & computeDevice() const
Get ComputeDevice.
Definition FrameInfo.h:1809
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1939
SystemInfo & set(const ComputeDevice::Vendor &value)
Set ComputeDevice::Vendor.
Definition FrameInfo.h:1835
SystemInfo & set(const OperatingSystem &value)
Set OperatingSystem.
Definition FrameInfo.h:1854
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:1763
bool operator!=(const SystemInfo &other) const
Inequality operator.
SystemInfo & set(const ComputeDevice::Model &value)
Set ComputeDevice::Model.
Definition FrameInfo.h:1828
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition FrameInfo.h:1905
CPU & cpu()
Get CPU.
Definition FrameInfo.h:1789
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition FrameInfo.h:1879
const OperatingSystem & operatingSystem() const
Get OperatingSystem.
Definition FrameInfo.h:1842
OperatingSystem & operatingSystem()
Get OperatingSystem.
Definition FrameInfo.h:1848
SystemInfo()
Default constructor.
const CPU & cpu() const
Get CPU.
Definition FrameInfo.h:1783
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1888
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:1656
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:1871
The time of frame capture.
Definition FrameInfo.h:1979
std::chrono::system_clock::time_point value() const
Get the value.
bool operator>(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2035
bool operator<(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2029
bool operator<=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2041
static constexpr Range< std::chrono::system_clock::time_point > validRange()
The range of valid values for TimeStamp.
Definition FrameInfo.h:1997
bool operator>=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2047
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:2053
TimeStamp()=default
Default constructor.
constexpr TimeStamp(std::chrono::system_clock::time_point value)
Constructor.
Definition FrameInfo.h:2006
bool operator!=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2023
bool operator==(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:2017
std::chrono::system_clock::time_point ValueType
The type of the underlying value.
Definition FrameInfo.h:1994
Various information for a frame.
Definition FrameInfo.h:78
TimeStamp & timeStamp()
Get TimeStamp.
Definition FrameInfo.h:2362
std::string toString() const
Get the value as string.
Metrics & metrics()
Get Metrics.
Definition FrameInfo.h:2242
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:2495
const FrameInfo::SoftwareVersion::Core & get() const
Definition FrameInfo.h:2405
const FrameInfo::Metrics & get() const
Definition FrameInfo.h:2375
const FrameInfo::Metrics::CaptureTime & get() const
Definition FrameInfo.h:2391
FrameInfo & set(const SystemInfo::ComputeDevice &value)
Set SystemInfo::ComputeDevice.
Definition FrameInfo.h:2328
FrameInfo()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:2173
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:2441
const FrameInfo::Metrics::AcquisitionTime & get() const
Definition FrameInfo.h:2383
FrameInfo & set(const SystemInfo::OperatingSystem &value)
Set SystemInfo::OperatingSystem.
Definition FrameInfo.h:2349
void save(const std::string &fileName) const
Save to the given file.
const SystemInfo & systemInfo() const
Get SystemInfo.
Definition FrameInfo.h:2295
FrameInfo & set(const Metrics::CaptureTime &value)
Set Metrics::CaptureTime.
Definition FrameInfo.h:2262
FrameInfo & set(const SystemInfo &value)
Set SystemInfo.
Definition FrameInfo.h:2307
const TimeStamp & timeStamp() const
Get TimeStamp.
Definition FrameInfo.h:2356
SoftwareVersion & softwareVersion()
Get SoftwareVersion.
Definition FrameInfo.h:2275
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:2342
const FrameInfo::SoftwareVersion & get() const
Definition FrameInfo.h:2397
friend std::ostream & operator<<(std::ostream &stream, const FrameInfo &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:2523
FrameInfo & set(const TimeStamp &value)
Set TimeStamp.
Definition FrameInfo.h:2368
FrameInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition FrameInfo.h:2134
const FrameInfo::TimeStamp & get() const
Definition FrameInfo.h:2464
const SoftwareVersion & softwareVersion() const
Get SoftwareVersion.
Definition FrameInfo.h:2269
FrameInfo & set(const SystemInfo::CPU::Model &value)
Set SystemInfo::CPU::Model.
Definition FrameInfo.h:2321
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:2335
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:2425
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:2450
FrameInfo & set(const SoftwareVersion &value)
Set SoftwareVersion.
Definition FrameInfo.h:2281
const FrameInfo::SystemInfo & get() const
Definition FrameInfo.h:2411
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition FrameInfo.h:2433
FrameInfo & set(const SoftwareVersion::Core &value)
Set SoftwareVersion::Core.
Definition FrameInfo.h:2288
SystemInfo & systemInfo()
Get SystemInfo.
Definition FrameInfo.h:2301
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:2505
FrameInfo & set(const Metrics::AcquisitionTime &value)
Set Metrics::AcquisitionTime.
Definition FrameInfo.h:2255
bool operator==(const FrameInfo &other) const
Equality operator.
std::tuple< FrameInfo::Metrics, FrameInfo::Metrics::AcquisitionTime, FrameInfo::Metrics::CaptureTime, 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:2066
FrameInfo & set(const SystemInfo::CPU &value)
Set SystemInfo::CPU.
Definition FrameInfo.h:2314
const FrameInfo::SystemInfo::CPU & get() const
Definition FrameInfo.h:2417
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:2217
FrameInfo & set(const Metrics &value)
Set Metrics.
Definition FrameInfo.h:2248
const Metrics & metrics() const
Get Metrics.
Definition FrameInfo.h:2236
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition FrameInfo.h:2458
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