Zivid C++ API 2.6.1+6cec8609-3
Defining the Future of 3D Machine Vision
FrameInfo.h
Go to the documentation of this file.
1
2
3/*******************************************************************************
4
5 * This file is part of the Zivid 3D Camera API
6
7 *
8
9 * Copyright 2015-2022 (C) Zivid AS
10
11 * All rights reserved.
12
13 *
14
15 * Zivid Software License, v1.0
16
17 *
18
19 * Redistribution and use in source and binary forms, with or without
20
21 * modification, are permitted provided that the following conditions are met:
22
23 *
24
25 * 1. Redistributions of source code must retain the above copyright notice,
26
27 * this list of conditions and the following disclaimer.
28
29 *
30
31 * 2. Redistributions in binary form must reproduce the above copyright notice,
32
33 * this list of conditions and the following disclaimer in the documentation
34
35 * and/or other materials provided with the distribution.
36
37 *
38
39 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
40
41 * to endorse or promote products derived from this software without specific
42
43 * prior written permission.
44
45 *
46
47 * 4. This software, with or without modification, must not be used with any
48
49 * other 3D camera than from Zivid AS.
50
51 *
52
53 * 5. Any software provided in binary form under this license must not be
54
55 * reverse engineered, decompiled, modified and/or disassembled.
56
57 *
58
59 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
60
61 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
62
63 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
64
65 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
66
67 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68
69 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
70
71 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
72
73 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74
75 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76
77 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78
79 *
80
81 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
82
83 * Info: http://www.zivid.com
84
85 ******************************************************************************/
86
87
88
89#pragma once
90
91#include <array>
92#include <chrono>
93#include <cmath>
94#include <ctime>
95#include <iomanip>
96#include <memory>
97#include <set>
98#include <sstream>
99#include <string>
100#include <tuple>
101#include <utility>
102#include <vector>
103
109#include "Zivid/Range.h"
110
111#ifdef _MSC_VER
112# pragma warning(push)
113# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
114#endif
115
116namespace Zivid
117{
118
121 {
122 public:
125
127 static constexpr const char *path{ "" };
128
130 static constexpr const char *name{ "FrameInfo" };
131
133 static constexpr const char *description{ R"description(Various information for a frame)description" };
134
135 static constexpr size_t version{ 3 };
136
137#ifndef NO_DOC
138 template<size_t>
139 struct Version;
140
141 using LatestVersion = Zivid::FrameInfo;
142
143 // Short identifier. This value is not guaranteed to be universally unique
144 // Todo(ZIVID-2808): Move this to internal DataModelExt header
145 static constexpr std::array<uint8_t, 3> binaryId{ 'f', 'i', 'f' };
146
147#endif
148
151 {
152 public:
155
157 static constexpr const char *path{ "SoftwareVersion" };
158
160 static constexpr const char *name{ "SoftwareVersion" };
161
163 static constexpr const char *description{
164 R"description(The version information for installed software at the time of image capture)description"
165 };
166
169 {
170 public:
173
175 static constexpr const char *path{ "SoftwareVersion/Core" };
176
178 static constexpr const char *name{ "Core" };
179
181 static constexpr const char *description{ R"description(Core version)description" };
182
184 using ValueType = std::string;
185
188 {
189 return { 0, std::numeric_limits<ValueType::size_type>::max() };
190 }
191
193 Core() = default;
194
196 explicit Core(std::string value)
197 : m_value{ std::move(value) }
198 {}
199
201 const std::string &value() const;
202
204 std::string toString() const;
205
207 bool operator==(const Core &other) const
208 {
209 return m_value == other.m_value;
210 }
211
213 bool operator!=(const Core &other) const
214 {
215 return m_value != other.m_value;
216 }
217
219 bool operator<(const Core &other) const
220 {
221 return m_value < other.m_value;
222 }
223
225 bool operator>(const Core &other) const
226 {
227 return m_value > other.m_value;
228 }
229
231 friend std::ostream &operator<<(std::ostream &stream, const Core &value)
232 {
233 return stream << value.toString();
234 }
235
236 private:
237 void setFromString(const std::string &value);
238
239 std::string m_value{ "No-version" };
240
241 friend struct DataModel::Detail::Befriend<Core>;
242 };
243
244 using Descendants = std::tuple<FrameInfo::SoftwareVersion::Core>;
245
248
260#ifndef NO_DOC
261 template<
262 typename... Args,
263 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
264 typename std::enable_if<
265 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
266 value,
267 int>::type = 0>
268#else
269 template<typename... Args>
270#endif
271 explicit SoftwareVersion(Args &&...args)
272 {
273 using namespace Zivid::Detail::TypeTraits;
274
275 static_assert(
276 AllArgsDecayedAreUnique<Args...>::value,
277 "Found duplicate types among the arguments passed to SoftwareVersion(...). "
278 "Types should be listed at most once.");
279
280 set(std::forward<Args>(args)...);
281 }
282
293#ifndef NO_DOC
294 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
295#else
296 template<typename... Args>
297#endif
298 void set(Args &&...args)
299 {
300 using namespace Zivid::Detail::TypeTraits;
301
302 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
303 static_assert(
304 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
305
306 static_assert(
307 AllArgsDecayedAreUnique<Args...>::value,
308 "Found duplicate types among the arguments passed to set(...). "
309 "Types should be listed at most once.");
310
311 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
312 }
313
325#ifndef NO_DOC
326 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
327#else
328 template<typename... Args>
329#endif
330 SoftwareVersion copyWith(Args &&...args) const
331 {
332 using namespace Zivid::Detail::TypeTraits;
333
334 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
335 static_assert(
336 AllArgsAreDescendantNodes::value,
337 "All arguments passed to copyWith(...) must be descendant nodes.");
338
339 static_assert(
340 AllArgsDecayedAreUnique<Args...>::value,
341 "Found duplicate types among the arguments passed to copyWith(...). "
342 "Types should be listed at most once.");
343
344 auto copy{ *this };
345 copy.set(std::forward<Args>(args)...);
346 return copy;
347 }
348
350 const Core &core() const
351 {
352 return m_core;
353 }
354
357 {
358 return m_core;
359 }
360
362 SoftwareVersion &set(const Core &value)
363 {
364 m_core = value;
365 return *this;
366 }
367
368 template<
369 typename T,
370 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
372 {
373 return m_core;
374 }
375
376 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
378 {
379 return m_core;
380 }
381
383 template<typename F>
384 void forEach(const F &f) const
385 {
386 f(m_core);
387 }
388
390 template<typename F>
391 void forEach(const F &f)
392 {
393 f(m_core);
394 }
395
397 bool operator==(const SoftwareVersion &other) const;
398
400 bool operator!=(const SoftwareVersion &other) const;
401
403 std::string toString() const;
404
406 friend std::ostream &operator<<(std::ostream &stream, const SoftwareVersion &value)
407 {
408 return stream << value.toString();
409 }
410
411 private:
412 void setFromString(const std::string &value);
413
414 void setFromString(const std::string &fullPath, const std::string &value);
415
416 std::string getString(const std::string &fullPath) const;
417
418 Core m_core;
419
420 friend struct DataModel::Detail::Befriend<SoftwareVersion>;
421 };
422
425 {
426 public:
429
431 static constexpr const char *path{ "SystemInfo" };
432
434 static constexpr const char *name{ "SystemInfo" };
435
437 static constexpr const char *description{
438 R"description(Information about the system that captured this frame)description"
439 };
440
443 {
444 public:
447
449 static constexpr const char *path{ "SystemInfo/CPU" };
450
452 static constexpr const char *name{ "CPU" };
453
455 static constexpr const char *description{ R"description(CPU)description" };
456
459 {
460 public:
463
465 static constexpr const char *path{ "SystemInfo/CPU/Model" };
466
468 static constexpr const char *name{ "Model" };
469
471 static constexpr const char *description{ R"description(CPU model)description" };
472
474 using ValueType = std::string;
475
478 {
479 return { 0, std::numeric_limits<ValueType::size_type>::max() };
480 }
481
483 Model() = default;
484
486 explicit Model(std::string value)
487 : m_value{ std::move(value) }
488 {}
489
491 const std::string &value() const;
492
494 std::string toString() const;
495
497 bool operator==(const Model &other) const
498 {
499 return m_value == other.m_value;
500 }
501
503 bool operator!=(const Model &other) const
504 {
505 return m_value != other.m_value;
506 }
507
509 bool operator<(const Model &other) const
510 {
511 return m_value < other.m_value;
512 }
513
515 bool operator>(const Model &other) const
516 {
517 return m_value > other.m_value;
518 }
519
521 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
522 {
523 return stream << value.toString();
524 }
525
526 private:
527 void setFromString(const std::string &value);
528
529 std::string m_value{};
530
531 friend struct DataModel::Detail::Befriend<Model>;
532 };
533
534 using Descendants = std::tuple<FrameInfo::SystemInfo::CPU::Model>;
535
538
550#ifndef NO_DOC
551 template<
552 typename... Args,
553 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
554 typename std::enable_if<
555 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
556 value,
557 int>::type = 0>
558#else
559 template<typename... Args>
560#endif
561 explicit CPU(Args &&...args)
562 {
563 using namespace Zivid::Detail::TypeTraits;
564
565 static_assert(
566 AllArgsDecayedAreUnique<Args...>::value,
567 "Found duplicate types among the arguments passed to CPU(...). "
568 "Types should be listed at most once.");
569
570 set(std::forward<Args>(args)...);
571 }
572
583#ifndef NO_DOC
584 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
585#else
586 template<typename... Args>
587#endif
588 void set(Args &&...args)
589 {
590 using namespace Zivid::Detail::TypeTraits;
591
592 using AllArgsAreDescendantNodes =
593 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
594 static_assert(
595 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
596
597 static_assert(
598 AllArgsDecayedAreUnique<Args...>::value,
599 "Found duplicate types among the arguments passed to set(...). "
600 "Types should be listed at most once.");
601
602 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
603 }
604
616#ifndef NO_DOC
617 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
618#else
619 template<typename... Args>
620#endif
621 CPU copyWith(Args &&...args) const
622 {
623 using namespace Zivid::Detail::TypeTraits;
624
625 using AllArgsAreDescendantNodes =
626 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
627 static_assert(
628 AllArgsAreDescendantNodes::value,
629 "All arguments passed to copyWith(...) must be descendant nodes.");
630
631 static_assert(
632 AllArgsDecayedAreUnique<Args...>::value,
633 "Found duplicate types among the arguments passed to copyWith(...). "
634 "Types should be listed at most once.");
635
636 auto copy{ *this };
637 copy.set(std::forward<Args>(args)...);
638 return copy;
639 }
640
642 const Model &model() const
643 {
644 return m_model;
645 }
646
649 {
650 return m_model;
651 }
652
654 CPU &set(const Model &value)
655 {
656 m_model = value;
657 return *this;
658 }
659
660 template<
661 typename T,
662 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
664 {
665 return m_model;
666 }
667
668 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
670 {
671 return m_model;
672 }
673
675 template<typename F>
676 void forEach(const F &f) const
677 {
678 f(m_model);
679 }
680
682 template<typename F>
683 void forEach(const F &f)
684 {
685 f(m_model);
686 }
687
689 bool operator==(const CPU &other) const;
690
692 bool operator!=(const CPU &other) const;
693
695 std::string toString() const;
696
698 friend std::ostream &operator<<(std::ostream &stream, const CPU &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 Model m_model;
711
712 friend struct DataModel::Detail::Befriend<CPU>;
713 };
714
717 {
718 public:
721
723 static constexpr const char *path{ "SystemInfo/ComputeDevice" };
724
726 static constexpr const char *name{ "ComputeDevice" };
727
729 static constexpr const char *description{ R"description(Compute device)description" };
730
733 {
734 public:
737
739 static constexpr const char *path{ "SystemInfo/ComputeDevice/Model" };
740
742 static constexpr const char *name{ "Model" };
743
745 static constexpr const char *description{ R"description(Compute device model)description" };
746
748 using ValueType = std::string;
749
752 {
753 return { 0, std::numeric_limits<ValueType::size_type>::max() };
754 }
755
757 Model() = default;
758
760 explicit Model(std::string value)
761 : m_value{ std::move(value) }
762 {}
763
765 const std::string &value() const;
766
768 std::string toString() const;
769
771 bool operator==(const Model &other) const
772 {
773 return m_value == other.m_value;
774 }
775
777 bool operator!=(const Model &other) const
778 {
779 return m_value != other.m_value;
780 }
781
783 bool operator<(const Model &other) const
784 {
785 return m_value < other.m_value;
786 }
787
789 bool operator>(const Model &other) const
790 {
791 return m_value > other.m_value;
792 }
793
795 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
796 {
797 return stream << value.toString();
798 }
799
800 private:
801 void setFromString(const std::string &value);
802
803 std::string m_value{};
804
805 friend struct DataModel::Detail::Befriend<Model>;
806 };
807
810 {
811 public:
814
816 static constexpr const char *path{ "SystemInfo/ComputeDevice/Vendor" };
817
819 static constexpr const char *name{ "Vendor" };
820
822 static constexpr const char *description{ R"description(Compute device vendor)description" };
823
825 using ValueType = std::string;
826
829 {
830 return { 0, std::numeric_limits<ValueType::size_type>::max() };
831 }
832
834 Vendor() = default;
835
837 explicit Vendor(std::string value)
838 : m_value{ std::move(value) }
839 {}
840
842 const std::string &value() const;
843
845 std::string toString() const;
846
848 bool operator==(const Vendor &other) const
849 {
850 return m_value == other.m_value;
851 }
852
854 bool operator!=(const Vendor &other) const
855 {
856 return m_value != other.m_value;
857 }
858
860 bool operator<(const Vendor &other) const
861 {
862 return m_value < other.m_value;
863 }
864
866 bool operator>(const Vendor &other) const
867 {
868 return m_value > other.m_value;
869 }
870
872 friend std::ostream &operator<<(std::ostream &stream, const Vendor &value)
873 {
874 return stream << value.toString();
875 }
876
877 private:
878 void setFromString(const std::string &value);
879
880 std::string m_value{};
881
882 friend struct DataModel::Detail::Befriend<Vendor>;
883 };
884
885 using Descendants = std::
886 tuple<FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor>;
887
890
903#ifndef NO_DOC
904 template<
905 typename... Args,
906 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
907 typename std::enable_if<
908 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
909 value,
910 int>::type = 0>
911#else
912 template<typename... Args>
913#endif
914 explicit ComputeDevice(Args &&...args)
915 {
916 using namespace Zivid::Detail::TypeTraits;
917
918 static_assert(
919 AllArgsDecayedAreUnique<Args...>::value,
920 "Found duplicate types among the arguments passed to ComputeDevice(...). "
921 "Types should be listed at most once.");
922
923 set(std::forward<Args>(args)...);
924 }
925
937#ifndef NO_DOC
938 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
939#else
940 template<typename... Args>
941#endif
942 void set(Args &&...args)
943 {
944 using namespace Zivid::Detail::TypeTraits;
945
946 using AllArgsAreDescendantNodes =
947 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
948 static_assert(
949 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
950
951 static_assert(
952 AllArgsDecayedAreUnique<Args...>::value,
953 "Found duplicate types among the arguments passed to set(...). "
954 "Types should be listed at most once.");
955
956 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
957 }
958
971#ifndef NO_DOC
972 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
973#else
974 template<typename... Args>
975#endif
976 ComputeDevice copyWith(Args &&...args) const
977 {
978 using namespace Zivid::Detail::TypeTraits;
979
980 using AllArgsAreDescendantNodes =
981 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
982 static_assert(
983 AllArgsAreDescendantNodes::value,
984 "All arguments passed to copyWith(...) must be descendant nodes.");
985
986 static_assert(
987 AllArgsDecayedAreUnique<Args...>::value,
988 "Found duplicate types among the arguments passed to copyWith(...). "
989 "Types should be listed at most once.");
990
991 auto copy{ *this };
992 copy.set(std::forward<Args>(args)...);
993 return copy;
994 }
995
997 const Model &model() const
998 {
999 return m_model;
1000 }
1001
1004 {
1005 return m_model;
1006 }
1007
1009 ComputeDevice &set(const Model &value)
1010 {
1011 m_model = value;
1012 return *this;
1013 }
1014
1016 const Vendor &vendor() const
1017 {
1018 return m_vendor;
1019 }
1020
1023 {
1024 return m_vendor;
1025 }
1026
1028 ComputeDevice &set(const Vendor &value)
1029 {
1030 m_vendor = value;
1031 return *this;
1032 }
1033
1034 template<
1035 typename T,
1036 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1037 type = 0>
1039 {
1040 return m_model;
1041 }
1042
1043 template<
1044 typename T,
1045 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1046 type = 0>
1048 {
1049 return m_vendor;
1050 }
1051
1052 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1054 {
1055 return m_model;
1056 }
1057
1058 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1060 {
1061 return m_vendor;
1062 }
1063
1065 template<typename F>
1066 void forEach(const F &f) const
1067 {
1068 f(m_model);
1069 f(m_vendor);
1070 }
1071
1073 template<typename F>
1074 void forEach(const F &f)
1075 {
1076 f(m_model);
1077 f(m_vendor);
1078 }
1079
1081 bool operator==(const ComputeDevice &other) const;
1082
1084 bool operator!=(const ComputeDevice &other) const;
1085
1087 std::string toString() const;
1088
1090 friend std::ostream &operator<<(std::ostream &stream, const ComputeDevice &value)
1091 {
1092 return stream << value.toString();
1093 }
1094
1095 private:
1096 void setFromString(const std::string &value);
1097
1098 void setFromString(const std::string &fullPath, const std::string &value);
1099
1100 std::string getString(const std::string &fullPath) const;
1101
1102 Model m_model;
1103 Vendor m_vendor;
1104
1105 friend struct DataModel::Detail::Befriend<ComputeDevice>;
1106 };
1107
1110 {
1111 public:
1114
1116 static constexpr const char *path{ "SystemInfo/OperatingSystem" };
1117
1119 static constexpr const char *name{ "OperatingSystem" };
1120
1122 static constexpr const char *description{ R"description(Operating system)description" };
1123
1125 using ValueType = std::string;
1126
1129 {
1130 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1131 }
1132
1134 OperatingSystem() = default;
1135
1137 explicit OperatingSystem(std::string value)
1138 : m_value{ std::move(value) }
1139 {}
1140
1142 const std::string &value() const;
1143
1145 std::string toString() const;
1146
1148 bool operator==(const OperatingSystem &other) const
1149 {
1150 return m_value == other.m_value;
1151 }
1152
1154 bool operator!=(const OperatingSystem &other) const
1155 {
1156 return m_value != other.m_value;
1157 }
1158
1160 bool operator<(const OperatingSystem &other) const
1161 {
1162 return m_value < other.m_value;
1163 }
1164
1166 bool operator>(const OperatingSystem &other) const
1167 {
1168 return m_value > other.m_value;
1169 }
1170
1172 friend std::ostream &operator<<(std::ostream &stream, const OperatingSystem &value)
1173 {
1174 return stream << value.toString();
1175 }
1176
1177 private:
1178 void setFromString(const std::string &value);
1179
1180 std::string m_value{};
1181
1182 friend struct DataModel::Detail::Befriend<OperatingSystem>;
1183 };
1184
1185 using Descendants = std::tuple<
1192
1195
1212#ifndef NO_DOC
1213 template<
1214 typename... Args,
1215 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1216 typename std::enable_if<
1217 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1218 value,
1219 int>::type = 0>
1220#else
1221 template<typename... Args>
1222#endif
1223 explicit SystemInfo(Args &&...args)
1224 {
1225 using namespace Zivid::Detail::TypeTraits;
1226
1227 static_assert(
1228 AllArgsDecayedAreUnique<Args...>::value,
1229 "Found duplicate types among the arguments passed to SystemInfo(...). "
1230 "Types should be listed at most once.");
1231
1232 set(std::forward<Args>(args)...);
1233 }
1234
1250#ifndef NO_DOC
1251 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1252#else
1253 template<typename... Args>
1254#endif
1255 void set(Args &&...args)
1256 {
1257 using namespace Zivid::Detail::TypeTraits;
1258
1259 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1260 static_assert(
1261 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1262
1263 static_assert(
1264 AllArgsDecayedAreUnique<Args...>::value,
1265 "Found duplicate types among the arguments passed to set(...). "
1266 "Types should be listed at most once.");
1267
1268 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1269 }
1270
1287#ifndef NO_DOC
1288 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1289#else
1290 template<typename... Args>
1291#endif
1292 SystemInfo copyWith(Args &&...args) const
1293 {
1294 using namespace Zivid::Detail::TypeTraits;
1295
1296 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1297 static_assert(
1298 AllArgsAreDescendantNodes::value,
1299 "All arguments passed to copyWith(...) must be descendant nodes.");
1300
1301 static_assert(
1302 AllArgsDecayedAreUnique<Args...>::value,
1303 "Found duplicate types among the arguments passed to copyWith(...). "
1304 "Types should be listed at most once.");
1305
1306 auto copy{ *this };
1307 copy.set(std::forward<Args>(args)...);
1308 return copy;
1309 }
1310
1312 const CPU &cpu() const
1313 {
1314 return m_cpu;
1315 }
1316
1319 {
1320 return m_cpu;
1321 }
1322
1324 SystemInfo &set(const CPU &value)
1325 {
1326 m_cpu = value;
1327 return *this;
1328 }
1329
1332 {
1333 m_cpu.set(value);
1334 return *this;
1335 }
1336
1339 {
1340 return m_computeDevice;
1341 }
1342
1345 {
1346 return m_computeDevice;
1347 }
1348
1351 {
1352 m_computeDevice = value;
1353 return *this;
1354 }
1355
1358 {
1359 m_computeDevice.set(value);
1360 return *this;
1361 }
1362
1365 {
1366 m_computeDevice.set(value);
1367 return *this;
1368 }
1369
1372 {
1373 return m_operatingSystem;
1374 }
1375
1378 {
1379 return m_operatingSystem;
1380 }
1381
1384 {
1385 m_operatingSystem = value;
1386 return *this;
1387 }
1388
1389 template<
1390 typename T,
1391 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1393 {
1394 return m_cpu;
1395 }
1396
1397 template<
1398 typename T,
1399 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1401 {
1402 return m_cpu.get<FrameInfo::SystemInfo::CPU::Model>();
1403 }
1404
1405 template<
1406 typename T,
1407 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1409 {
1410 return m_computeDevice;
1411 }
1412
1413 template<
1414 typename T,
1415 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1416 type = 0>
1418 {
1419 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1420 }
1421
1422 template<
1423 typename T,
1424 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1425 type = 0>
1427 {
1428 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1429 }
1430
1431 template<
1432 typename T,
1433 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1435 {
1436 return m_operatingSystem;
1437 }
1438
1439 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1441 {
1442 return m_cpu;
1443 }
1444
1445 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1447 {
1448 return m_computeDevice;
1449 }
1450
1451 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1453 {
1454 return m_operatingSystem;
1455 }
1456
1458 template<typename F>
1459 void forEach(const F &f) const
1460 {
1461 f(m_cpu);
1462 f(m_computeDevice);
1463 f(m_operatingSystem);
1464 }
1465
1467 template<typename F>
1468 void forEach(const F &f)
1469 {
1470 f(m_cpu);
1471 f(m_computeDevice);
1472 f(m_operatingSystem);
1473 }
1474
1476 bool operator==(const SystemInfo &other) const;
1477
1479 bool operator!=(const SystemInfo &other) const;
1480
1482 std::string toString() const;
1483
1485 friend std::ostream &operator<<(std::ostream &stream, const SystemInfo &value)
1486 {
1487 return stream << value.toString();
1488 }
1489
1490 private:
1491 void setFromString(const std::string &value);
1492
1493 void setFromString(const std::string &fullPath, const std::string &value);
1494
1495 std::string getString(const std::string &fullPath) const;
1496
1497 CPU m_cpu;
1498 ComputeDevice m_computeDevice;
1499 OperatingSystem m_operatingSystem;
1500
1501 friend struct DataModel::Detail::Befriend<SystemInfo>;
1502 };
1503
1506 {
1507 public:
1510
1512 static constexpr const char *path{ "TimeStamp" };
1513
1515 static constexpr const char *name{ "TimeStamp" };
1516
1518 static constexpr const char *description{ R"description(The time of frame capture)description" };
1519
1521 using ValueType = std::chrono::system_clock::time_point;
1522
1525 {
1526 return { std::chrono::system_clock::time_point::min(), std::chrono::system_clock::time_point::max() };
1527 }
1528
1530 TimeStamp() = default;
1531
1533 explicit constexpr TimeStamp(std::chrono::system_clock::time_point value)
1534 : m_value{ value }
1535 {}
1536
1538 std::chrono::system_clock::time_point value() const;
1539
1541 std::string toString() const;
1542
1544 bool operator==(const TimeStamp &other) const
1545 {
1546 return m_value == other.m_value;
1547 }
1548
1550 bool operator!=(const TimeStamp &other) const
1551 {
1552 return m_value != other.m_value;
1553 }
1554
1556 bool operator<(const TimeStamp &other) const
1557 {
1558 return m_value < other.m_value;
1559 }
1560
1562 bool operator>(const TimeStamp &other) const
1563 {
1564 return m_value > other.m_value;
1565 }
1566
1568 friend std::ostream &operator<<(std::ostream &stream, const TimeStamp &value)
1569 {
1570 return stream << value.toString();
1571 }
1572
1573 private:
1574 void setFromString(const std::string &value);
1575
1576 std::chrono::system_clock::time_point m_value{};
1577
1578 friend struct DataModel::Detail::Befriend<TimeStamp>;
1579 };
1580
1581 using Descendants = std::tuple<
1592
1595
1597 explicit FrameInfo(const std::string &fileName);
1598
1619#ifndef NO_DOC
1620 template<
1621 typename... Args,
1622 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1623 typename std::enable_if<
1624 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1625 int>::type = 0>
1626#else
1627 template<typename... Args>
1628#endif
1629 explicit FrameInfo(Args &&...args)
1630 {
1631 using namespace Zivid::Detail::TypeTraits;
1632
1633 static_assert(
1634 AllArgsDecayedAreUnique<Args...>::value,
1635 "Found duplicate types among the arguments passed to FrameInfo(...). "
1636 "Types should be listed at most once.");
1637
1638 set(std::forward<Args>(args)...);
1639 }
1640
1660#ifndef NO_DOC
1661 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1662#else
1663 template<typename... Args>
1664#endif
1665 void set(Args &&...args)
1666 {
1667 using namespace Zivid::Detail::TypeTraits;
1668
1669 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1670 static_assert(
1671 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1672
1673 static_assert(
1674 AllArgsDecayedAreUnique<Args...>::value,
1675 "Found duplicate types among the arguments passed to set(...). "
1676 "Types should be listed at most once.");
1677
1678 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1679 }
1680
1701#ifndef NO_DOC
1702 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1703#else
1704 template<typename... Args>
1705#endif
1706 FrameInfo copyWith(Args &&...args) const
1707 {
1708 using namespace Zivid::Detail::TypeTraits;
1709
1710 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1711 static_assert(
1712 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1713
1714 static_assert(
1715 AllArgsDecayedAreUnique<Args...>::value,
1716 "Found duplicate types among the arguments passed to copyWith(...). "
1717 "Types should be listed at most once.");
1718
1719 auto copy{ *this };
1720 copy.set(std::forward<Args>(args)...);
1721 return copy;
1722 }
1723
1726 {
1727 return m_softwareVersion;
1728 }
1729
1732 {
1733 return m_softwareVersion;
1734 }
1735
1738 {
1739 m_softwareVersion = value;
1740 return *this;
1741 }
1742
1745 {
1746 m_softwareVersion.set(value);
1747 return *this;
1748 }
1749
1751 const SystemInfo &systemInfo() const
1752 {
1753 return m_systemInfo;
1754 }
1755
1758 {
1759 return m_systemInfo;
1760 }
1761
1763 FrameInfo &set(const SystemInfo &value)
1764 {
1765 m_systemInfo = value;
1766 return *this;
1767 }
1768
1771 {
1772 m_systemInfo.set(value);
1773 return *this;
1774 }
1775
1778 {
1779 m_systemInfo.set(value);
1780 return *this;
1781 }
1782
1785 {
1786 m_systemInfo.set(value);
1787 return *this;
1788 }
1789
1792 {
1793 m_systemInfo.set(value);
1794 return *this;
1795 }
1796
1799 {
1800 m_systemInfo.set(value);
1801 return *this;
1802 }
1803
1806 {
1807 m_systemInfo.set(value);
1808 return *this;
1809 }
1810
1812 const TimeStamp &timeStamp() const
1813 {
1814 return m_timeStamp;
1815 }
1816
1819 {
1820 return m_timeStamp;
1821 }
1822
1824 FrameInfo &set(const TimeStamp &value)
1825 {
1826 m_timeStamp = value;
1827 return *this;
1828 }
1829
1830 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion>::value, int>::type = 0>
1832 {
1833 return m_softwareVersion;
1834 }
1835
1836 template<
1837 typename T,
1838 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
1840 {
1841 return m_softwareVersion.get<FrameInfo::SoftwareVersion::Core>();
1842 }
1843
1844 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo>::value, int>::type = 0>
1846 {
1847 return m_systemInfo;
1848 }
1849
1850 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1852 {
1853 return m_systemInfo.get<FrameInfo::SystemInfo::CPU>();
1854 }
1855
1856 template<
1857 typename T,
1858 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1860 {
1861 return m_systemInfo.get<FrameInfo::SystemInfo::CPU::Model>();
1862 }
1863
1864 template<
1865 typename T,
1866 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1868 {
1869 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice>();
1870 }
1871
1872 template<
1873 typename T,
1874 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::type = 0>
1876 {
1877 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1878 }
1879
1880 template<
1881 typename T,
1882 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::type =
1883 0>
1885 {
1886 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1887 }
1888
1889 template<
1890 typename T,
1891 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1893 {
1894 return m_systemInfo.get<FrameInfo::SystemInfo::OperatingSystem>();
1895 }
1896
1897 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::TimeStamp>::value, int>::type = 0>
1899 {
1900 return m_timeStamp;
1901 }
1902
1903 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1905 {
1906 return m_softwareVersion;
1907 }
1908
1909 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1911 {
1912 return m_systemInfo;
1913 }
1914
1915 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1917 {
1918 return m_timeStamp;
1919 }
1920
1922 template<typename F>
1923 void forEach(const F &f) const
1924 {
1925 f(m_softwareVersion);
1926 f(m_systemInfo);
1927 f(m_timeStamp);
1928 }
1929
1931 template<typename F>
1932 void forEach(const F &f)
1933 {
1934 f(m_softwareVersion);
1935 f(m_systemInfo);
1936 f(m_timeStamp);
1937 }
1938
1940 bool operator==(const FrameInfo &other) const;
1941
1943 bool operator!=(const FrameInfo &other) const;
1944
1946 std::string toString() const;
1947
1949 friend std::ostream &operator<<(std::ostream &stream, const FrameInfo &value)
1950 {
1951 return stream << value.toString();
1952 }
1953
1955 void save(const std::string &fileName) const;
1956
1958 void load(const std::string &fileName);
1959
1960 private:
1961 void setFromString(const std::string &value);
1962
1963 void setFromString(const std::string &fullPath, const std::string &value);
1964
1965 std::string getString(const std::string &fullPath) const;
1966
1967 SoftwareVersion m_softwareVersion;
1968 SystemInfo m_systemInfo;
1969 TimeStamp m_timeStamp;
1970
1971 friend struct DataModel::Detail::Befriend<FrameInfo>;
1972 };
1973
1974#ifndef NO_DOC
1975 template<>
1976 struct FrameInfo::Version<3>
1977 {
1978 using Type = FrameInfo;
1979 };
1980#endif
1981
1982} // namespace Zivid
1983
1984#ifdef _MSC_VER
1985# pragma warning(pop)
1986#endif
1987
1988#ifndef NO_DOC
1989# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1990namespace std // NOLINT
1991{
1992
1993 template<>
1994 struct tuple_size<Zivid::FrameInfo::SoftwareVersion> : integral_constant<size_t, 1>
1995 {};
1996
1997 template<size_t i>
1998 struct tuple_element<i, Zivid::FrameInfo::SoftwareVersion>
1999 {
2000 static_assert(i < tuple_size<Zivid::FrameInfo::SoftwareVersion>::value, "Index must be less than 1");
2001
2002 using type // NOLINT
2003 = decltype(declval<Zivid::FrameInfo::SoftwareVersion>().get<i>());
2004 };
2005
2006 template<>
2007 struct tuple_size<Zivid::FrameInfo::SystemInfo> : integral_constant<size_t, 3>
2008 {};
2009
2010 template<size_t i>
2011 struct tuple_element<i, Zivid::FrameInfo::SystemInfo>
2012 {
2013 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo>::value, "Index must be less than 3");
2014
2015 using type // NOLINT
2016 = decltype(declval<Zivid::FrameInfo::SystemInfo>().get<i>());
2017 };
2018
2019 template<>
2020 struct tuple_size<Zivid::FrameInfo::SystemInfo::CPU> : integral_constant<size_t, 1>
2021 {};
2022
2023 template<size_t i>
2024 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::CPU>
2025 {
2026 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::CPU>::value, "Index must be less than 1");
2027
2028 using type // NOLINT
2029 = decltype(declval<Zivid::FrameInfo::SystemInfo::CPU>().get<i>());
2030 };
2031
2032 template<>
2033 struct tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice> : integral_constant<size_t, 2>
2034 {};
2035
2036 template<size_t i>
2037 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::ComputeDevice>
2038 {
2039 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice>::value, "Index must be less than 2");
2040
2041 using type // NOLINT
2042 = decltype(declval<Zivid::FrameInfo::SystemInfo::ComputeDevice>().get<i>());
2043 };
2044
2045 template<>
2046 struct tuple_size<Zivid::FrameInfo> : integral_constant<size_t, 3>
2047 {};
2048
2049 template<size_t i>
2050 struct tuple_element<i, Zivid::FrameInfo>
2051 {
2052 static_assert(i < tuple_size<Zivid::FrameInfo>::value, "Index must be less than 3");
2053
2054 using type // NOLINT
2055 = decltype(declval<Zivid::FrameInfo>().get<i>());
2056 };
2057
2058} // namespace std
2059# endif
2060#endif
2061
2062// If we have access to the DataModel library, automatically include internal DataModel
2063// header. This header is necessary for serialization and deserialization.
2064#if defined(__has_include) && !defined(NO_DOC)
2065# if __has_include("Zivid/FrameInfoInternal.h") && __has_include("Zivid/DataModelSerializationMetaData.h")
2066# include "Zivid/FrameInfoInternal.h"
2067# endif
2068#endif
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Contains information about the compute device used by Zivid::Application.
Definition: ComputeDevice.h:103
Core version
Definition: FrameInfo.h:169
std::string toString() const
Get the value as string
const std::string & value() const
Get the value
bool operator!=(const Core &other) const
Comparison operator
Definition: FrameInfo.h:213
Core(std::string value)
Constructor
Definition: FrameInfo.h:196
bool operator==(const Core &other) const
Comparison operator
Definition: FrameInfo.h:207
Core()=default
Default constructor
bool operator>(const Core &other) const
Comparison operator
Definition: FrameInfo.h:225
bool operator<(const Core &other) const
Comparison operator
Definition: FrameInfo.h:219
friend std::ostream & operator<<(std::ostream &stream, const Core &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:231
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:184
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Core
Definition: FrameInfo.h:187
The version information for installed software at the time of image capture
Definition: FrameInfo.h:151
const Core & core() const
Get Core
Definition: FrameInfo.h:350
friend std::ostream & operator<<(std::ostream &stream, const SoftwareVersion &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:406
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:391
SoftwareVersion()
Default constructor
const FrameInfo::SoftwareVersion::Core & get() const
Definition: FrameInfo.h:371
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:330
Core & core()
Get Core
Definition: FrameInfo.h:356
SoftwareVersion(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:271
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:384
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:298
std::tuple< FrameInfo::SoftwareVersion::Core > Descendants
Definition: FrameInfo.h:244
SoftwareVersion & set(const Core &value)
Set Core
Definition: FrameInfo.h:362
std::string toString() const
Get the value as string
CPU model
Definition: FrameInfo.h:459
const std::string & value() const
Get the value
bool operator!=(const Model &other) const
Comparison operator
Definition: FrameInfo.h:503
Model()=default
Default constructor
bool operator<(const Model &other) const
Comparison operator
Definition: FrameInfo.h:509
std::string toString() const
Get the value as string
bool operator==(const Model &other) const
Comparison operator
Definition: FrameInfo.h:497
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:521
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model
Definition: FrameInfo.h:477
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:474
Model(std::string value)
Constructor
Definition: FrameInfo.h:486
bool operator>(const Model &other) const
Comparison operator
Definition: FrameInfo.h:515
CPU
Definition: FrameInfo.h:443
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:683
const Model & model() const
Get Model
Definition: FrameInfo.h:642
std::tuple< FrameInfo::SystemInfo::CPU::Model > Descendants
Definition: FrameInfo.h:534
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:676
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:698
CPU(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:561
CPU & set(const Model &value)
Set Model
Definition: FrameInfo.h:654
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:588
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:621
Model & model()
Get Model
Definition: FrameInfo.h:648
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition: FrameInfo.h:663
Compute device model
Definition: FrameInfo.h:733
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model
Definition: FrameInfo.h:751
std::string toString() const
Get the value as string
Model(std::string value)
Constructor
Definition: FrameInfo.h:760
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:748
const std::string & value() const
Get the value
bool operator==(const Model &other) const
Comparison operator
Definition: FrameInfo.h:771
bool operator!=(const Model &other) const
Comparison operator
Definition: FrameInfo.h:777
bool operator>(const Model &other) const
Comparison operator
Definition: FrameInfo.h:789
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:795
bool operator<(const Model &other) const
Comparison operator
Definition: FrameInfo.h:783
Compute device vendor
Definition: FrameInfo.h:810
bool operator>(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:866
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Vendor
Definition: FrameInfo.h:828
friend std::ostream & operator<<(std::ostream &stream, const Vendor &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:872
bool operator<(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:860
bool operator==(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:848
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:825
std::string toString() const
Get the value as string
const std::string & value() const
Get the value
bool operator!=(const Vendor &other) const
Comparison operator
Definition: FrameInfo.h:854
Vendor(std::string value)
Constructor
Definition: FrameInfo.h:837
Compute device
Definition: FrameInfo.h:717
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:942
ComputeDevice & set(const Model &value)
Set Model
Definition: FrameInfo.h:1009
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:1066
const Vendor & vendor() const
Get Vendor
Definition: FrameInfo.h:1016
ComputeDevice(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:914
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:1074
Model & model()
Get Model
Definition: FrameInfo.h:1003
Vendor & vendor()
Get Vendor
Definition: FrameInfo.h:1022
bool operator==(const ComputeDevice &other) const
Equality operator
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition: FrameInfo.h:1047
const Model & model() const
Get Model
Definition: FrameInfo.h:997
friend std::ostream & operator<<(std::ostream &stream, const ComputeDevice &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:1090
std::tuple< FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor > Descendants
Definition: FrameInfo.h:886
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:1028
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:976
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition: FrameInfo.h:1038
Operating system
Definition: FrameInfo.h:1110
bool operator>(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1166
OperatingSystem(std::string value)
Constructor
Definition: FrameInfo.h:1137
bool operator!=(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1154
bool operator<(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1160
bool operator==(const OperatingSystem &other) const
Comparison operator
Definition: FrameInfo.h:1148
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:1125
OperatingSystem()=default
Default constructor
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:1172
std::string toString() const
Get the value as string
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for OperatingSystem
Definition: FrameInfo.h:1128
Information about the system that captured this frame
Definition: FrameInfo.h:425
SystemInfo & set(const CPU::Model &value)
Set CPU::Model
Definition: FrameInfo.h:1331
std::string toString() const
Get the value as string
const FrameInfo::SystemInfo::CPU & get() const
Definition: FrameInfo.h:1392
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:1459
ComputeDevice & computeDevice()
Get ComputeDevice
Definition: FrameInfo.h:1344
SystemInfo & set(const ComputeDevice &value)
Set ComputeDevice
Definition: FrameInfo.h:1350
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition: FrameInfo.h:1426
SystemInfo & set(const CPU &value)
Set CPU
Definition: FrameInfo.h:1324
bool operator==(const SystemInfo &other) const
Equality operator
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:1255
friend std::ostream & operator<<(std::ostream &stream, const SystemInfo &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:1485
const ComputeDevice & computeDevice() const
Get ComputeDevice
Definition: FrameInfo.h:1338
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:1468
SystemInfo & set(const ComputeDevice::Vendor &value)
Set ComputeDevice::Vendor
Definition: FrameInfo.h:1364
SystemInfo & set(const OperatingSystem &value)
Set OperatingSystem
Definition: FrameInfo.h:1383
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:1292
bool operator!=(const SystemInfo &other) const
Inequality operator
SystemInfo & set(const ComputeDevice::Model &value)
Set ComputeDevice::Model
Definition: FrameInfo.h:1357
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition: FrameInfo.h:1434
CPU & cpu()
Get CPU
Definition: FrameInfo.h:1318
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition: FrameInfo.h:1408
SystemInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:1223
const OperatingSystem & operatingSystem() const
Get OperatingSystem
Definition: FrameInfo.h:1371
OperatingSystem & operatingSystem()
Get OperatingSystem
Definition: FrameInfo.h:1377
SystemInfo()
Default constructor
const CPU & cpu() const
Get CPU
Definition: FrameInfo.h:1312
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition: FrameInfo.h:1417
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition: FrameInfo.h:1400
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:1191
The time of frame capture
Definition: FrameInfo.h:1506
std::chrono::system_clock::time_point value() const
Get the value
bool operator>(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1562
bool operator<(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1556
static constexpr Range< std::chrono::system_clock::time_point > validRange()
The range of valid values for TimeStamp
Definition: FrameInfo.h:1524
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:1568
TimeStamp()=default
Default constructor
constexpr TimeStamp(std::chrono::system_clock::time_point value)
Constructor
Definition: FrameInfo.h:1533
bool operator!=(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1550
bool operator==(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:1544
std::chrono::system_clock::time_point ValueType
The type of the underlying value
Definition: FrameInfo.h:1521
Various information for a frame
Definition: FrameInfo.h:121
TimeStamp & timeStamp()
Get TimeStamp
Definition: FrameInfo.h:1818
std::string toString() const
Get the value as string
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:1923
const FrameInfo::SoftwareVersion::Core & get() const
Definition: FrameInfo.h:1839
FrameInfo & set(const SystemInfo::ComputeDevice &value)
Set SystemInfo::ComputeDevice
Definition: FrameInfo.h:1784
FrameInfo()
Default constructor
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:1665
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition: FrameInfo.h:1875
FrameInfo & set(const SystemInfo::OperatingSystem &value)
Set SystemInfo::OperatingSystem
Definition: FrameInfo.h:1805
void save(const std::string &fileName) const
Save to the given file
const SystemInfo & systemInfo() const
Get SystemInfo
Definition: FrameInfo.h:1751
FrameInfo & set(const SystemInfo &value)
Set SystemInfo
Definition: FrameInfo.h:1763
const TimeStamp & timeStamp() const
Get TimeStamp
Definition: FrameInfo.h:1812
SoftwareVersion & softwareVersion()
Get SoftwareVersion
Definition: FrameInfo.h:1731
FrameInfo(const std::string &fileName)
Construct FrameInfo by loading from file
FrameInfo & set(const SystemInfo::ComputeDevice::Vendor &value)
Set SystemInfo::ComputeDevice::Vendor
Definition: FrameInfo.h:1798
const FrameInfo::SoftwareVersion & get() const
Definition: FrameInfo.h:1831
friend std::ostream & operator<<(std::ostream &stream, const FrameInfo &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:1949
FrameInfo & set(const TimeStamp &value)
Set TimeStamp
Definition: FrameInfo.h:1824
FrameInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:1629
const FrameInfo::TimeStamp & get() const
Definition: FrameInfo.h:1898
const SoftwareVersion & softwareVersion() const
Get SoftwareVersion
Definition: FrameInfo.h:1725
FrameInfo & set(const SystemInfo::CPU::Model &value)
Set SystemInfo::CPU::Model
Definition: FrameInfo.h:1777
FrameInfo & set(const SystemInfo::ComputeDevice::Model &value)
Set SystemInfo::ComputeDevice::Model
Definition: FrameInfo.h:1791
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition: FrameInfo.h:1859
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition: FrameInfo.h:1884
FrameInfo & set(const SoftwareVersion &value)
Set SoftwareVersion
Definition: FrameInfo.h:1737
const FrameInfo::SystemInfo & get() const
Definition: FrameInfo.h:1845
std::tuple< FrameInfo::SoftwareVersion, FrameInfo::SoftwareVersion::Core, FrameInfo::SystemInfo, FrameInfo::SystemInfo::CPU, FrameInfo::SystemInfo::CPU::Model, FrameInfo::SystemInfo::ComputeDevice, FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor, FrameInfo::SystemInfo::OperatingSystem, FrameInfo::TimeStamp > Descendants
Definition: FrameInfo.h:1591
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition: FrameInfo.h:1867
FrameInfo & set(const SoftwareVersion::Core &value)
Set SoftwareVersion::Core
Definition: FrameInfo.h:1744
SystemInfo & systemInfo()
Get SystemInfo
Definition: FrameInfo.h:1757
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:1932
bool operator==(const FrameInfo &other) const
Equality operator
FrameInfo & set(const SystemInfo::CPU &value)
Set SystemInfo::CPU
Definition: FrameInfo.h:1770
const FrameInfo::SystemInfo::CPU & get() const
Definition: FrameInfo.h:1851
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:1706
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition: FrameInfo.h:1892
Class describing a range of values for a given type T
Definition: Range.h:102
NodeType
Definition: NodeType.h:100
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99