Zivid C++ API 2.13.1+18e79e79-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
65#include "Zivid/Range.h"
66
67#ifdef _MSC_VER
68# pragma warning(push)
69# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
70#endif
71
72namespace Zivid
73{
74
76
77 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
79 {
80 public:
82 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
83
85 static constexpr const char *path{ "" };
86
88 static constexpr const char *name{ "FrameInfo" };
89
91 static constexpr const char *description{ R"description(Various information for a frame)description" };
92
93 static constexpr size_t version{ 3 };
94
95#ifndef NO_DOC
96 template<size_t>
97 struct Version;
98
99 using LatestVersion = Zivid::FrameInfo;
100
101 // Short identifier. This value is not guaranteed to be universally unique
102 // Todo(ZIVID-2808): Move this to internal DataModelExt header
103 static constexpr std::array<uint8_t, 3> binaryId{ 'f', 'i', 'f' };
104
105#endif
106
108
109 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
111 {
112 public:
114 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
115
117 static constexpr const char *path{ "SoftwareVersion" };
118
120 static constexpr const char *name{ "SoftwareVersion" };
121
123 static constexpr const char *description{
124 R"description(The version information for installed software at the time of image capture)description"
125 };
126
128
129 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
131 {
132 public:
134 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
135
137 static constexpr const char *path{ "SoftwareVersion/Core" };
138
140 static constexpr const char *name{ "Core" };
141
143 static constexpr const char *description{ R"description(Core version)description" };
144
146 using ValueType = std::string;
147
150 {
151 return { 0, std::numeric_limits<ValueType::size_type>::max() };
152 }
153
155 Core() = default;
156
158 explicit Core(std::string value)
159 : m_value{ std::move(value) }
160 {}
161
163 const std::string &value() const;
164
166 std::string toString() const;
167
169 bool operator==(const Core &other) const
170 {
171 return m_value == other.m_value;
172 }
173
175 bool operator!=(const Core &other) const
176 {
177 return m_value != other.m_value;
178 }
179
181 bool operator<(const Core &other) const
182 {
183 return m_value < other.m_value;
184 }
185
187 bool operator>(const Core &other) const
188 {
189 return m_value > other.m_value;
190 }
191
193 bool operator<=(const Core &other) const
194 {
195 return m_value <= other.m_value;
196 }
197
199 bool operator>=(const Core &other) const
200 {
201 return m_value >= other.m_value;
202 }
203
205 friend std::ostream &operator<<(std::ostream &stream, const Core &value)
206 {
207 return stream << value.toString();
208 }
209
210 private:
211 void setFromString(const std::string &value);
212
213 std::string m_value{ "No-version" };
214
215 friend struct DataModel::Detail::Befriend<Core>;
216 };
217
218 using Descendants = std::tuple<FrameInfo::SoftwareVersion::Core>;
219
222
234#ifndef NO_DOC
235 template<
236 typename... Args,
237 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
238 typename std::enable_if<
239 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
240 value,
241 int>::type = 0>
242#else
243 template<typename... Args>
244#endif
245 explicit SoftwareVersion(Args &&...args)
246 {
247 using namespace Zivid::Detail::TypeTraits;
248
249 static_assert(
250 AllArgsDecayedAreUnique<Args...>::value,
251 "Found duplicate types among the arguments passed to SoftwareVersion(...). "
252 "Types should be listed at most once.");
253
254 set(std::forward<Args>(args)...);
255 }
256
267#ifndef NO_DOC
268 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
269#else
270 template<typename... Args>
271#endif
272 void set(Args &&...args)
273 {
274 using namespace Zivid::Detail::TypeTraits;
275
276 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
277 static_assert(
278 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
279
280 static_assert(
281 AllArgsDecayedAreUnique<Args...>::value,
282 "Found duplicate types among the arguments passed to set(...). "
283 "Types should be listed at most once.");
284
285 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
286 }
287
299#ifndef NO_DOC
300 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
301#else
302 template<typename... Args>
303#endif
304 SoftwareVersion copyWith(Args &&...args) const
305 {
306 using namespace Zivid::Detail::TypeTraits;
307
308 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
309 static_assert(
310 AllArgsAreDescendantNodes::value,
311 "All arguments passed to copyWith(...) must be descendant nodes.");
312
313 static_assert(
314 AllArgsDecayedAreUnique<Args...>::value,
315 "Found duplicate types among the arguments passed to copyWith(...). "
316 "Types should be listed at most once.");
317
318 auto copy{ *this };
319 copy.set(std::forward<Args>(args)...);
320 return copy;
321 }
322
324 const Core &core() const
325 {
326 return m_core;
327 }
328
331 {
332 return m_core;
333 }
334
336 SoftwareVersion &set(const Core &value)
337 {
338 m_core = value;
339 return *this;
340 }
341
342 template<
343 typename T,
344 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
346 {
347 return m_core;
348 }
349
350 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
352 {
353 return m_core;
354 }
355
357 template<typename F>
358 void forEach(const F &f) const
359 {
360 f(m_core);
361 }
362
364 template<typename F>
365 void forEach(const F &f)
366 {
367 f(m_core);
368 }
369
371 bool operator==(const SoftwareVersion &other) const;
372
374 bool operator!=(const SoftwareVersion &other) const;
375
377 std::string toString() const;
378
380 friend std::ostream &operator<<(std::ostream &stream, const SoftwareVersion &value)
381 {
382 return stream << value.toString();
383 }
384
385 private:
386 void setFromString(const std::string &value);
387
388 void setFromString(const std::string &fullPath, const std::string &value);
389
390 std::string getString(const std::string &fullPath) const;
391
392 Core m_core;
393
394 friend struct DataModel::Detail::Befriend<SoftwareVersion>;
395 };
396
398
399 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
401 {
402 public:
404 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
405
407 static constexpr const char *path{ "SystemInfo" };
408
410 static constexpr const char *name{ "SystemInfo" };
411
413 static constexpr const char *description{
414 R"description(Information about the system that captured this frame)description"
415 };
416
418
419 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
421 {
422 public:
424 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
425
427 static constexpr const char *path{ "SystemInfo/CPU" };
428
430 static constexpr const char *name{ "CPU" };
431
433 static constexpr const char *description{ R"description(CPU)description" };
434
436
437 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
439 {
440 public:
442 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
443
445 static constexpr const char *path{ "SystemInfo/CPU/Model" };
446
448 static constexpr const char *name{ "Model" };
449
451 static constexpr const char *description{ R"description(CPU model)description" };
452
454 using ValueType = std::string;
455
458 {
459 return { 0, std::numeric_limits<ValueType::size_type>::max() };
460 }
461
463 Model() = default;
464
466 explicit Model(std::string value)
467 : m_value{ std::move(value) }
468 {}
469
471 const std::string &value() const;
472
474 std::string toString() const;
475
477 bool operator==(const Model &other) const
478 {
479 return m_value == other.m_value;
480 }
481
483 bool operator!=(const Model &other) const
484 {
485 return m_value != other.m_value;
486 }
487
489 bool operator<(const Model &other) const
490 {
491 return m_value < other.m_value;
492 }
493
495 bool operator>(const Model &other) const
496 {
497 return m_value > other.m_value;
498 }
499
501 bool operator<=(const Model &other) const
502 {
503 return m_value <= other.m_value;
504 }
505
507 bool operator>=(const Model &other) const
508 {
509 return m_value >= other.m_value;
510 }
511
513 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
514 {
515 return stream << value.toString();
516 }
517
518 private:
519 void setFromString(const std::string &value);
520
521 std::string m_value{};
522
523 friend struct DataModel::Detail::Befriend<Model>;
524 };
525
526 using Descendants = std::tuple<FrameInfo::SystemInfo::CPU::Model>;
527
530
542#ifndef NO_DOC
543 template<
544 typename... Args,
545 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
546 typename std::enable_if<
547 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
548 value,
549 int>::type = 0>
550#else
551 template<typename... Args>
552#endif
553 explicit CPU(Args &&...args)
554 {
555 using namespace Zivid::Detail::TypeTraits;
556
557 static_assert(
558 AllArgsDecayedAreUnique<Args...>::value,
559 "Found duplicate types among the arguments passed to CPU(...). "
560 "Types should be listed at most once.");
561
562 set(std::forward<Args>(args)...);
563 }
564
575#ifndef NO_DOC
576 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
577#else
578 template<typename... Args>
579#endif
580 void set(Args &&...args)
581 {
582 using namespace Zivid::Detail::TypeTraits;
583
584 using AllArgsAreDescendantNodes =
585 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
586 static_assert(
587 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
588
589 static_assert(
590 AllArgsDecayedAreUnique<Args...>::value,
591 "Found duplicate types among the arguments passed to set(...). "
592 "Types should be listed at most once.");
593
594 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
595 }
596
608#ifndef NO_DOC
609 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
610#else
611 template<typename... Args>
612#endif
613 CPU copyWith(Args &&...args) const
614 {
615 using namespace Zivid::Detail::TypeTraits;
616
617 using AllArgsAreDescendantNodes =
618 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
619 static_assert(
620 AllArgsAreDescendantNodes::value,
621 "All arguments passed to copyWith(...) must be descendant nodes.");
622
623 static_assert(
624 AllArgsDecayedAreUnique<Args...>::value,
625 "Found duplicate types among the arguments passed to copyWith(...). "
626 "Types should be listed at most once.");
627
628 auto copy{ *this };
629 copy.set(std::forward<Args>(args)...);
630 return copy;
631 }
632
634 const Model &model() const
635 {
636 return m_model;
637 }
638
641 {
642 return m_model;
643 }
644
646 CPU &set(const Model &value)
647 {
648 m_model = value;
649 return *this;
650 }
651
652 template<
653 typename T,
654 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
656 {
657 return m_model;
658 }
659
660 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
662 {
663 return m_model;
664 }
665
667 template<typename F>
668 void forEach(const F &f) const
669 {
670 f(m_model);
671 }
672
674 template<typename F>
675 void forEach(const F &f)
676 {
677 f(m_model);
678 }
679
681 bool operator==(const CPU &other) const;
682
684 bool operator!=(const CPU &other) const;
685
687 std::string toString() const;
688
690 friend std::ostream &operator<<(std::ostream &stream, const CPU &value)
691 {
692 return stream << value.toString();
693 }
694
695 private:
696 void setFromString(const std::string &value);
697
698 void setFromString(const std::string &fullPath, const std::string &value);
699
700 std::string getString(const std::string &fullPath) const;
701
702 Model m_model;
703
704 friend struct DataModel::Detail::Befriend<CPU>;
705 };
706
708
709 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
711 {
712 public:
714 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
715
717 static constexpr const char *path{ "SystemInfo/ComputeDevice" };
718
720 static constexpr const char *name{ "ComputeDevice" };
721
723 static constexpr const char *description{ R"description(Compute device)description" };
724
726
727 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
729 {
730 public:
732 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
733
735 static constexpr const char *path{ "SystemInfo/ComputeDevice/Model" };
736
738 static constexpr const char *name{ "Model" };
739
741 static constexpr const char *description{ R"description(Compute device model)description" };
742
744 using ValueType = std::string;
745
748 {
749 return { 0, std::numeric_limits<ValueType::size_type>::max() };
750 }
751
753 Model() = default;
754
756 explicit Model(std::string value)
757 : m_value{ std::move(value) }
758 {}
759
761 const std::string &value() const;
762
764 std::string toString() const;
765
767 bool operator==(const Model &other) const
768 {
769 return m_value == other.m_value;
770 }
771
773 bool operator!=(const Model &other) const
774 {
775 return m_value != other.m_value;
776 }
777
779 bool operator<(const Model &other) const
780 {
781 return m_value < other.m_value;
782 }
783
785 bool operator>(const Model &other) const
786 {
787 return m_value > other.m_value;
788 }
789
791 bool operator<=(const Model &other) const
792 {
793 return m_value <= other.m_value;
794 }
795
797 bool operator>=(const Model &other) const
798 {
799 return m_value >= other.m_value;
800 }
801
803 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
804 {
805 return stream << value.toString();
806 }
807
808 private:
809 void setFromString(const std::string &value);
810
811 std::string m_value{};
812
813 friend struct DataModel::Detail::Befriend<Model>;
814 };
815
817
818 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
820 {
821 public:
823 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
824
826 static constexpr const char *path{ "SystemInfo/ComputeDevice/Vendor" };
827
829 static constexpr const char *name{ "Vendor" };
830
832 static constexpr const char *description{ R"description(Compute device vendor)description" };
833
835 using ValueType = std::string;
836
839 {
840 return { 0, std::numeric_limits<ValueType::size_type>::max() };
841 }
842
844 Vendor() = default;
845
847 explicit Vendor(std::string value)
848 : m_value{ std::move(value) }
849 {}
850
852 const std::string &value() const;
853
855 std::string toString() const;
856
858 bool operator==(const Vendor &other) const
859 {
860 return m_value == other.m_value;
861 }
862
864 bool operator!=(const Vendor &other) const
865 {
866 return m_value != other.m_value;
867 }
868
870 bool operator<(const Vendor &other) const
871 {
872 return m_value < other.m_value;
873 }
874
876 bool operator>(const Vendor &other) const
877 {
878 return m_value > other.m_value;
879 }
880
882 bool operator<=(const Vendor &other) const
883 {
884 return m_value <= other.m_value;
885 }
886
888 bool operator>=(const Vendor &other) const
889 {
890 return m_value >= other.m_value;
891 }
892
894 friend std::ostream &operator<<(std::ostream &stream, const Vendor &value)
895 {
896 return stream << value.toString();
897 }
898
899 private:
900 void setFromString(const std::string &value);
901
902 std::string m_value{};
903
904 friend struct DataModel::Detail::Befriend<Vendor>;
905 };
906
907 using Descendants = std::
908 tuple<FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor>;
909
912
925#ifndef NO_DOC
926 template<
927 typename... Args,
928 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
929 typename std::enable_if<
930 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
931 value,
932 int>::type = 0>
933#else
934 template<typename... Args>
935#endif
936 explicit ComputeDevice(Args &&...args)
937 {
938 using namespace Zivid::Detail::TypeTraits;
939
940 static_assert(
941 AllArgsDecayedAreUnique<Args...>::value,
942 "Found duplicate types among the arguments passed to ComputeDevice(...). "
943 "Types should be listed at most once.");
944
945 set(std::forward<Args>(args)...);
946 }
947
959#ifndef NO_DOC
960 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
961#else
962 template<typename... Args>
963#endif
964 void set(Args &&...args)
965 {
966 using namespace Zivid::Detail::TypeTraits;
967
968 using AllArgsAreDescendantNodes =
969 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
970 static_assert(
971 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
972
973 static_assert(
974 AllArgsDecayedAreUnique<Args...>::value,
975 "Found duplicate types among the arguments passed to set(...). "
976 "Types should be listed at most once.");
977
978 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
979 }
980
993#ifndef NO_DOC
994 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
995#else
996 template<typename... Args>
997#endif
998 ComputeDevice copyWith(Args &&...args) const
999 {
1000 using namespace Zivid::Detail::TypeTraits;
1001
1002 using AllArgsAreDescendantNodes =
1003 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1004 static_assert(
1005 AllArgsAreDescendantNodes::value,
1006 "All arguments passed to copyWith(...) must be descendant nodes.");
1007
1008 static_assert(
1009 AllArgsDecayedAreUnique<Args...>::value,
1010 "Found duplicate types among the arguments passed to copyWith(...). "
1011 "Types should be listed at most once.");
1012
1013 auto copy{ *this };
1014 copy.set(std::forward<Args>(args)...);
1015 return copy;
1016 }
1017
1019 const Model &model() const
1020 {
1021 return m_model;
1022 }
1023
1026 {
1027 return m_model;
1028 }
1029
1031 ComputeDevice &set(const Model &value)
1032 {
1033 m_model = value;
1034 return *this;
1035 }
1036
1038 const Vendor &vendor() const
1039 {
1040 return m_vendor;
1041 }
1042
1045 {
1046 return m_vendor;
1047 }
1048
1050 ComputeDevice &set(const Vendor &value)
1051 {
1052 m_vendor = value;
1053 return *this;
1054 }
1055
1056 template<
1057 typename T,
1058 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1059 type = 0>
1061 {
1062 return m_model;
1063 }
1064
1065 template<
1066 typename T,
1067 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1068 type = 0>
1070 {
1071 return m_vendor;
1072 }
1073
1074 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1076 {
1077 return m_model;
1078 }
1079
1080 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1082 {
1083 return m_vendor;
1084 }
1085
1087 template<typename F>
1088 void forEach(const F &f) const
1089 {
1090 f(m_model);
1091 f(m_vendor);
1092 }
1093
1095 template<typename F>
1096 void forEach(const F &f)
1097 {
1098 f(m_model);
1099 f(m_vendor);
1100 }
1101
1103 bool operator==(const ComputeDevice &other) const;
1104
1106 bool operator!=(const ComputeDevice &other) const;
1107
1109 std::string toString() const;
1110
1112 friend std::ostream &operator<<(std::ostream &stream, const ComputeDevice &value)
1113 {
1114 return stream << value.toString();
1115 }
1116
1117 private:
1118 void setFromString(const std::string &value);
1119
1120 void setFromString(const std::string &fullPath, const std::string &value);
1121
1122 std::string getString(const std::string &fullPath) const;
1123
1124 Model m_model;
1125 Vendor m_vendor;
1126
1127 friend struct DataModel::Detail::Befriend<ComputeDevice>;
1128 };
1129
1131
1132 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1134 {
1135 public:
1137 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1138
1140 static constexpr const char *path{ "SystemInfo/OperatingSystem" };
1141
1143 static constexpr const char *name{ "OperatingSystem" };
1144
1146 static constexpr const char *description{ R"description(Operating system)description" };
1147
1149 using ValueType = std::string;
1150
1153 {
1154 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1155 }
1156
1158 OperatingSystem() = default;
1159
1161 explicit OperatingSystem(std::string value)
1162 : m_value{ std::move(value) }
1163 {}
1164
1166 const std::string &value() const;
1167
1169 std::string toString() const;
1170
1172 bool operator==(const OperatingSystem &other) const
1173 {
1174 return m_value == other.m_value;
1175 }
1176
1178 bool operator!=(const OperatingSystem &other) const
1179 {
1180 return m_value != other.m_value;
1181 }
1182
1184 bool operator<(const OperatingSystem &other) const
1185 {
1186 return m_value < other.m_value;
1187 }
1188
1190 bool operator>(const OperatingSystem &other) const
1191 {
1192 return m_value > other.m_value;
1193 }
1194
1196 bool operator<=(const OperatingSystem &other) const
1197 {
1198 return m_value <= other.m_value;
1199 }
1200
1202 bool operator>=(const OperatingSystem &other) const
1203 {
1204 return m_value >= other.m_value;
1205 }
1206
1208 friend std::ostream &operator<<(std::ostream &stream, const OperatingSystem &value)
1209 {
1210 return stream << value.toString();
1211 }
1212
1213 private:
1214 void setFromString(const std::string &value);
1215
1216 std::string m_value{};
1217
1218 friend struct DataModel::Detail::Befriend<OperatingSystem>;
1219 };
1220
1221 using Descendants = std::tuple<
1228
1231
1248#ifndef NO_DOC
1249 template<
1250 typename... Args,
1251 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1252 typename std::enable_if<
1253 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1254 value,
1255 int>::type = 0>
1256#else
1257 template<typename... Args>
1258#endif
1259 explicit SystemInfo(Args &&...args)
1260 {
1261 using namespace Zivid::Detail::TypeTraits;
1262
1263 static_assert(
1264 AllArgsDecayedAreUnique<Args...>::value,
1265 "Found duplicate types among the arguments passed to SystemInfo(...). "
1266 "Types should be listed at most once.");
1267
1268 set(std::forward<Args>(args)...);
1269 }
1270
1286#ifndef NO_DOC
1287 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1288#else
1289 template<typename... Args>
1290#endif
1291 void set(Args &&...args)
1292 {
1293 using namespace Zivid::Detail::TypeTraits;
1294
1295 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1296 static_assert(
1297 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1298
1299 static_assert(
1300 AllArgsDecayedAreUnique<Args...>::value,
1301 "Found duplicate types among the arguments passed to set(...). "
1302 "Types should be listed at most once.");
1303
1304 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1305 }
1306
1323#ifndef NO_DOC
1324 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1325#else
1326 template<typename... Args>
1327#endif
1328 SystemInfo copyWith(Args &&...args) const
1329 {
1330 using namespace Zivid::Detail::TypeTraits;
1331
1332 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1333 static_assert(
1334 AllArgsAreDescendantNodes::value,
1335 "All arguments passed to copyWith(...) must be descendant nodes.");
1336
1337 static_assert(
1338 AllArgsDecayedAreUnique<Args...>::value,
1339 "Found duplicate types among the arguments passed to copyWith(...). "
1340 "Types should be listed at most once.");
1341
1342 auto copy{ *this };
1343 copy.set(std::forward<Args>(args)...);
1344 return copy;
1345 }
1346
1348 const CPU &cpu() const
1349 {
1350 return m_cpu;
1351 }
1352
1355 {
1356 return m_cpu;
1357 }
1358
1360 SystemInfo &set(const CPU &value)
1361 {
1362 m_cpu = value;
1363 return *this;
1364 }
1365
1368 {
1369 m_cpu.set(value);
1370 return *this;
1371 }
1372
1375 {
1376 return m_computeDevice;
1377 }
1378
1381 {
1382 return m_computeDevice;
1383 }
1384
1387 {
1388 m_computeDevice = value;
1389 return *this;
1390 }
1391
1394 {
1395 m_computeDevice.set(value);
1396 return *this;
1397 }
1398
1401 {
1402 m_computeDevice.set(value);
1403 return *this;
1404 }
1405
1408 {
1409 return m_operatingSystem;
1410 }
1411
1414 {
1415 return m_operatingSystem;
1416 }
1417
1420 {
1421 m_operatingSystem = value;
1422 return *this;
1423 }
1424
1425 template<
1426 typename T,
1427 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1429 {
1430 return m_cpu;
1431 }
1432
1433 template<
1434 typename T,
1435 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1437 {
1438 return m_cpu.get<FrameInfo::SystemInfo::CPU::Model>();
1439 }
1440
1441 template<
1442 typename T,
1443 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1445 {
1446 return m_computeDevice;
1447 }
1448
1449 template<
1450 typename T,
1451 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1452 type = 0>
1454 {
1455 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1456 }
1457
1458 template<
1459 typename T,
1460 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1461 type = 0>
1463 {
1464 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1465 }
1466
1467 template<
1468 typename T,
1469 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1471 {
1472 return m_operatingSystem;
1473 }
1474
1475 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1477 {
1478 return m_cpu;
1479 }
1480
1481 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1483 {
1484 return m_computeDevice;
1485 }
1486
1487 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1489 {
1490 return m_operatingSystem;
1491 }
1492
1494 template<typename F>
1495 void forEach(const F &f) const
1496 {
1497 f(m_cpu);
1498 f(m_computeDevice);
1499 f(m_operatingSystem);
1500 }
1501
1503 template<typename F>
1504 void forEach(const F &f)
1505 {
1506 f(m_cpu);
1507 f(m_computeDevice);
1508 f(m_operatingSystem);
1509 }
1510
1512 bool operator==(const SystemInfo &other) const;
1513
1515 bool operator!=(const SystemInfo &other) const;
1516
1518 std::string toString() const;
1519
1521 friend std::ostream &operator<<(std::ostream &stream, const SystemInfo &value)
1522 {
1523 return stream << value.toString();
1524 }
1525
1526 private:
1527 void setFromString(const std::string &value);
1528
1529 void setFromString(const std::string &fullPath, const std::string &value);
1530
1531 std::string getString(const std::string &fullPath) const;
1532
1533 CPU m_cpu;
1534 ComputeDevice m_computeDevice;
1535 OperatingSystem m_operatingSystem;
1536
1537 friend struct DataModel::Detail::Befriend<SystemInfo>;
1538 };
1539
1541
1542 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1544 {
1545 public:
1547 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1548
1550 static constexpr const char *path{ "TimeStamp" };
1551
1553 static constexpr const char *name{ "TimeStamp" };
1554
1556 static constexpr const char *description{ R"description(The time of frame capture)description" };
1557
1559 using ValueType = std::chrono::system_clock::time_point;
1560
1563 {
1564 return { std::chrono::system_clock::time_point::min(), std::chrono::system_clock::time_point::max() };
1565 }
1566
1568 TimeStamp() = default;
1569
1571 explicit constexpr TimeStamp(std::chrono::system_clock::time_point value)
1572 : m_value{ value }
1573 {}
1574
1576 std::chrono::system_clock::time_point value() const;
1577
1579 std::string toString() const;
1580
1582 bool operator==(const TimeStamp &other) const
1583 {
1584 return m_value == other.m_value;
1585 }
1586
1588 bool operator!=(const TimeStamp &other) const
1589 {
1590 return m_value != other.m_value;
1591 }
1592
1594 bool operator<(const TimeStamp &other) const
1595 {
1596 return m_value < other.m_value;
1597 }
1598
1600 bool operator>(const TimeStamp &other) const
1601 {
1602 return m_value > other.m_value;
1603 }
1604
1606 bool operator<=(const TimeStamp &other) const
1607 {
1608 return m_value <= other.m_value;
1609 }
1610
1612 bool operator>=(const TimeStamp &other) const
1613 {
1614 return m_value >= other.m_value;
1615 }
1616
1618 friend std::ostream &operator<<(std::ostream &stream, const TimeStamp &value)
1619 {
1620 return stream << value.toString();
1621 }
1622
1623 private:
1624 void setFromString(const std::string &value);
1625
1626 std::chrono::system_clock::time_point m_value{};
1627
1628 friend struct DataModel::Detail::Befriend<TimeStamp>;
1629 };
1630
1631 using Descendants = std::tuple<
1642
1645
1647 explicit FrameInfo(const std::string &fileName);
1648
1654 ZIVID_NODISCARD static FrameInfo fromSerialized(const std::string &value);
1655
1661 std::string serialize() const;
1662
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...>::value,
1689 int>::type = 0>
1690#else
1691 template<typename... Args>
1692#endif
1693 explicit FrameInfo(Args &&...args)
1694 {
1695 using namespace Zivid::Detail::TypeTraits;
1696
1697 static_assert(
1698 AllArgsDecayedAreUnique<Args...>::value,
1699 "Found duplicate types among the arguments passed to FrameInfo(...). "
1700 "Types should be listed at most once.");
1701
1702 set(std::forward<Args>(args)...);
1703 }
1704
1724#ifndef NO_DOC
1725 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1726#else
1727 template<typename... Args>
1728#endif
1729 void set(Args &&...args)
1730 {
1731 using namespace Zivid::Detail::TypeTraits;
1732
1733 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1734 static_assert(
1735 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1736
1737 static_assert(
1738 AllArgsDecayedAreUnique<Args...>::value,
1739 "Found duplicate types among the arguments passed to set(...). "
1740 "Types should be listed at most once.");
1741
1742 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1743 }
1744
1765#ifndef NO_DOC
1766 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1767#else
1768 template<typename... Args>
1769#endif
1770 FrameInfo copyWith(Args &&...args) const
1771 {
1772 using namespace Zivid::Detail::TypeTraits;
1773
1774 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1775 static_assert(
1776 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1777
1778 static_assert(
1779 AllArgsDecayedAreUnique<Args...>::value,
1780 "Found duplicate types among the arguments passed to copyWith(...). "
1781 "Types should be listed at most once.");
1782
1783 auto copy{ *this };
1784 copy.set(std::forward<Args>(args)...);
1785 return copy;
1786 }
1787
1790 {
1791 return m_softwareVersion;
1792 }
1793
1796 {
1797 return m_softwareVersion;
1798 }
1799
1802 {
1803 m_softwareVersion = value;
1804 return *this;
1805 }
1806
1809 {
1810 m_softwareVersion.set(value);
1811 return *this;
1812 }
1813
1815 const SystemInfo &systemInfo() const
1816 {
1817 return m_systemInfo;
1818 }
1819
1822 {
1823 return m_systemInfo;
1824 }
1825
1827 FrameInfo &set(const SystemInfo &value)
1828 {
1829 m_systemInfo = value;
1830 return *this;
1831 }
1832
1835 {
1836 m_systemInfo.set(value);
1837 return *this;
1838 }
1839
1842 {
1843 m_systemInfo.set(value);
1844 return *this;
1845 }
1846
1849 {
1850 m_systemInfo.set(value);
1851 return *this;
1852 }
1853
1856 {
1857 m_systemInfo.set(value);
1858 return *this;
1859 }
1860
1863 {
1864 m_systemInfo.set(value);
1865 return *this;
1866 }
1867
1870 {
1871 m_systemInfo.set(value);
1872 return *this;
1873 }
1874
1876 const TimeStamp &timeStamp() const
1877 {
1878 return m_timeStamp;
1879 }
1880
1883 {
1884 return m_timeStamp;
1885 }
1886
1888 FrameInfo &set(const TimeStamp &value)
1889 {
1890 m_timeStamp = value;
1891 return *this;
1892 }
1893
1894 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion>::value, int>::type = 0>
1896 {
1897 return m_softwareVersion;
1898 }
1899
1900 template<
1901 typename T,
1902 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
1904 {
1905 return m_softwareVersion.get<FrameInfo::SoftwareVersion::Core>();
1906 }
1907
1908 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo>::value, int>::type = 0>
1910 {
1911 return m_systemInfo;
1912 }
1913
1914 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1916 {
1917 return m_systemInfo.get<FrameInfo::SystemInfo::CPU>();
1918 }
1919
1920 template<
1921 typename T,
1922 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1924 {
1925 return m_systemInfo.get<FrameInfo::SystemInfo::CPU::Model>();
1926 }
1927
1928 template<
1929 typename T,
1930 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1932 {
1933 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice>();
1934 }
1935
1936 template<
1937 typename T,
1938 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::type = 0>
1940 {
1941 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1942 }
1943
1944 template<
1945 typename T,
1946 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::type =
1947 0>
1949 {
1950 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1951 }
1952
1953 template<
1954 typename T,
1955 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1957 {
1958 return m_systemInfo.get<FrameInfo::SystemInfo::OperatingSystem>();
1959 }
1960
1961 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::TimeStamp>::value, int>::type = 0>
1963 {
1964 return m_timeStamp;
1965 }
1966
1967 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1969 {
1970 return m_softwareVersion;
1971 }
1972
1973 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1975 {
1976 return m_systemInfo;
1977 }
1978
1979 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1981 {
1982 return m_timeStamp;
1983 }
1984
1986 template<typename F>
1987 void forEach(const F &f) const
1988 {
1989 f(m_softwareVersion);
1990 f(m_systemInfo);
1991 f(m_timeStamp);
1992 }
1993
1995 template<typename F>
1996 void forEach(const F &f)
1997 {
1998 f(m_softwareVersion);
1999 f(m_systemInfo);
2000 f(m_timeStamp);
2001 }
2002
2004 bool operator==(const FrameInfo &other) const;
2005
2007 bool operator!=(const FrameInfo &other) const;
2008
2010 std::string toString() const;
2011
2013 friend std::ostream &operator<<(std::ostream &stream, const FrameInfo &value)
2014 {
2015 return stream << value.toString();
2016 }
2017
2019 void save(const std::string &fileName) const;
2020
2022 void load(const std::string &fileName);
2023
2024 private:
2025 void setFromString(const std::string &value);
2026
2027 void setFromString(const std::string &fullPath, const std::string &value);
2028
2029 std::string getString(const std::string &fullPath) const;
2030
2031 SoftwareVersion m_softwareVersion;
2032 SystemInfo m_systemInfo;
2033 TimeStamp m_timeStamp;
2034
2035 friend struct DataModel::Detail::Befriend<FrameInfo>;
2036 };
2037
2038#ifndef NO_DOC
2040 namespace Detail
2041 {
2042 ZIVID_CORE_EXPORT void save(const FrameInfo &dataModel, std::ostream &ostream);
2043 ZIVID_CORE_EXPORT void load(FrameInfo &dataModel, std::istream &istream);
2044 } // namespace Detail
2045#endif
2046
2047#ifndef NO_DOC
2048 template<>
2049 struct FrameInfo::Version<3>
2050 {
2051 using Type = FrameInfo;
2052 };
2053#endif
2054
2055} // namespace Zivid
2056
2057#ifdef _MSC_VER
2058# pragma warning(pop)
2059#endif
2060
2061#ifndef NO_DOC
2062# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2063namespace std // NOLINT
2064{
2065
2066 template<>
2067 struct tuple_size<Zivid::FrameInfo::SoftwareVersion> : integral_constant<size_t, 1>
2068 {};
2069
2070 template<size_t i>
2071 struct tuple_element<i, Zivid::FrameInfo::SoftwareVersion>
2072 {
2073 static_assert(i < tuple_size<Zivid::FrameInfo::SoftwareVersion>::value, "Index must be less than 1");
2074
2075 using type // NOLINT
2076 = decltype(declval<Zivid::FrameInfo::SoftwareVersion>().get<i>());
2077 };
2078
2079 template<>
2080 struct tuple_size<Zivid::FrameInfo::SystemInfo> : integral_constant<size_t, 3>
2081 {};
2082
2083 template<size_t i>
2084 struct tuple_element<i, Zivid::FrameInfo::SystemInfo>
2085 {
2086 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo>::value, "Index must be less than 3");
2087
2088 using type // NOLINT
2089 = decltype(declval<Zivid::FrameInfo::SystemInfo>().get<i>());
2090 };
2091
2092 template<>
2093 struct tuple_size<Zivid::FrameInfo::SystemInfo::CPU> : integral_constant<size_t, 1>
2094 {};
2095
2096 template<size_t i>
2097 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::CPU>
2098 {
2099 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::CPU>::value, "Index must be less than 1");
2100
2101 using type // NOLINT
2102 = decltype(declval<Zivid::FrameInfo::SystemInfo::CPU>().get<i>());
2103 };
2104
2105 template<>
2106 struct tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice> : integral_constant<size_t, 2>
2107 {};
2108
2109 template<size_t i>
2110 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::ComputeDevice>
2111 {
2112 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice>::value, "Index must be less than 2");
2113
2114 using type // NOLINT
2115 = decltype(declval<Zivid::FrameInfo::SystemInfo::ComputeDevice>().get<i>());
2116 };
2117
2118 template<>
2119 struct tuple_size<Zivid::FrameInfo> : integral_constant<size_t, 3>
2120 {};
2121
2122 template<size_t i>
2123 struct tuple_element<i, Zivid::FrameInfo>
2124 {
2125 static_assert(i < tuple_size<Zivid::FrameInfo>::value, "Index must be less than 3");
2126
2127 using type // NOLINT
2128 = decltype(declval<Zivid::FrameInfo>().get<i>());
2129 };
2130
2131} // namespace std
2132# endif
2133#endif
2134
2135// If we have access to the DataModel library, automatically include internal DataModel
2136// header. This header is necessary for serialization and deserialization.
2137#if defined(__has_include) && !defined(NO_DOC)
2138# if __has_include("Zivid/FrameInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
2139# include "Zivid/FrameInfoInternal.h"
2140# endif
2141#endif
#define ZIVID_NODISCARD
Definition Attributes.h:49
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Contains information about the compute device used by Zivid::Application.
Definition ComputeDevice.h:58
Core version.
Definition FrameInfo.h:131
std::string toString() const
Get the value as string.
bool operator>=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:199
const std::string & value() const
Get the value.
bool operator!=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:175
Core(std::string value)
Constructor.
Definition FrameInfo.h:158
bool operator==(const Core &other) const
Comparison operator.
Definition FrameInfo.h:169
Core()=default
Default constructor.
bool operator>(const Core &other) const
Comparison operator.
Definition FrameInfo.h:187
bool operator<(const Core &other) const
Comparison operator.
Definition FrameInfo.h:181
friend std::ostream & operator<<(std::ostream &stream, const Core &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:205
bool operator<=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:193
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:146
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Core.
Definition FrameInfo.h:149
The version information for installed software at the time of image capture.
Definition FrameInfo.h:111
const Core & core() const
Get Core.
Definition FrameInfo.h:324
friend std::ostream & operator<<(std::ostream &stream, const SoftwareVersion &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:380
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:365
SoftwareVersion()
Default constructor.
const FrameInfo::SoftwareVersion::Core & get() const
Definition FrameInfo.h:345
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:304
Core & core()
Get Core.
Definition FrameInfo.h:330
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:358
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:272
std::tuple< FrameInfo::SoftwareVersion::Core > Descendants
Definition FrameInfo.h:218
SoftwareVersion & set(const Core &value)
Set Core.
Definition FrameInfo.h:336
std::string toString() const
Get the value as string.
CPU model.
Definition FrameInfo.h:439
const std::string & value() const
Get the value.
bool operator!=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:483
Model()=default
Default constructor.
bool operator<(const Model &other) const
Comparison operator.
Definition FrameInfo.h:489
std::string toString() const
Get the value as string.
bool operator==(const Model &other) const
Comparison operator.
Definition FrameInfo.h:477
bool operator>=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:507
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:513
bool operator<=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:501
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model.
Definition FrameInfo.h:457
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:454
Model(std::string value)
Constructor.
Definition FrameInfo.h:466
bool operator>(const Model &other) const
Comparison operator.
Definition FrameInfo.h:495
CPU.
Definition FrameInfo.h:421
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:675
const Model & model() const
Get Model.
Definition FrameInfo.h:634
std::tuple< FrameInfo::SystemInfo::CPU::Model > Descendants
Definition FrameInfo.h:526
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:668
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:690
CPU & set(const Model &value)
Set Model.
Definition FrameInfo.h:646
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:580
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:613
Model & model()
Get Model.
Definition FrameInfo.h:640
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:655
Compute device model.
Definition FrameInfo.h:729
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model.
Definition FrameInfo.h:747
std::string toString() const
Get the value as string.
bool operator<=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:791
Model(std::string value)
Constructor.
Definition FrameInfo.h:756
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:744
const std::string & value() const
Get the value.
bool operator==(const Model &other) const
Comparison operator.
Definition FrameInfo.h:767
bool operator!=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:773
bool operator>=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:797
bool operator>(const Model &other) const
Comparison operator.
Definition FrameInfo.h:785
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:803
bool operator<(const Model &other) const
Comparison operator.
Definition FrameInfo.h:779
Compute device vendor.
Definition FrameInfo.h:820
bool operator>(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:876
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Vendor.
Definition FrameInfo.h:838
friend std::ostream & operator<<(std::ostream &stream, const Vendor &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:894
bool operator>=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:888
bool operator<(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:870
bool operator==(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:858
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:835
std::string toString() const
Get the value as string.
bool operator<=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:882
const std::string & value() const
Get the value.
bool operator!=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:864
Vendor(std::string value)
Constructor.
Definition FrameInfo.h:847
Compute device.
Definition FrameInfo.h:711
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:964
ComputeDevice & set(const Model &value)
Set Model.
Definition FrameInfo.h:1031
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:1088
const Vendor & vendor() const
Get Vendor.
Definition FrameInfo.h:1038
std:: tuple< FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor > Descendants
Definition FrameInfo.h:907
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1096
Model & model()
Get Model.
Definition FrameInfo.h:1025
Vendor & vendor()
Get Vendor.
Definition FrameInfo.h:1044
bool operator==(const ComputeDevice &other) const
Equality operator.
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1069
const Model & model() const
Get Model.
Definition FrameInfo.h:1019
friend std::ostream & operator<<(std::ostream &stream, const ComputeDevice &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:1112
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:1050
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:998
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1060
Operating system.
Definition FrameInfo.h:1134
bool operator>(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1190
OperatingSystem(std::string value)
Constructor.
Definition FrameInfo.h:1161
bool operator!=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1178
bool operator<(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1184
bool operator>=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1202
bool operator==(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1172
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1149
OperatingSystem()=default
Default constructor.
bool operator<=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1196
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:1208
std::string toString() const
Get the value as string.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for OperatingSystem.
Definition FrameInfo.h:1152
Information about the system that captured this frame.
Definition FrameInfo.h:401
SystemInfo & set(const CPU::Model &value)
Set CPU::Model.
Definition FrameInfo.h:1367
std::string toString() const
Get the value as string.
const FrameInfo::SystemInfo::CPU & get() const
Definition FrameInfo.h:1428
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:1495
ComputeDevice & computeDevice()
Get ComputeDevice.
Definition FrameInfo.h:1380
SystemInfo & set(const ComputeDevice &value)
Set ComputeDevice.
Definition FrameInfo.h:1386
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1462
SystemInfo & set(const CPU &value)
Set CPU.
Definition FrameInfo.h:1360
bool operator==(const SystemInfo &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1291
friend std::ostream & operator<<(std::ostream &stream, const SystemInfo &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:1521
const ComputeDevice & computeDevice() const
Get ComputeDevice.
Definition FrameInfo.h:1374
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1504
SystemInfo & set(const ComputeDevice::Vendor &value)
Set ComputeDevice::Vendor.
Definition FrameInfo.h:1400
SystemInfo & set(const OperatingSystem &value)
Set OperatingSystem.
Definition FrameInfo.h:1419
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:1328
bool operator!=(const SystemInfo &other) const
Inequality operator.
SystemInfo & set(const ComputeDevice::Model &value)
Set ComputeDevice::Model.
Definition FrameInfo.h:1393
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition FrameInfo.h:1470
CPU & cpu()
Get CPU.
Definition FrameInfo.h:1354
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition FrameInfo.h:1444
const OperatingSystem & operatingSystem() const
Get OperatingSystem.
Definition FrameInfo.h:1407
OperatingSystem & operatingSystem()
Get OperatingSystem.
Definition FrameInfo.h:1413
SystemInfo()
Default constructor.
const CPU & cpu() const
Get CPU.
Definition FrameInfo.h:1348
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1453
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:1221
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:1436
The time of frame capture.
Definition FrameInfo.h:1544
std::chrono::system_clock::time_point value() const
Get the value.
bool operator>(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1600
bool operator<(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1594
bool operator<=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1606
static constexpr Range< std::chrono::system_clock::time_point > validRange()
The range of valid values for TimeStamp.
Definition FrameInfo.h:1562
bool operator>=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1612
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:1618
TimeStamp()=default
Default constructor.
constexpr TimeStamp(std::chrono::system_clock::time_point value)
Constructor.
Definition FrameInfo.h:1571
bool operator!=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1588
bool operator==(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1582
std::chrono::system_clock::time_point ValueType
The type of the underlying value.
Definition FrameInfo.h:1559
Various information for a frame.
Definition FrameInfo.h:79
TimeStamp & timeStamp()
Get TimeStamp.
Definition FrameInfo.h:1882
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:1987
const FrameInfo::SoftwareVersion::Core & get() const
Definition FrameInfo.h:1903
FrameInfo & set(const SystemInfo::ComputeDevice &value)
Set SystemInfo::ComputeDevice.
Definition FrameInfo.h:1848
FrameInfo()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1729
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1939
FrameInfo & set(const SystemInfo::OperatingSystem &value)
Set SystemInfo::OperatingSystem.
Definition FrameInfo.h:1869
void save(const std::string &fileName) const
Save to the given file.
const SystemInfo & systemInfo() const
Get SystemInfo.
Definition FrameInfo.h:1815
FrameInfo & set(const SystemInfo &value)
Set SystemInfo.
Definition FrameInfo.h:1827
const TimeStamp & timeStamp() const
Get TimeStamp.
Definition FrameInfo.h:1876
SoftwareVersion & softwareVersion()
Get SoftwareVersion.
Definition FrameInfo.h:1795
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:1862
const FrameInfo::SoftwareVersion & get() const
Definition FrameInfo.h:1895
friend std::ostream & operator<<(std::ostream &stream, const FrameInfo &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:2013
FrameInfo & set(const TimeStamp &value)
Set TimeStamp.
Definition FrameInfo.h:1888
FrameInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition FrameInfo.h:1693
const FrameInfo::TimeStamp & get() const
Definition FrameInfo.h:1962
const SoftwareVersion & softwareVersion() const
Get SoftwareVersion.
Definition FrameInfo.h:1789
FrameInfo & set(const SystemInfo::CPU::Model &value)
Set SystemInfo::CPU::Model.
Definition FrameInfo.h:1841
FrameInfo & set(const SystemInfo::ComputeDevice::Model &value)
Set SystemInfo::ComputeDevice::Model.
Definition FrameInfo.h:1855
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:1923
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1948
FrameInfo & set(const SoftwareVersion &value)
Set SoftwareVersion.
Definition FrameInfo.h:1801
const FrameInfo::SystemInfo & get() const
Definition FrameInfo.h:1909
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:1631
static ZIVID_NODISCARD FrameInfo fromSerialized(const std::string &value)
Construct a new FrameInfo instance from a previously serialized string.
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition FrameInfo.h:1931
FrameInfo & set(const SoftwareVersion::Core &value)
Set SoftwareVersion::Core.
Definition FrameInfo.h:1808
SystemInfo & systemInfo()
Get SystemInfo.
Definition FrameInfo.h:1821
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:1996
bool operator==(const FrameInfo &other) const
Equality operator.
FrameInfo & set(const SystemInfo::CPU &value)
Set SystemInfo::CPU.
Definition FrameInfo.h:1834
const FrameInfo::SystemInfo::CPU & get() const
Definition FrameInfo.h:1915
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:1770
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition FrameInfo.h:1956
Class describing a range of values for a given type T.
Definition Range.h:73
NodeType
Definition NodeType.h:55
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:56