Zivid C++ API 2.11.1+de9b5dae-1
FrameInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2024 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <set>
53#include <sstream>
54#include <string>
55#include <tuple>
56#include <utility>
57#include <vector>
58
64#include "Zivid/Range.h"
65
66#ifdef _MSC_VER
67# pragma warning(push)
68# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
69#endif
70
71namespace Zivid
72{
73
75
76 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
78 {
79 public:
81 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
82
84 static constexpr const char *path{ "" };
85
87 static constexpr const char *name{ "FrameInfo" };
88
90 static constexpr const char *description{ R"description(Various information for a frame)description" };
91
92 static constexpr size_t version{ 3 };
93
94#ifndef NO_DOC
95 template<size_t>
96 struct Version;
97
98 using LatestVersion = Zivid::FrameInfo;
99
100 // Short identifier. This value is not guaranteed to be universally unique
101 // Todo(ZIVID-2808): Move this to internal DataModelExt header
102 static constexpr std::array<uint8_t, 3> binaryId{ 'f', 'i', 'f' };
103
104#endif
105
107
108 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
110 {
111 public:
113 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
114
116 static constexpr const char *path{ "SoftwareVersion" };
117
119 static constexpr const char *name{ "SoftwareVersion" };
120
122 static constexpr const char *description{
123 R"description(The version information for installed software at the time of image capture)description"
124 };
125
127
128 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
130 {
131 public:
133 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
134
136 static constexpr const char *path{ "SoftwareVersion/Core" };
137
139 static constexpr const char *name{ "Core" };
140
142 static constexpr const char *description{ R"description(Core version)description" };
143
145 using ValueType = std::string;
146
149 {
150 return { 0, std::numeric_limits<ValueType::size_type>::max() };
151 }
152
154 Core() = default;
155
157 explicit Core(std::string value)
158 : m_value{ std::move(value) }
159 {}
160
162 const std::string &value() const;
163
165 std::string toString() const;
166
168 bool operator==(const Core &other) const
169 {
170 return m_value == other.m_value;
171 }
172
174 bool operator!=(const Core &other) const
175 {
176 return m_value != other.m_value;
177 }
178
180 bool operator<(const Core &other) const
181 {
182 return m_value < other.m_value;
183 }
184
186 bool operator>(const Core &other) const
187 {
188 return m_value > other.m_value;
189 }
190
192 bool operator<=(const Core &other) const
193 {
194 return m_value <= other.m_value;
195 }
196
198 bool operator>=(const Core &other) const
199 {
200 return m_value >= other.m_value;
201 }
202
204 friend std::ostream &operator<<(std::ostream &stream, const Core &value)
205 {
206 return stream << value.toString();
207 }
208
209 private:
210 void setFromString(const std::string &value);
211
212 std::string m_value{ "No-version" };
213
214 friend struct DataModel::Detail::Befriend<Core>;
215 };
216
217 using Descendants = std::tuple<FrameInfo::SoftwareVersion::Core>;
218
221
233#ifndef NO_DOC
234 template<
235 typename... Args,
236 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
237 typename std::enable_if<
238 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
239 value,
240 int>::type = 0>
241#else
242 template<typename... Args>
243#endif
244 explicit SoftwareVersion(Args &&...args)
245 {
246 using namespace Zivid::Detail::TypeTraits;
247
248 static_assert(
249 AllArgsDecayedAreUnique<Args...>::value,
250 "Found duplicate types among the arguments passed to SoftwareVersion(...). "
251 "Types should be listed at most once.");
252
253 set(std::forward<Args>(args)...);
254 }
255
266#ifndef NO_DOC
267 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
268#else
269 template<typename... Args>
270#endif
271 void set(Args &&...args)
272 {
273 using namespace Zivid::Detail::TypeTraits;
274
275 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
276 static_assert(
277 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
278
279 static_assert(
280 AllArgsDecayedAreUnique<Args...>::value,
281 "Found duplicate types among the arguments passed to set(...). "
282 "Types should be listed at most once.");
283
284 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
285 }
286
298#ifndef NO_DOC
299 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
300#else
301 template<typename... Args>
302#endif
303 SoftwareVersion copyWith(Args &&...args) const
304 {
305 using namespace Zivid::Detail::TypeTraits;
306
307 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
308 static_assert(
309 AllArgsAreDescendantNodes::value,
310 "All arguments passed to copyWith(...) must be descendant nodes.");
311
312 static_assert(
313 AllArgsDecayedAreUnique<Args...>::value,
314 "Found duplicate types among the arguments passed to copyWith(...). "
315 "Types should be listed at most once.");
316
317 auto copy{ *this };
318 copy.set(std::forward<Args>(args)...);
319 return copy;
320 }
321
323 const Core &core() const
324 {
325 return m_core;
326 }
327
330 {
331 return m_core;
332 }
333
335 SoftwareVersion &set(const Core &value)
336 {
337 m_core = value;
338 return *this;
339 }
340
341 template<
342 typename T,
343 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
345 {
346 return m_core;
347 }
348
349 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
351 {
352 return m_core;
353 }
354
356 template<typename F>
357 void forEach(const F &f) const
358 {
359 f(m_core);
360 }
361
363 template<typename F>
364 void forEach(const F &f)
365 {
366 f(m_core);
367 }
368
370 bool operator==(const SoftwareVersion &other) const;
371
373 bool operator!=(const SoftwareVersion &other) const;
374
376 std::string toString() const;
377
379 friend std::ostream &operator<<(std::ostream &stream, const SoftwareVersion &value)
380 {
381 return stream << value.toString();
382 }
383
384 private:
385 void setFromString(const std::string &value);
386
387 void setFromString(const std::string &fullPath, const std::string &value);
388
389 std::string getString(const std::string &fullPath) const;
390
391 Core m_core;
392
393 friend struct DataModel::Detail::Befriend<SoftwareVersion>;
394 };
395
397
398 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
400 {
401 public:
403 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
404
406 static constexpr const char *path{ "SystemInfo" };
407
409 static constexpr const char *name{ "SystemInfo" };
410
412 static constexpr const char *description{
413 R"description(Information about the system that captured this frame)description"
414 };
415
417
418 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
420 {
421 public:
423 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
424
426 static constexpr const char *path{ "SystemInfo/CPU" };
427
429 static constexpr const char *name{ "CPU" };
430
432 static constexpr const char *description{ R"description(CPU)description" };
433
435
436 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
438 {
439 public:
441 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
442
444 static constexpr const char *path{ "SystemInfo/CPU/Model" };
445
447 static constexpr const char *name{ "Model" };
448
450 static constexpr const char *description{ R"description(CPU model)description" };
451
453 using ValueType = std::string;
454
457 {
458 return { 0, std::numeric_limits<ValueType::size_type>::max() };
459 }
460
462 Model() = default;
463
465 explicit Model(std::string value)
466 : m_value{ std::move(value) }
467 {}
468
470 const std::string &value() const;
471
473 std::string toString() const;
474
476 bool operator==(const Model &other) const
477 {
478 return m_value == other.m_value;
479 }
480
482 bool operator!=(const Model &other) const
483 {
484 return m_value != other.m_value;
485 }
486
488 bool operator<(const Model &other) const
489 {
490 return m_value < other.m_value;
491 }
492
494 bool operator>(const Model &other) const
495 {
496 return m_value > other.m_value;
497 }
498
500 bool operator<=(const Model &other) const
501 {
502 return m_value <= other.m_value;
503 }
504
506 bool operator>=(const Model &other) const
507 {
508 return m_value >= other.m_value;
509 }
510
512 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
513 {
514 return stream << value.toString();
515 }
516
517 private:
518 void setFromString(const std::string &value);
519
520 std::string m_value{};
521
522 friend struct DataModel::Detail::Befriend<Model>;
523 };
524
525 using Descendants = std::tuple<FrameInfo::SystemInfo::CPU::Model>;
526
529
541#ifndef NO_DOC
542 template<
543 typename... Args,
544 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
545 typename std::enable_if<
546 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
547 value,
548 int>::type = 0>
549#else
550 template<typename... Args>
551#endif
552 explicit CPU(Args &&...args)
553 {
554 using namespace Zivid::Detail::TypeTraits;
555
556 static_assert(
557 AllArgsDecayedAreUnique<Args...>::value,
558 "Found duplicate types among the arguments passed to CPU(...). "
559 "Types should be listed at most once.");
560
561 set(std::forward<Args>(args)...);
562 }
563
574#ifndef NO_DOC
575 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
576#else
577 template<typename... Args>
578#endif
579 void set(Args &&...args)
580 {
581 using namespace Zivid::Detail::TypeTraits;
582
583 using AllArgsAreDescendantNodes =
584 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
585 static_assert(
586 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
587
588 static_assert(
589 AllArgsDecayedAreUnique<Args...>::value,
590 "Found duplicate types among the arguments passed to set(...). "
591 "Types should be listed at most once.");
592
593 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
594 }
595
607#ifndef NO_DOC
608 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
609#else
610 template<typename... Args>
611#endif
612 CPU copyWith(Args &&...args) const
613 {
614 using namespace Zivid::Detail::TypeTraits;
615
616 using AllArgsAreDescendantNodes =
617 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
618 static_assert(
619 AllArgsAreDescendantNodes::value,
620 "All arguments passed to copyWith(...) must be descendant nodes.");
621
622 static_assert(
623 AllArgsDecayedAreUnique<Args...>::value,
624 "Found duplicate types among the arguments passed to copyWith(...). "
625 "Types should be listed at most once.");
626
627 auto copy{ *this };
628 copy.set(std::forward<Args>(args)...);
629 return copy;
630 }
631
633 const Model &model() const
634 {
635 return m_model;
636 }
637
640 {
641 return m_model;
642 }
643
645 CPU &set(const Model &value)
646 {
647 m_model = value;
648 return *this;
649 }
650
651 template<
652 typename T,
653 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
655 {
656 return m_model;
657 }
658
659 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
661 {
662 return m_model;
663 }
664
666 template<typename F>
667 void forEach(const F &f) const
668 {
669 f(m_model);
670 }
671
673 template<typename F>
674 void forEach(const F &f)
675 {
676 f(m_model);
677 }
678
680 bool operator==(const CPU &other) const;
681
683 bool operator!=(const CPU &other) const;
684
686 std::string toString() const;
687
689 friend std::ostream &operator<<(std::ostream &stream, const CPU &value)
690 {
691 return stream << value.toString();
692 }
693
694 private:
695 void setFromString(const std::string &value);
696
697 void setFromString(const std::string &fullPath, const std::string &value);
698
699 std::string getString(const std::string &fullPath) const;
700
701 Model m_model;
702
703 friend struct DataModel::Detail::Befriend<CPU>;
704 };
705
707
708 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
710 {
711 public:
713 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
714
716 static constexpr const char *path{ "SystemInfo/ComputeDevice" };
717
719 static constexpr const char *name{ "ComputeDevice" };
720
722 static constexpr const char *description{ R"description(Compute device)description" };
723
725
726 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
728 {
729 public:
731 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
732
734 static constexpr const char *path{ "SystemInfo/ComputeDevice/Model" };
735
737 static constexpr const char *name{ "Model" };
738
740 static constexpr const char *description{ R"description(Compute device model)description" };
741
743 using ValueType = std::string;
744
747 {
748 return { 0, std::numeric_limits<ValueType::size_type>::max() };
749 }
750
752 Model() = default;
753
755 explicit Model(std::string value)
756 : m_value{ std::move(value) }
757 {}
758
760 const std::string &value() const;
761
763 std::string toString() const;
764
766 bool operator==(const Model &other) const
767 {
768 return m_value == other.m_value;
769 }
770
772 bool operator!=(const Model &other) const
773 {
774 return m_value != other.m_value;
775 }
776
778 bool operator<(const Model &other) const
779 {
780 return m_value < other.m_value;
781 }
782
784 bool operator>(const Model &other) const
785 {
786 return m_value > other.m_value;
787 }
788
790 bool operator<=(const Model &other) const
791 {
792 return m_value <= other.m_value;
793 }
794
796 bool operator>=(const Model &other) const
797 {
798 return m_value >= other.m_value;
799 }
800
802 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
803 {
804 return stream << value.toString();
805 }
806
807 private:
808 void setFromString(const std::string &value);
809
810 std::string m_value{};
811
812 friend struct DataModel::Detail::Befriend<Model>;
813 };
814
816
817 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
819 {
820 public:
822 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
823
825 static constexpr const char *path{ "SystemInfo/ComputeDevice/Vendor" };
826
828 static constexpr const char *name{ "Vendor" };
829
831 static constexpr const char *description{ R"description(Compute device vendor)description" };
832
834 using ValueType = std::string;
835
838 {
839 return { 0, std::numeric_limits<ValueType::size_type>::max() };
840 }
841
843 Vendor() = default;
844
846 explicit Vendor(std::string value)
847 : m_value{ std::move(value) }
848 {}
849
851 const std::string &value() const;
852
854 std::string toString() const;
855
857 bool operator==(const Vendor &other) const
858 {
859 return m_value == other.m_value;
860 }
861
863 bool operator!=(const Vendor &other) const
864 {
865 return m_value != other.m_value;
866 }
867
869 bool operator<(const Vendor &other) const
870 {
871 return m_value < other.m_value;
872 }
873
875 bool operator>(const Vendor &other) const
876 {
877 return m_value > other.m_value;
878 }
879
881 bool operator<=(const Vendor &other) const
882 {
883 return m_value <= other.m_value;
884 }
885
887 bool operator>=(const Vendor &other) const
888 {
889 return m_value >= other.m_value;
890 }
891
893 friend std::ostream &operator<<(std::ostream &stream, const Vendor &value)
894 {
895 return stream << value.toString();
896 }
897
898 private:
899 void setFromString(const std::string &value);
900
901 std::string m_value{};
902
903 friend struct DataModel::Detail::Befriend<Vendor>;
904 };
905
906 using Descendants = std::
907 tuple<FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor>;
908
911
924#ifndef NO_DOC
925 template<
926 typename... Args,
927 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
928 typename std::enable_if<
929 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
930 value,
931 int>::type = 0>
932#else
933 template<typename... Args>
934#endif
935 explicit ComputeDevice(Args &&...args)
936 {
937 using namespace Zivid::Detail::TypeTraits;
938
939 static_assert(
940 AllArgsDecayedAreUnique<Args...>::value,
941 "Found duplicate types among the arguments passed to ComputeDevice(...). "
942 "Types should be listed at most once.");
943
944 set(std::forward<Args>(args)...);
945 }
946
958#ifndef NO_DOC
959 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
960#else
961 template<typename... Args>
962#endif
963 void set(Args &&...args)
964 {
965 using namespace Zivid::Detail::TypeTraits;
966
967 using AllArgsAreDescendantNodes =
968 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
969 static_assert(
970 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
971
972 static_assert(
973 AllArgsDecayedAreUnique<Args...>::value,
974 "Found duplicate types among the arguments passed to set(...). "
975 "Types should be listed at most once.");
976
977 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
978 }
979
992#ifndef NO_DOC
993 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
994#else
995 template<typename... Args>
996#endif
997 ComputeDevice copyWith(Args &&...args) const
998 {
999 using namespace Zivid::Detail::TypeTraits;
1000
1001 using AllArgsAreDescendantNodes =
1002 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1003 static_assert(
1004 AllArgsAreDescendantNodes::value,
1005 "All arguments passed to copyWith(...) must be descendant nodes.");
1006
1007 static_assert(
1008 AllArgsDecayedAreUnique<Args...>::value,
1009 "Found duplicate types among the arguments passed to copyWith(...). "
1010 "Types should be listed at most once.");
1011
1012 auto copy{ *this };
1013 copy.set(std::forward<Args>(args)...);
1014 return copy;
1015 }
1016
1018 const Model &model() const
1019 {
1020 return m_model;
1021 }
1022
1025 {
1026 return m_model;
1027 }
1028
1030 ComputeDevice &set(const Model &value)
1031 {
1032 m_model = value;
1033 return *this;
1034 }
1035
1037 const Vendor &vendor() const
1038 {
1039 return m_vendor;
1040 }
1041
1044 {
1045 return m_vendor;
1046 }
1047
1049 ComputeDevice &set(const Vendor &value)
1050 {
1051 m_vendor = value;
1052 return *this;
1053 }
1054
1055 template<
1056 typename T,
1057 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1058 type = 0>
1060 {
1061 return m_model;
1062 }
1063
1064 template<
1065 typename T,
1066 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1067 type = 0>
1069 {
1070 return m_vendor;
1071 }
1072
1073 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1075 {
1076 return m_model;
1077 }
1078
1079 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1081 {
1082 return m_vendor;
1083 }
1084
1086 template<typename F>
1087 void forEach(const F &f) const
1088 {
1089 f(m_model);
1090 f(m_vendor);
1091 }
1092
1094 template<typename F>
1095 void forEach(const F &f)
1096 {
1097 f(m_model);
1098 f(m_vendor);
1099 }
1100
1102 bool operator==(const ComputeDevice &other) const;
1103
1105 bool operator!=(const ComputeDevice &other) const;
1106
1108 std::string toString() const;
1109
1111 friend std::ostream &operator<<(std::ostream &stream, const ComputeDevice &value)
1112 {
1113 return stream << value.toString();
1114 }
1115
1116 private:
1117 void setFromString(const std::string &value);
1118
1119 void setFromString(const std::string &fullPath, const std::string &value);
1120
1121 std::string getString(const std::string &fullPath) const;
1122
1123 Model m_model;
1124 Vendor m_vendor;
1125
1126 friend struct DataModel::Detail::Befriend<ComputeDevice>;
1127 };
1128
1130
1131 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1133 {
1134 public:
1136 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1137
1139 static constexpr const char *path{ "SystemInfo/OperatingSystem" };
1140
1142 static constexpr const char *name{ "OperatingSystem" };
1143
1145 static constexpr const char *description{ R"description(Operating system)description" };
1146
1148 using ValueType = std::string;
1149
1152 {
1153 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1154 }
1155
1157 OperatingSystem() = default;
1158
1160 explicit OperatingSystem(std::string value)
1161 : m_value{ std::move(value) }
1162 {}
1163
1165 const std::string &value() const;
1166
1168 std::string toString() const;
1169
1171 bool operator==(const OperatingSystem &other) const
1172 {
1173 return m_value == other.m_value;
1174 }
1175
1177 bool operator!=(const OperatingSystem &other) const
1178 {
1179 return m_value != other.m_value;
1180 }
1181
1183 bool operator<(const OperatingSystem &other) const
1184 {
1185 return m_value < other.m_value;
1186 }
1187
1189 bool operator>(const OperatingSystem &other) const
1190 {
1191 return m_value > other.m_value;
1192 }
1193
1195 bool operator<=(const OperatingSystem &other) const
1196 {
1197 return m_value <= other.m_value;
1198 }
1199
1201 bool operator>=(const OperatingSystem &other) const
1202 {
1203 return m_value >= other.m_value;
1204 }
1205
1207 friend std::ostream &operator<<(std::ostream &stream, const OperatingSystem &value)
1208 {
1209 return stream << value.toString();
1210 }
1211
1212 private:
1213 void setFromString(const std::string &value);
1214
1215 std::string m_value{};
1216
1217 friend struct DataModel::Detail::Befriend<OperatingSystem>;
1218 };
1219
1220 using Descendants = std::tuple<
1227
1230
1247#ifndef NO_DOC
1248 template<
1249 typename... Args,
1250 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1251 typename std::enable_if<
1252 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1253 value,
1254 int>::type = 0>
1255#else
1256 template<typename... Args>
1257#endif
1258 explicit SystemInfo(Args &&...args)
1259 {
1260 using namespace Zivid::Detail::TypeTraits;
1261
1262 static_assert(
1263 AllArgsDecayedAreUnique<Args...>::value,
1264 "Found duplicate types among the arguments passed to SystemInfo(...). "
1265 "Types should be listed at most once.");
1266
1267 set(std::forward<Args>(args)...);
1268 }
1269
1285#ifndef NO_DOC
1286 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1287#else
1288 template<typename... Args>
1289#endif
1290 void set(Args &&...args)
1291 {
1292 using namespace Zivid::Detail::TypeTraits;
1293
1294 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1295 static_assert(
1296 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1297
1298 static_assert(
1299 AllArgsDecayedAreUnique<Args...>::value,
1300 "Found duplicate types among the arguments passed to set(...). "
1301 "Types should be listed at most once.");
1302
1303 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1304 }
1305
1322#ifndef NO_DOC
1323 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1324#else
1325 template<typename... Args>
1326#endif
1327 SystemInfo copyWith(Args &&...args) const
1328 {
1329 using namespace Zivid::Detail::TypeTraits;
1330
1331 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1332 static_assert(
1333 AllArgsAreDescendantNodes::value,
1334 "All arguments passed to copyWith(...) must be descendant nodes.");
1335
1336 static_assert(
1337 AllArgsDecayedAreUnique<Args...>::value,
1338 "Found duplicate types among the arguments passed to copyWith(...). "
1339 "Types should be listed at most once.");
1340
1341 auto copy{ *this };
1342 copy.set(std::forward<Args>(args)...);
1343 return copy;
1344 }
1345
1347 const CPU &cpu() const
1348 {
1349 return m_cpu;
1350 }
1351
1354 {
1355 return m_cpu;
1356 }
1357
1359 SystemInfo &set(const CPU &value)
1360 {
1361 m_cpu = value;
1362 return *this;
1363 }
1364
1367 {
1368 m_cpu.set(value);
1369 return *this;
1370 }
1371
1374 {
1375 return m_computeDevice;
1376 }
1377
1380 {
1381 return m_computeDevice;
1382 }
1383
1386 {
1387 m_computeDevice = value;
1388 return *this;
1389 }
1390
1393 {
1394 m_computeDevice.set(value);
1395 return *this;
1396 }
1397
1400 {
1401 m_computeDevice.set(value);
1402 return *this;
1403 }
1404
1407 {
1408 return m_operatingSystem;
1409 }
1410
1413 {
1414 return m_operatingSystem;
1415 }
1416
1419 {
1420 m_operatingSystem = value;
1421 return *this;
1422 }
1423
1424 template<
1425 typename T,
1426 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1428 {
1429 return m_cpu;
1430 }
1431
1432 template<
1433 typename T,
1434 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1436 {
1437 return m_cpu.get<FrameInfo::SystemInfo::CPU::Model>();
1438 }
1439
1440 template<
1441 typename T,
1442 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1444 {
1445 return m_computeDevice;
1446 }
1447
1448 template<
1449 typename T,
1450 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::
1451 type = 0>
1453 {
1454 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1455 }
1456
1457 template<
1458 typename T,
1459 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::
1460 type = 0>
1462 {
1463 return m_computeDevice.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1464 }
1465
1466 template<
1467 typename T,
1468 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1470 {
1471 return m_operatingSystem;
1472 }
1473
1474 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1476 {
1477 return m_cpu;
1478 }
1479
1480 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1482 {
1483 return m_computeDevice;
1484 }
1485
1486 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1488 {
1489 return m_operatingSystem;
1490 }
1491
1493 template<typename F>
1494 void forEach(const F &f) const
1495 {
1496 f(m_cpu);
1497 f(m_computeDevice);
1498 f(m_operatingSystem);
1499 }
1500
1502 template<typename F>
1503 void forEach(const F &f)
1504 {
1505 f(m_cpu);
1506 f(m_computeDevice);
1507 f(m_operatingSystem);
1508 }
1509
1511 bool operator==(const SystemInfo &other) const;
1512
1514 bool operator!=(const SystemInfo &other) const;
1515
1517 std::string toString() const;
1518
1520 friend std::ostream &operator<<(std::ostream &stream, const SystemInfo &value)
1521 {
1522 return stream << value.toString();
1523 }
1524
1525 private:
1526 void setFromString(const std::string &value);
1527
1528 void setFromString(const std::string &fullPath, const std::string &value);
1529
1530 std::string getString(const std::string &fullPath) const;
1531
1532 CPU m_cpu;
1533 ComputeDevice m_computeDevice;
1534 OperatingSystem m_operatingSystem;
1535
1536 friend struct DataModel::Detail::Befriend<SystemInfo>;
1537 };
1538
1540
1541 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1543 {
1544 public:
1546 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1547
1549 static constexpr const char *path{ "TimeStamp" };
1550
1552 static constexpr const char *name{ "TimeStamp" };
1553
1555 static constexpr const char *description{ R"description(The time of frame capture)description" };
1556
1558 using ValueType = std::chrono::system_clock::time_point;
1559
1562 {
1563 return { std::chrono::system_clock::time_point::min(), std::chrono::system_clock::time_point::max() };
1564 }
1565
1567 TimeStamp() = default;
1568
1570 explicit constexpr TimeStamp(std::chrono::system_clock::time_point value)
1571 : m_value{ value }
1572 {}
1573
1575 std::chrono::system_clock::time_point value() const;
1576
1578 std::string toString() const;
1579
1581 bool operator==(const TimeStamp &other) const
1582 {
1583 return m_value == other.m_value;
1584 }
1585
1587 bool operator!=(const TimeStamp &other) const
1588 {
1589 return m_value != other.m_value;
1590 }
1591
1593 bool operator<(const TimeStamp &other) const
1594 {
1595 return m_value < other.m_value;
1596 }
1597
1599 bool operator>(const TimeStamp &other) const
1600 {
1601 return m_value > other.m_value;
1602 }
1603
1605 bool operator<=(const TimeStamp &other) const
1606 {
1607 return m_value <= other.m_value;
1608 }
1609
1611 bool operator>=(const TimeStamp &other) const
1612 {
1613 return m_value >= other.m_value;
1614 }
1615
1617 friend std::ostream &operator<<(std::ostream &stream, const TimeStamp &value)
1618 {
1619 return stream << value.toString();
1620 }
1621
1622 private:
1623 void setFromString(const std::string &value);
1624
1625 std::chrono::system_clock::time_point m_value{};
1626
1627 friend struct DataModel::Detail::Befriend<TimeStamp>;
1628 };
1629
1630 using Descendants = std::tuple<
1641
1644
1646 explicit FrameInfo(const std::string &fileName);
1647
1668#ifndef NO_DOC
1669 template<
1670 typename... Args,
1671 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1672 typename std::enable_if<
1673 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1674 int>::type = 0>
1675#else
1676 template<typename... Args>
1677#endif
1678 explicit FrameInfo(Args &&...args)
1679 {
1680 using namespace Zivid::Detail::TypeTraits;
1681
1682 static_assert(
1683 AllArgsDecayedAreUnique<Args...>::value,
1684 "Found duplicate types among the arguments passed to FrameInfo(...). "
1685 "Types should be listed at most once.");
1686
1687 set(std::forward<Args>(args)...);
1688 }
1689
1709#ifndef NO_DOC
1710 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1711#else
1712 template<typename... Args>
1713#endif
1714 void set(Args &&...args)
1715 {
1716 using namespace Zivid::Detail::TypeTraits;
1717
1718 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1719 static_assert(
1720 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1721
1722 static_assert(
1723 AllArgsDecayedAreUnique<Args...>::value,
1724 "Found duplicate types among the arguments passed to set(...). "
1725 "Types should be listed at most once.");
1726
1727 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1728 }
1729
1750#ifndef NO_DOC
1751 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1752#else
1753 template<typename... Args>
1754#endif
1755 FrameInfo copyWith(Args &&...args) const
1756 {
1757 using namespace Zivid::Detail::TypeTraits;
1758
1759 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1760 static_assert(
1761 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1762
1763 static_assert(
1764 AllArgsDecayedAreUnique<Args...>::value,
1765 "Found duplicate types among the arguments passed to copyWith(...). "
1766 "Types should be listed at most once.");
1767
1768 auto copy{ *this };
1769 copy.set(std::forward<Args>(args)...);
1770 return copy;
1771 }
1772
1775 {
1776 return m_softwareVersion;
1777 }
1778
1781 {
1782 return m_softwareVersion;
1783 }
1784
1787 {
1788 m_softwareVersion = value;
1789 return *this;
1790 }
1791
1794 {
1795 m_softwareVersion.set(value);
1796 return *this;
1797 }
1798
1800 const SystemInfo &systemInfo() const
1801 {
1802 return m_systemInfo;
1803 }
1804
1807 {
1808 return m_systemInfo;
1809 }
1810
1812 FrameInfo &set(const SystemInfo &value)
1813 {
1814 m_systemInfo = value;
1815 return *this;
1816 }
1817
1820 {
1821 m_systemInfo.set(value);
1822 return *this;
1823 }
1824
1827 {
1828 m_systemInfo.set(value);
1829 return *this;
1830 }
1831
1834 {
1835 m_systemInfo.set(value);
1836 return *this;
1837 }
1838
1841 {
1842 m_systemInfo.set(value);
1843 return *this;
1844 }
1845
1848 {
1849 m_systemInfo.set(value);
1850 return *this;
1851 }
1852
1855 {
1856 m_systemInfo.set(value);
1857 return *this;
1858 }
1859
1861 const TimeStamp &timeStamp() const
1862 {
1863 return m_timeStamp;
1864 }
1865
1868 {
1869 return m_timeStamp;
1870 }
1871
1873 FrameInfo &set(const TimeStamp &value)
1874 {
1875 m_timeStamp = value;
1876 return *this;
1877 }
1878
1879 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion>::value, int>::type = 0>
1881 {
1882 return m_softwareVersion;
1883 }
1884
1885 template<
1886 typename T,
1887 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value, int>::type = 0>
1889 {
1890 return m_softwareVersion.get<FrameInfo::SoftwareVersion::Core>();
1891 }
1892
1893 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo>::value, int>::type = 0>
1895 {
1896 return m_systemInfo;
1897 }
1898
1899 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU>::value, int>::type = 0>
1901 {
1902 return m_systemInfo.get<FrameInfo::SystemInfo::CPU>();
1903 }
1904
1905 template<
1906 typename T,
1907 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::CPU::Model>::value, int>::type = 0>
1909 {
1910 return m_systemInfo.get<FrameInfo::SystemInfo::CPU::Model>();
1911 }
1912
1913 template<
1914 typename T,
1915 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice>::value, int>::type = 0>
1917 {
1918 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice>();
1919 }
1920
1921 template<
1922 typename T,
1923 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Model>::value, int>::type = 0>
1925 {
1926 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Model>();
1927 }
1928
1929 template<
1930 typename T,
1931 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::ComputeDevice::Vendor>::value, int>::type =
1932 0>
1934 {
1935 return m_systemInfo.get<FrameInfo::SystemInfo::ComputeDevice::Vendor>();
1936 }
1937
1938 template<
1939 typename T,
1940 typename std::enable_if<std::is_same<T, FrameInfo::SystemInfo::OperatingSystem>::value, int>::type = 0>
1942 {
1943 return m_systemInfo.get<FrameInfo::SystemInfo::OperatingSystem>();
1944 }
1945
1946 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::TimeStamp>::value, int>::type = 0>
1948 {
1949 return m_timeStamp;
1950 }
1951
1952 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1954 {
1955 return m_softwareVersion;
1956 }
1957
1958 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1960 {
1961 return m_systemInfo;
1962 }
1963
1964 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1966 {
1967 return m_timeStamp;
1968 }
1969
1971 template<typename F>
1972 void forEach(const F &f) const
1973 {
1974 f(m_softwareVersion);
1975 f(m_systemInfo);
1976 f(m_timeStamp);
1977 }
1978
1980 template<typename F>
1981 void forEach(const F &f)
1982 {
1983 f(m_softwareVersion);
1984 f(m_systemInfo);
1985 f(m_timeStamp);
1986 }
1987
1989 bool operator==(const FrameInfo &other) const;
1990
1992 bool operator!=(const FrameInfo &other) const;
1993
1995 std::string toString() const;
1996
1998 friend std::ostream &operator<<(std::ostream &stream, const FrameInfo &value)
1999 {
2000 return stream << value.toString();
2001 }
2002
2004 void save(const std::string &fileName) const;
2005
2007 void load(const std::string &fileName);
2008
2009 private:
2010 void setFromString(const std::string &value);
2011
2012 void setFromString(const std::string &fullPath, const std::string &value);
2013
2014 std::string getString(const std::string &fullPath) const;
2015
2016 SoftwareVersion m_softwareVersion;
2017 SystemInfo m_systemInfo;
2018 TimeStamp m_timeStamp;
2019
2020 friend struct DataModel::Detail::Befriend<FrameInfo>;
2021 };
2022
2023#ifndef NO_DOC
2025 namespace Detail
2026 {
2027 ZIVID_CORE_EXPORT void save(const FrameInfo &dataModel, std::ostream &ostream);
2028 ZIVID_CORE_EXPORT void load(FrameInfo &dataModel, std::istream &istream);
2029 } // namespace Detail
2030#endif
2031
2032#ifndef NO_DOC
2033 template<>
2034 struct FrameInfo::Version<3>
2035 {
2036 using Type = FrameInfo;
2037 };
2038#endif
2039
2040} // namespace Zivid
2041
2042#ifdef _MSC_VER
2043# pragma warning(pop)
2044#endif
2045
2046#ifndef NO_DOC
2047# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2048namespace std // NOLINT
2049{
2050
2051 template<>
2052 struct tuple_size<Zivid::FrameInfo::SoftwareVersion> : integral_constant<size_t, 1>
2053 {};
2054
2055 template<size_t i>
2056 struct tuple_element<i, Zivid::FrameInfo::SoftwareVersion>
2057 {
2058 static_assert(i < tuple_size<Zivid::FrameInfo::SoftwareVersion>::value, "Index must be less than 1");
2059
2060 using type // NOLINT
2061 = decltype(declval<Zivid::FrameInfo::SoftwareVersion>().get<i>());
2062 };
2063
2064 template<>
2065 struct tuple_size<Zivid::FrameInfo::SystemInfo> : integral_constant<size_t, 3>
2066 {};
2067
2068 template<size_t i>
2069 struct tuple_element<i, Zivid::FrameInfo::SystemInfo>
2070 {
2071 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo>::value, "Index must be less than 3");
2072
2073 using type // NOLINT
2074 = decltype(declval<Zivid::FrameInfo::SystemInfo>().get<i>());
2075 };
2076
2077 template<>
2078 struct tuple_size<Zivid::FrameInfo::SystemInfo::CPU> : integral_constant<size_t, 1>
2079 {};
2080
2081 template<size_t i>
2082 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::CPU>
2083 {
2084 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::CPU>::value, "Index must be less than 1");
2085
2086 using type // NOLINT
2087 = decltype(declval<Zivid::FrameInfo::SystemInfo::CPU>().get<i>());
2088 };
2089
2090 template<>
2091 struct tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice> : integral_constant<size_t, 2>
2092 {};
2093
2094 template<size_t i>
2095 struct tuple_element<i, Zivid::FrameInfo::SystemInfo::ComputeDevice>
2096 {
2097 static_assert(i < tuple_size<Zivid::FrameInfo::SystemInfo::ComputeDevice>::value, "Index must be less than 2");
2098
2099 using type // NOLINT
2100 = decltype(declval<Zivid::FrameInfo::SystemInfo::ComputeDevice>().get<i>());
2101 };
2102
2103 template<>
2104 struct tuple_size<Zivid::FrameInfo> : integral_constant<size_t, 3>
2105 {};
2106
2107 template<size_t i>
2108 struct tuple_element<i, Zivid::FrameInfo>
2109 {
2110 static_assert(i < tuple_size<Zivid::FrameInfo>::value, "Index must be less than 3");
2111
2112 using type // NOLINT
2113 = decltype(declval<Zivid::FrameInfo>().get<i>());
2114 };
2115
2116} // namespace std
2117# endif
2118#endif
2119
2120// If we have access to the DataModel library, automatically include internal DataModel
2121// header. This header is necessary for serialization and deserialization.
2122#if defined(__has_include) && !defined(NO_DOC)
2123# if __has_include("Zivid/FrameInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
2124# include "Zivid/FrameInfoInternal.h"
2125# endif
2126#endif
#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:130
std::string toString() const
Get the value as string.
bool operator>=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:198
const std::string & value() const
Get the value.
bool operator!=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:174
Core(std::string value)
Constructor.
Definition FrameInfo.h:157
bool operator==(const Core &other) const
Comparison operator.
Definition FrameInfo.h:168
Core()=default
Default constructor.
bool operator>(const Core &other) const
Comparison operator.
Definition FrameInfo.h:186
bool operator<(const Core &other) const
Comparison operator.
Definition FrameInfo.h:180
friend std::ostream & operator<<(std::ostream &stream, const Core &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:204
bool operator<=(const Core &other) const
Comparison operator.
Definition FrameInfo.h:192
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:145
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Core.
Definition FrameInfo.h:148
The version information for installed software at the time of image capture.
Definition FrameInfo.h:110
const Core & core() const
Get Core.
Definition FrameInfo.h:323
friend std::ostream & operator<<(std::ostream &stream, const SoftwareVersion &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:379
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:364
SoftwareVersion()
Default constructor.
const FrameInfo::SoftwareVersion::Core & get() const
Definition FrameInfo.h:344
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:303
Core & core()
Get Core.
Definition FrameInfo.h:329
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:357
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:271
std::tuple< FrameInfo::SoftwareVersion::Core > Descendants
Definition FrameInfo.h:217
SoftwareVersion & set(const Core &value)
Set Core.
Definition FrameInfo.h:335
std::string toString() const
Get the value as string.
CPU model.
Definition FrameInfo.h:438
const std::string & value() const
Get the value.
bool operator!=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:482
Model()=default
Default constructor.
bool operator<(const Model &other) const
Comparison operator.
Definition FrameInfo.h:488
std::string toString() const
Get the value as string.
bool operator==(const Model &other) const
Comparison operator.
Definition FrameInfo.h:476
bool operator>=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:506
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:512
bool operator<=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:500
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model.
Definition FrameInfo.h:456
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:453
Model(std::string value)
Constructor.
Definition FrameInfo.h:465
bool operator>(const Model &other) const
Comparison operator.
Definition FrameInfo.h:494
CPU.
Definition FrameInfo.h:420
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:674
const Model & model() const
Get Model.
Definition FrameInfo.h:633
std::tuple< FrameInfo::SystemInfo::CPU::Model > Descendants
Definition FrameInfo.h:525
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:667
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:689
CPU & set(const Model &value)
Set Model.
Definition FrameInfo.h:645
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:579
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:612
Model & model()
Get Model.
Definition FrameInfo.h:639
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:654
Compute device model.
Definition FrameInfo.h:728
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Model.
Definition FrameInfo.h:746
std::string toString() const
Get the value as string.
bool operator<=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:790
Model(std::string value)
Constructor.
Definition FrameInfo.h:755
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:743
const std::string & value() const
Get the value.
bool operator==(const Model &other) const
Comparison operator.
Definition FrameInfo.h:766
bool operator!=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:772
bool operator>=(const Model &other) const
Comparison operator.
Definition FrameInfo.h:796
bool operator>(const Model &other) const
Comparison operator.
Definition FrameInfo.h:784
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:802
bool operator<(const Model &other) const
Comparison operator.
Definition FrameInfo.h:778
Compute device vendor.
Definition FrameInfo.h:819
bool operator>(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:875
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Vendor.
Definition FrameInfo.h:837
friend std::ostream & operator<<(std::ostream &stream, const Vendor &value)
Operator to serialize the value to a stream.
Definition FrameInfo.h:893
bool operator>=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:887
bool operator<(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:869
bool operator==(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:857
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:834
std::string toString() const
Get the value as string.
bool operator<=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:881
const std::string & value() const
Get the value.
bool operator!=(const Vendor &other) const
Comparison operator.
Definition FrameInfo.h:863
Vendor(std::string value)
Constructor.
Definition FrameInfo.h:846
Compute device.
Definition FrameInfo.h:710
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:963
ComputeDevice & set(const Model &value)
Set Model.
Definition FrameInfo.h:1030
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:1087
const Vendor & vendor() const
Get Vendor.
Definition FrameInfo.h:1037
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1095
Model & model()
Get Model.
Definition FrameInfo.h:1024
Vendor & vendor()
Get Vendor.
Definition FrameInfo.h:1043
bool operator==(const ComputeDevice &other) const
Equality operator.
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1068
const Model & model() const
Get Model.
Definition FrameInfo.h:1018
friend std::ostream & operator<<(std::ostream &stream, const ComputeDevice &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:1111
std::tuple< FrameInfo::SystemInfo::ComputeDevice::Model, FrameInfo::SystemInfo::ComputeDevice::Vendor > Descendants
Definition FrameInfo.h:907
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:1049
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:997
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1059
Operating system.
Definition FrameInfo.h:1133
bool operator>(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1189
OperatingSystem(std::string value)
Constructor.
Definition FrameInfo.h:1160
bool operator!=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1177
bool operator<(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1183
bool operator>=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1201
bool operator==(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1171
std::string ValueType
The type of the underlying value.
Definition FrameInfo.h:1148
OperatingSystem()=default
Default constructor.
bool operator<=(const OperatingSystem &other) const
Comparison operator.
Definition FrameInfo.h:1195
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:1207
std::string toString() const
Get the value as string.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for OperatingSystem.
Definition FrameInfo.h:1151
Information about the system that captured this frame.
Definition FrameInfo.h:400
SystemInfo & set(const CPU::Model &value)
Set CPU::Model.
Definition FrameInfo.h:1366
std::string toString() const
Get the value as string.
const FrameInfo::SystemInfo::CPU & get() const
Definition FrameInfo.h:1427
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:1494
ComputeDevice & computeDevice()
Get ComputeDevice.
Definition FrameInfo.h:1379
SystemInfo & set(const ComputeDevice &value)
Set ComputeDevice.
Definition FrameInfo.h:1385
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1461
SystemInfo & set(const CPU &value)
Set CPU.
Definition FrameInfo.h:1359
bool operator==(const SystemInfo &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1290
friend std::ostream & operator<<(std::ostream &stream, const SystemInfo &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:1520
const ComputeDevice & computeDevice() const
Get ComputeDevice.
Definition FrameInfo.h:1373
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition FrameInfo.h:1503
SystemInfo & set(const ComputeDevice::Vendor &value)
Set ComputeDevice::Vendor.
Definition FrameInfo.h:1399
SystemInfo & set(const OperatingSystem &value)
Set OperatingSystem.
Definition FrameInfo.h:1418
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:1327
bool operator!=(const SystemInfo &other) const
Inequality operator.
SystemInfo & set(const ComputeDevice::Model &value)
Set ComputeDevice::Model.
Definition FrameInfo.h:1392
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition FrameInfo.h:1469
CPU & cpu()
Get CPU.
Definition FrameInfo.h:1353
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition FrameInfo.h:1443
const OperatingSystem & operatingSystem() const
Get OperatingSystem.
Definition FrameInfo.h:1406
OperatingSystem & operatingSystem()
Get OperatingSystem.
Definition FrameInfo.h:1412
SystemInfo()
Default constructor.
const CPU & cpu() const
Get CPU.
Definition FrameInfo.h:1347
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1452
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:1435
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:1226
The time of frame capture.
Definition FrameInfo.h:1543
std::chrono::system_clock::time_point value() const
Get the value.
bool operator>(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1599
bool operator<(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1593
bool operator<=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1605
static constexpr Range< std::chrono::system_clock::time_point > validRange()
The range of valid values for TimeStamp.
Definition FrameInfo.h:1561
bool operator>=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1611
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:1617
TimeStamp()=default
Default constructor.
constexpr TimeStamp(std::chrono::system_clock::time_point value)
Constructor.
Definition FrameInfo.h:1570
bool operator!=(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1587
bool operator==(const TimeStamp &other) const
Comparison operator.
Definition FrameInfo.h:1581
std::chrono::system_clock::time_point ValueType
The type of the underlying value.
Definition FrameInfo.h:1558
Various information for a frame.
Definition FrameInfo.h:78
TimeStamp & timeStamp()
Get TimeStamp.
Definition FrameInfo.h:1867
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:1972
const FrameInfo::SoftwareVersion::Core & get() const
Definition FrameInfo.h:1888
FrameInfo & set(const SystemInfo::ComputeDevice &value)
Set SystemInfo::ComputeDevice.
Definition FrameInfo.h:1833
FrameInfo()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition FrameInfo.h:1714
const FrameInfo::SystemInfo::ComputeDevice::Model & get() const
Definition FrameInfo.h:1924
FrameInfo & set(const SystemInfo::OperatingSystem &value)
Set SystemInfo::OperatingSystem.
Definition FrameInfo.h:1854
void save(const std::string &fileName) const
Save to the given file.
const SystemInfo & systemInfo() const
Get SystemInfo.
Definition FrameInfo.h:1800
FrameInfo & set(const SystemInfo &value)
Set SystemInfo.
Definition FrameInfo.h:1812
const TimeStamp & timeStamp() const
Get TimeStamp.
Definition FrameInfo.h:1861
SoftwareVersion & softwareVersion()
Get SoftwareVersion.
Definition FrameInfo.h:1780
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:1847
const FrameInfo::SoftwareVersion & get() const
Definition FrameInfo.h:1880
friend std::ostream & operator<<(std::ostream &stream, const FrameInfo &value)
Operator to send the value as string to a stream.
Definition FrameInfo.h:1998
FrameInfo & set(const TimeStamp &value)
Set TimeStamp.
Definition FrameInfo.h:1873
FrameInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition FrameInfo.h:1678
const FrameInfo::TimeStamp & get() const
Definition FrameInfo.h:1947
const SoftwareVersion & softwareVersion() const
Get SoftwareVersion.
Definition FrameInfo.h:1774
FrameInfo & set(const SystemInfo::CPU::Model &value)
Set SystemInfo::CPU::Model.
Definition FrameInfo.h:1826
FrameInfo & set(const SystemInfo::ComputeDevice::Model &value)
Set SystemInfo::ComputeDevice::Model.
Definition FrameInfo.h:1840
const FrameInfo::SystemInfo::CPU::Model & get() const
Definition FrameInfo.h:1908
const FrameInfo::SystemInfo::ComputeDevice::Vendor & get() const
Definition FrameInfo.h:1933
FrameInfo & set(const SoftwareVersion &value)
Set SoftwareVersion.
Definition FrameInfo.h:1786
const FrameInfo::SystemInfo & get() const
Definition FrameInfo.h:1894
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:1640
const FrameInfo::SystemInfo::ComputeDevice & get() const
Definition FrameInfo.h:1916
FrameInfo & set(const SoftwareVersion::Core &value)
Set SoftwareVersion::Core.
Definition FrameInfo.h:1793
SystemInfo & systemInfo()
Get SystemInfo.
Definition FrameInfo.h:1806
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:1981
bool operator==(const FrameInfo &other) const
Equality operator.
FrameInfo & set(const SystemInfo::CPU &value)
Set SystemInfo::CPU.
Definition FrameInfo.h:1819
const FrameInfo::SystemInfo::CPU & get() const
Definition FrameInfo.h:1900
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:1755
const FrameInfo::SystemInfo::OperatingSystem & get() const
Definition FrameInfo.h:1941
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:54