Zivid C++ API 2.17.1+7516d437-1
CameraInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2025 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <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:
82
84 static constexpr const char *path{ "" };
85
87 static constexpr const char *name{ "CameraInfo" };
88
90 static constexpr const char *description{
91 R"description(Information about camera model, serial number etc.)description"
92 };
93
94 static constexpr size_t version{ 7 };
95
96#ifndef NO_DOC
97 template<size_t>
98 struct Version;
99
100 using LatestVersion = Zivid::CameraInfo;
101
102 // Short identifier. This value is not guaranteed to be universally unique
103 // Todo(ZIVID-2808): Move this to internal DataModelExt header
104 static constexpr std::array<uint8_t, 3> binaryId{ 'n', 'f', 'o' };
105
106#endif
107
109
110 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
112 {
113 public:
116
118 static constexpr const char *path{ "FirmwareVersion" };
119
121 static constexpr const char *name{ "FirmwareVersion" };
122
124 static constexpr const char *description{ R"description(The firmware version on the camera)description" };
125
127 using ValueType = std::string;
128
131 {
132 return { 0, 256 };
133 }
134
136 FirmwareVersion() = default;
137
139 explicit FirmwareVersion(std::string value)
140 : m_value{ verifyValue(std::move(value)) }
141 {}
142
144 const std::string &value() const;
145
147 std::string toString() const;
148
150 bool operator==(const FirmwareVersion &other) const
151 {
152 return m_value == other.m_value;
153 }
154
156 bool operator!=(const FirmwareVersion &other) const
157 {
158 return m_value != other.m_value;
159 }
160
162 bool operator<(const FirmwareVersion &other) const
163 {
164 return m_value < other.m_value;
165 }
166
168 bool operator>(const FirmwareVersion &other) const
169 {
170 return m_value > other.m_value;
171 }
172
174 bool operator<=(const FirmwareVersion &other) const
175 {
176 return m_value <= other.m_value;
177 }
178
180 bool operator>=(const FirmwareVersion &other) const
181 {
182 return m_value >= other.m_value;
183 }
184
186 friend std::ostream &operator<<(std::ostream &stream, const FirmwareVersion &value)
187 {
188 return stream << value.toString();
189 }
190
191 private:
192 void setFromString(const std::string &value);
193
194 ValueType static verifyValue(ValueType &&value)
195 {
196 return validSize().isInRange(value.size())
197 ? std::move(value)
198 : throw std::invalid_argument{ "Invalid FirmwareVersion size=" + std::to_string(value.size())
199 + ", valid size is {'max': 256}" };
200 }
201
202 std::string m_value{};
203
204 friend struct DataModel::Detail::Befriend<FirmwareVersion>;
205 };
206
210
211 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
213 {
214 public:
217
219 static constexpr const char *path{ "HardwareRevision" };
220
222 static constexpr const char *name{ "HardwareRevision" };
223
225 static constexpr const char *description{
226 R"description(Hardware revision of this camera. This corresponds to the revision string that is printed on the product
227label.
228)description"
229 };
230
232 using ValueType = std::string;
233
236 {
237 return { 0, 256 };
238 }
239
241 HardwareRevision() = default;
242
244 explicit HardwareRevision(std::string value)
245 : m_value{ verifyValue(std::move(value)) }
246 {}
247
249 const std::string &value() const;
250
252 std::string toString() const;
253
255 bool operator==(const HardwareRevision &other) const
256 {
257 return m_value == other.m_value;
258 }
259
261 bool operator!=(const HardwareRevision &other) const
262 {
263 return m_value != other.m_value;
264 }
265
267 bool operator<(const HardwareRevision &other) const
268 {
269 return m_value < other.m_value;
270 }
271
273 bool operator>(const HardwareRevision &other) const
274 {
275 return m_value > other.m_value;
276 }
277
279 bool operator<=(const HardwareRevision &other) const
280 {
281 return m_value <= other.m_value;
282 }
283
285 bool operator>=(const HardwareRevision &other) const
286 {
287 return m_value >= other.m_value;
288 }
289
291 friend std::ostream &operator<<(std::ostream &stream, const HardwareRevision &value)
292 {
293 return stream << value.toString();
294 }
295
296 private:
297 void setFromString(const std::string &value);
298
299 ValueType static verifyValue(ValueType &&value)
300 {
301 return validSize().isInRange(value.size())
302 ? std::move(value)
303 : throw std::invalid_argument{ "Invalid HardwareRevision size="
304 + std::to_string(value.size())
305 + ", valid size is {'max': 256}" };
306 }
307
308 std::string m_value{};
309
310 friend struct DataModel::Detail::Befriend<HardwareRevision>;
311 };
312
314
315 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
317 {
318 public:
321
323 static constexpr const char *path{ "Model" };
324
326 static constexpr const char *name{ "Model" };
327
329 static constexpr const char *description{ R"description(The model of the camera)description" };
330
332 enum class ValueType
333 {
346 };
350 static const Model zividTwo;
351 static const Model zividTwoL100;
352 static const Model zivid2PlusM130;
353 static const Model zivid2PlusM60;
354 static const Model zivid2PlusL110;
355 static const Model zivid2PlusMR130;
356 static const Model zivid2PlusMR60;
357 static const Model zivid2PlusLR110;
358 static const Model zivid3XL250;
359
361 static std::set<ValueType> validValues()
362 {
367 }
368
370 Model() = default;
371
373 explicit constexpr Model(ValueType value)
374 : m_value{ verifyValue(value) }
375 {}
376
379
381 std::string toString() const;
382
384 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
385 {
386 return stream << Model{ value }.toString();
387 }
388
390 bool operator==(const Model &other) const
391 {
392 return m_value == other.m_value;
393 }
394
396 bool operator!=(const Model &other) const
397 {
398 return m_value != other.m_value;
399 }
400
402 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
403 {
404 return stream << value.toString();
405 }
406
407 private:
408 void setFromString(const std::string &value);
409
410 constexpr ValueType static verifyValue(const ValueType &value)
411 {
412 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
413 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
414 || value == ValueType::zividTwoL100 || value == ValueType::zivid2PlusM130
415 || value == ValueType::zivid2PlusM60 || value == ValueType::zivid2PlusL110
416 || value == ValueType::zivid2PlusMR130 || value == ValueType::zivid2PlusMR60
417 || value == ValueType::zivid2PlusLR110 || value == ValueType::zivid3XL250
418 ? value
419 : throw std::invalid_argument{
420 "Invalid value: Model{ "
421 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
422 };
423 }
424
426
427 friend struct DataModel::Detail::Befriend<Model>;
428 };
429
433
434 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
436 {
437 public:
440
442 static constexpr const char *path{ "ModelName" };
443
445 static constexpr const char *name{ "ModelName" };
446
448 static constexpr const char *description{
449 R"description(The model name of the camera. This is a user-friendly display name that may contain spaces and special
450characters. We recommend to use `Model` instead if you want to programmatically check for camera model.
451)description"
452 };
453
455 using ValueType = std::string;
456
459 {
460 return { 0, 256 };
461 }
462
464 ModelName() = default;
465
467 explicit ModelName(std::string value)
468 : m_value{ verifyValue(std::move(value)) }
469 {}
470
472 const std::string &value() const;
473
475 std::string toString() const;
476
478 bool operator==(const ModelName &other) const
479 {
480 return m_value == other.m_value;
481 }
482
484 bool operator!=(const ModelName &other) const
485 {
486 return m_value != other.m_value;
487 }
488
490 bool operator<(const ModelName &other) const
491 {
492 return m_value < other.m_value;
493 }
494
496 bool operator>(const ModelName &other) const
497 {
498 return m_value > other.m_value;
499 }
500
502 bool operator<=(const ModelName &other) const
503 {
504 return m_value <= other.m_value;
505 }
506
508 bool operator>=(const ModelName &other) const
509 {
510 return m_value >= other.m_value;
511 }
512
514 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
515 {
516 return stream << value.toString();
517 }
518
519 private:
520 void setFromString(const std::string &value);
521
522 ValueType static verifyValue(ValueType &&value)
523 {
524 return validSize().isInRange(value.size())
525 ? std::move(value)
526 : throw std::invalid_argument{ "Invalid ModelName size=" + std::to_string(value.size())
527 + ", valid size is {'max': 256}" };
528 }
529
530 std::string m_value{};
531
532 friend struct DataModel::Detail::Befriend<ModelName>;
533 };
534
538
539 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
541 {
542 public:
545
547 static constexpr const char *path{ "Revision" };
548
550 static constexpr const char *name{ "Revision" };
551
553 static constexpr const char *description{
554 R"description(Major/Minor hardware revision number. This field is deprecated and may be removed in a future version
555of the SDK. Please use HardwareRevision instead.
556)description"
557 };
558
562
563 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
565 {
566 public:
569
571 static constexpr const char *path{ "Revision/Major" };
572
574 static constexpr const char *name{ "Major" };
575
577 static constexpr const char *description{
578 R"description(Major hardware revision number. This field is deprecated and may be removed in a future version
579of the SDK. Please use HardwareRevision instead.
580)description"
581 };
582
584 using ValueType = uint32_t;
585
587 static constexpr Range<uint32_t> validRange()
588 {
589 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
590 }
591
593 Major() = default;
594
596 explicit constexpr Major(uint32_t value)
597 : m_value{ value }
598 {}
599
601 uint32_t value() const;
602
604 std::string toString() const;
605
607 bool operator==(const Major &other) const
608 {
609 return m_value == other.m_value;
610 }
611
613 bool operator!=(const Major &other) const
614 {
615 return m_value != other.m_value;
616 }
617
619 bool operator<(const Major &other) const
620 {
621 return m_value < other.m_value;
622 }
623
625 bool operator>(const Major &other) const
626 {
627 return m_value > other.m_value;
628 }
629
631 bool operator<=(const Major &other) const
632 {
633 return m_value <= other.m_value;
634 }
635
637 bool operator>=(const Major &other) const
638 {
639 return m_value >= other.m_value;
640 }
641
643 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
644 {
645 return stream << value.toString();
646 }
647
648 private:
649 void setFromString(const std::string &value);
650
651 uint32_t m_value{ 0 };
652
653 friend struct DataModel::Detail::Befriend<Major>;
654 };
655
659
660 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
662 {
663 public:
666
668 static constexpr const char *path{ "Revision/Minor" };
669
671 static constexpr const char *name{ "Minor" };
672
674 static constexpr const char *description{
675 R"description(Minor hardware revision number. This field is deprecated and may be removed in a future version
676of the SDK. Please use HardwareRevision instead.
677)description"
678 };
679
681 using ValueType = uint32_t;
682
684 static constexpr Range<uint32_t> validRange()
685 {
686 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
687 }
688
690 Minor() = default;
691
693 explicit constexpr Minor(uint32_t value)
694 : m_value{ value }
695 {}
696
698 uint32_t value() const;
699
701 std::string toString() const;
702
704 bool operator==(const Minor &other) const
705 {
706 return m_value == other.m_value;
707 }
708
710 bool operator!=(const Minor &other) const
711 {
712 return m_value != other.m_value;
713 }
714
716 bool operator<(const Minor &other) const
717 {
718 return m_value < other.m_value;
719 }
720
722 bool operator>(const Minor &other) const
723 {
724 return m_value > other.m_value;
725 }
726
728 bool operator<=(const Minor &other) const
729 {
730 return m_value <= other.m_value;
731 }
732
734 bool operator>=(const Minor &other) const
735 {
736 return m_value >= other.m_value;
737 }
738
740 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
741 {
742 return stream << value.toString();
743 }
744
745 private:
746 void setFromString(const std::string &value);
747
748 uint32_t m_value{ 0 };
749
750 friend struct DataModel::Detail::Befriend<Minor>;
751 };
752
753 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
754
757
770#ifndef NO_DOC
771 template<
772 typename... Args,
773 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
774 typename std::enable_if<
775 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
776 value,
777 int>::type = 0>
778#else
779 template<typename... Args>
780#endif
781 explicit Revision(Args &&...args)
782 {
783 using namespace Zivid::Detail::TypeTraits;
784
785 static_assert(
786 AllArgsDecayedAreUnique<Args...>::value,
787 "Found duplicate types among the arguments passed to Revision(...). "
788 "Types should be listed at most once.");
789
790 set(std::forward<Args>(args)...);
791 }
792
804#ifndef NO_DOC
805 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
806#else
807 template<typename... Args>
808#endif
809 void set(Args &&...args)
810 {
811 using namespace Zivid::Detail::TypeTraits;
812
813 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
814 static_assert(
815 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
816
817 static_assert(
818 AllArgsDecayedAreUnique<Args...>::value,
819 "Found duplicate types among the arguments passed to set(...). "
820 "Types should be listed at most once.");
821
822 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
823 }
824
837#ifndef NO_DOC
838 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
839#else
840 template<typename... Args>
841#endif
842 Revision copyWith(Args &&...args) const
843 {
844 using namespace Zivid::Detail::TypeTraits;
845
846 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
847 static_assert(
848 AllArgsAreDescendantNodes::value,
849 "All arguments passed to copyWith(...) must be descendant nodes.");
850
851 static_assert(
852 AllArgsDecayedAreUnique<Args...>::value,
853 "Found duplicate types among the arguments passed to copyWith(...). "
854 "Types should be listed at most once.");
855
856 auto copy{ *this };
857 copy.set(std::forward<Args>(args)...);
858 return copy;
859 }
860
862 const Major &major() const
863 {
864 return m_major;
865 }
866
869 {
870 return m_major;
871 }
872
874 Revision &set(const Major &value)
875 {
876 m_major = value;
877 return *this;
878 }
879
881 const Minor &minor() const
882 {
883 return m_minor;
884 }
885
888 {
889 return m_minor;
890 }
891
893 Revision &set(const Minor &value)
894 {
895 m_minor = value;
896 return *this;
897 }
898
899 template<
900 typename T,
901 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
903 {
904 return m_major;
905 }
906
907 template<
908 typename T,
909 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
911 {
912 return m_minor;
913 }
914
915 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
917 {
918 return m_major;
919 }
920
921 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
923 {
924 return m_minor;
925 }
926
928 template<typename F>
929 void forEach(const F &f) const
930 {
931 f(m_major);
932 f(m_minor);
933 }
934
936 template<typename F>
937 void forEach(const F &f)
938 {
939 f(m_major);
940 f(m_minor);
941 }
942
944 bool operator==(const Revision &other) const;
945
947 bool operator!=(const Revision &other) const;
948
950 std::string toString() const;
951
953 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
954 {
955 return stream << value.toString();
956 }
957
958 private:
959 void setFromString(const std::string &value);
960
961 void setFromString(const std::string &fullPath, const std::string &value);
962
963 std::string getString(const std::string &fullPath) const;
964
965 Major m_major;
966 Minor m_minor;
967
968 friend struct DataModel::Detail::Befriend<Revision>;
969 };
970
972
973 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
975 {
976 public:
979
981 static constexpr const char *path{ "SerialNumber" };
982
984 static constexpr const char *name{ "SerialNumber" };
985
987 static constexpr const char *description{ R"description(The serial number of the camera)description" };
988
990 using ValueType = std::string;
991
994 {
995 return { 0, 256 };
996 }
997
999 SerialNumber() = default;
1000
1002 explicit SerialNumber(std::string value)
1003 : m_value{ verifyValue(std::move(value)) }
1004 {}
1005
1007 const std::string &value() const;
1008
1010 std::string toString() const;
1011
1013 bool operator==(const SerialNumber &other) const
1014 {
1015 return m_value == other.m_value;
1016 }
1017
1019 bool operator!=(const SerialNumber &other) const
1020 {
1021 return m_value != other.m_value;
1022 }
1023
1025 bool operator<(const SerialNumber &other) const
1026 {
1027 return m_value < other.m_value;
1028 }
1029
1031 bool operator>(const SerialNumber &other) const
1032 {
1033 return m_value > other.m_value;
1034 }
1035
1037 bool operator<=(const SerialNumber &other) const
1038 {
1039 return m_value <= other.m_value;
1040 }
1041
1043 bool operator>=(const SerialNumber &other) const
1044 {
1045 return m_value >= other.m_value;
1046 }
1047
1049 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
1050 {
1051 return stream << value.toString();
1052 }
1053
1054 private:
1055 void setFromString(const std::string &value);
1056
1057 ValueType static verifyValue(ValueType &&value)
1058 {
1059 return validSize().isInRange(value.size())
1060 ? std::move(value)
1061 : throw std::invalid_argument{ "Invalid SerialNumber size=" + std::to_string(value.size())
1062 + ", valid size is {'max': 256}" };
1063 }
1064
1065 std::string m_value{};
1066
1067 friend struct DataModel::Detail::Befriend<SerialNumber>;
1068 };
1069
1071
1072 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1074 {
1075 public:
1078
1080 static constexpr const char *path{ "UserData" };
1081
1083 static constexpr const char *name{ "UserData" };
1084
1086 static constexpr const char *description{
1087 R"description(Information about user data capabilities of the camera)description"
1088 };
1089
1091
1092 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1094 {
1095 public:
1098
1100 static constexpr const char *path{ "UserData/MaxSizeBytes" };
1101
1103 static constexpr const char *name{ "MaxSizeBytes" };
1104
1106 static constexpr const char *description{
1107 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
1108 };
1109
1111 using ValueType = uint64_t;
1112
1114 static constexpr Range<uint64_t> validRange()
1115 {
1116 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
1117 }
1118
1120 MaxSizeBytes() = default;
1121
1123 explicit constexpr MaxSizeBytes(uint64_t value)
1124 : m_value{ value }
1125 {}
1126
1128 uint64_t value() const;
1129
1131 std::string toString() const;
1132
1134 bool operator==(const MaxSizeBytes &other) const
1135 {
1136 return m_value == other.m_value;
1137 }
1138
1140 bool operator!=(const MaxSizeBytes &other) const
1141 {
1142 return m_value != other.m_value;
1143 }
1144
1146 bool operator<(const MaxSizeBytes &other) const
1147 {
1148 return m_value < other.m_value;
1149 }
1150
1152 bool operator>(const MaxSizeBytes &other) const
1153 {
1154 return m_value > other.m_value;
1155 }
1156
1158 bool operator<=(const MaxSizeBytes &other) const
1159 {
1160 return m_value <= other.m_value;
1161 }
1162
1164 bool operator>=(const MaxSizeBytes &other) const
1165 {
1166 return m_value >= other.m_value;
1167 }
1168
1170 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1171 {
1172 return stream << value.toString();
1173 }
1174
1175 private:
1176 void setFromString(const std::string &value);
1177
1178 uint64_t m_value{ 0 };
1179
1180 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1181 };
1182
1183 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1184
1187
1199#ifndef NO_DOC
1200 template<
1201 typename... Args,
1202 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1203 typename std::enable_if<
1204 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1205 value,
1206 int>::type = 0>
1207#else
1208 template<typename... Args>
1209#endif
1210 explicit UserData(Args &&...args)
1211 {
1212 using namespace Zivid::Detail::TypeTraits;
1213
1214 static_assert(
1215 AllArgsDecayedAreUnique<Args...>::value,
1216 "Found duplicate types among the arguments passed to UserData(...). "
1217 "Types should be listed at most once.");
1218
1219 set(std::forward<Args>(args)...);
1220 }
1221
1232#ifndef NO_DOC
1233 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1234#else
1235 template<typename... Args>
1236#endif
1237 void set(Args &&...args)
1238 {
1239 using namespace Zivid::Detail::TypeTraits;
1240
1241 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1242 static_assert(
1243 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1244
1245 static_assert(
1246 AllArgsDecayedAreUnique<Args...>::value,
1247 "Found duplicate types among the arguments passed to set(...). "
1248 "Types should be listed at most once.");
1249
1250 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1251 }
1252
1264#ifndef NO_DOC
1265 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1266#else
1267 template<typename... Args>
1268#endif
1269 UserData copyWith(Args &&...args) const
1270 {
1271 using namespace Zivid::Detail::TypeTraits;
1272
1273 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1274 static_assert(
1275 AllArgsAreDescendantNodes::value,
1276 "All arguments passed to copyWith(...) must be descendant nodes.");
1277
1278 static_assert(
1279 AllArgsDecayedAreUnique<Args...>::value,
1280 "Found duplicate types among the arguments passed to copyWith(...). "
1281 "Types should be listed at most once.");
1282
1283 auto copy{ *this };
1284 copy.set(std::forward<Args>(args)...);
1285 return copy;
1286 }
1287
1290 {
1291 return m_maxSizeBytes;
1292 }
1293
1296 {
1297 return m_maxSizeBytes;
1298 }
1299
1302 {
1303 m_maxSizeBytes = value;
1304 return *this;
1305 }
1306
1307 template<
1308 typename T,
1309 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1311 {
1312 return m_maxSizeBytes;
1313 }
1314
1315 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1317 {
1318 return m_maxSizeBytes;
1319 }
1320
1322 template<typename F>
1323 void forEach(const F &f) const
1324 {
1325 f(m_maxSizeBytes);
1326 }
1327
1329 template<typename F>
1330 void forEach(const F &f)
1331 {
1332 f(m_maxSizeBytes);
1333 }
1334
1336 bool operator==(const UserData &other) const;
1337
1339 bool operator!=(const UserData &other) const;
1340
1342 std::string toString() const;
1343
1345 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1346 {
1347 return stream << value.toString();
1348 }
1349
1350 private:
1351 void setFromString(const std::string &value);
1352
1353 void setFromString(const std::string &fullPath, const std::string &value);
1354
1355 std::string getString(const std::string &fullPath) const;
1356
1357 MaxSizeBytes m_maxSizeBytes;
1358
1359 friend struct DataModel::Detail::Befriend<UserData>;
1360 };
1361
1362 using Descendants = std::tuple<
1373
1376
1378 explicit CameraInfo(const std::string &fileName);
1379
1385 [[nodiscard]] static CameraInfo fromSerialized(const std::string &value);
1386
1392 std::string serialize() const;
1393
1414#ifndef NO_DOC
1415 template<
1416 typename... Args,
1417 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1418 typename std::enable_if<
1419 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1420 int>::type = 0>
1421#else
1422 template<typename... Args>
1423#endif
1424 explicit CameraInfo(Args &&...args)
1425 {
1426 using namespace Zivid::Detail::TypeTraits;
1427
1428 static_assert(
1429 AllArgsDecayedAreUnique<Args...>::value,
1430 "Found duplicate types among the arguments passed to CameraInfo(...). "
1431 "Types should be listed at most once.");
1432
1433 set(std::forward<Args>(args)...);
1434 }
1435
1455#ifndef NO_DOC
1456 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1457#else
1458 template<typename... Args>
1459#endif
1460 void set(Args &&...args)
1461 {
1462 using namespace Zivid::Detail::TypeTraits;
1463
1464 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1465 static_assert(
1466 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1467
1468 static_assert(
1469 AllArgsDecayedAreUnique<Args...>::value,
1470 "Found duplicate types among the arguments passed to set(...). "
1471 "Types should be listed at most once.");
1472
1473 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1474 }
1475
1496#ifndef NO_DOC
1497 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1498#else
1499 template<typename... Args>
1500#endif
1501 CameraInfo copyWith(Args &&...args) const
1502 {
1503 using namespace Zivid::Detail::TypeTraits;
1504
1505 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1506 static_assert(
1507 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1508
1509 static_assert(
1510 AllArgsDecayedAreUnique<Args...>::value,
1511 "Found duplicate types among the arguments passed to copyWith(...). "
1512 "Types should be listed at most once.");
1513
1514 auto copy{ *this };
1515 copy.set(std::forward<Args>(args)...);
1516 return copy;
1517 }
1518
1521 {
1522 return m_firmwareVersion;
1523 }
1524
1527 {
1528 return m_firmwareVersion;
1529 }
1530
1533 {
1534 m_firmwareVersion = value;
1535 return *this;
1536 }
1537
1540 {
1541 return m_hardwareRevision;
1542 }
1543
1546 {
1547 return m_hardwareRevision;
1548 }
1549
1552 {
1553 m_hardwareRevision = value;
1554 return *this;
1555 }
1556
1558 const Model &model() const
1559 {
1560 return m_model;
1561 }
1562
1565 {
1566 return m_model;
1567 }
1568
1570 CameraInfo &set(const Model &value)
1571 {
1572 m_model = value;
1573 return *this;
1574 }
1575
1577 const ModelName &modelName() const
1578 {
1579 return m_modelName;
1580 }
1581
1584 {
1585 return m_modelName;
1586 }
1587
1589 CameraInfo &set(const ModelName &value)
1590 {
1591 m_modelName = value;
1592 return *this;
1593 }
1594
1596 const Revision &revision() const
1597 {
1598 return m_revision;
1599 }
1600
1603 {
1604 return m_revision;
1605 }
1606
1608 CameraInfo &set(const Revision &value)
1609 {
1610 m_revision = value;
1611 return *this;
1612 }
1613
1616 {
1617 m_revision.set(value);
1618 return *this;
1619 }
1620
1623 {
1624 m_revision.set(value);
1625 return *this;
1626 }
1627
1630 {
1631 return m_serialNumber;
1632 }
1633
1636 {
1637 return m_serialNumber;
1638 }
1639
1642 {
1643 m_serialNumber = value;
1644 return *this;
1645 }
1646
1648 const UserData &userData() const
1649 {
1650 return m_userData;
1651 }
1652
1655 {
1656 return m_userData;
1657 }
1658
1660 CameraInfo &set(const UserData &value)
1661 {
1662 m_userData = value;
1663 return *this;
1664 }
1665
1668 {
1669 m_userData.set(value);
1670 return *this;
1671 }
1672
1673 template<
1674 typename T,
1675 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1677 {
1678 return m_firmwareVersion;
1679 }
1680
1681 template<
1682 typename T,
1683 typename std::enable_if<std::is_same<T, CameraInfo::HardwareRevision>::value, int>::type = 0>
1685 {
1686 return m_hardwareRevision;
1687 }
1688
1689 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1690 const CameraInfo::Model &get() const
1691 {
1692 return m_model;
1693 }
1694
1695 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1697 {
1698 return m_modelName;
1699 }
1700
1701 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1703 {
1704 return m_revision;
1705 }
1706
1707 template<
1708 typename T,
1709 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1711 {
1712 return m_revision.get<CameraInfo::Revision::Major>();
1713 }
1714
1715 template<
1716 typename T,
1717 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1719 {
1720 return m_revision.get<CameraInfo::Revision::Minor>();
1721 }
1722
1723 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1725 {
1726 return m_serialNumber;
1727 }
1728
1729 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1731 {
1732 return m_userData;
1733 }
1734
1735 template<
1736 typename T,
1737 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1739 {
1740 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1741 }
1742
1743 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1745 {
1746 return m_firmwareVersion;
1747 }
1748
1749 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1751 {
1752 return m_hardwareRevision;
1753 }
1754
1755 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1756 const CameraInfo::Model &get() const
1757 {
1758 return m_model;
1759 }
1760
1761 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1763 {
1764 return m_modelName;
1765 }
1766
1767 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1769 {
1770 return m_revision;
1771 }
1772
1773 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1775 {
1776 return m_serialNumber;
1777 }
1778
1779 template<size_t i, typename std::enable_if<i == 6, int>::type = 0>
1781 {
1782 return m_userData;
1783 }
1784
1786 template<typename F>
1787 void forEach(const F &f) const
1788 {
1789 f(m_firmwareVersion);
1790 f(m_hardwareRevision);
1791 f(m_model);
1792 f(m_modelName);
1793 f(m_revision);
1794 f(m_serialNumber);
1795 f(m_userData);
1796 }
1797
1799 template<typename F>
1800 void forEach(const F &f)
1801 {
1802 f(m_firmwareVersion);
1803 f(m_hardwareRevision);
1804 f(m_model);
1805 f(m_modelName);
1806 f(m_revision);
1807 f(m_serialNumber);
1808 f(m_userData);
1809 }
1810
1812 bool operator==(const CameraInfo &other) const;
1813
1815 bool operator!=(const CameraInfo &other) const;
1816
1818 std::string toString() const;
1819
1821 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1822 {
1823 return stream << value.toString();
1824 }
1825
1827 void save(const std::string &fileName) const;
1828
1830 void load(const std::string &fileName);
1831
1832 private:
1833 void setFromString(const std::string &value);
1834
1835 void setFromString(const std::string &fullPath, const std::string &value);
1836
1837 std::string getString(const std::string &fullPath) const;
1838
1839 FirmwareVersion m_firmwareVersion;
1840 HardwareRevision m_hardwareRevision;
1841 Model m_model;
1842 ModelName m_modelName;
1843 Revision m_revision;
1844 SerialNumber m_serialNumber;
1845 UserData m_userData;
1846
1847 friend struct DataModel::Detail::Befriend<CameraInfo>;
1848 };
1849
1850#ifndef NO_DOC
1851 template<>
1852 struct CameraInfo::Version<7>
1853 {
1854 using Type = CameraInfo;
1855 };
1856#endif
1857
1858} // namespace Zivid
1859
1860#ifndef NO_DOC
1862namespace Zivid::Detail
1863{
1864
1865 ZIVID_CORE_EXPORT void save(const Zivid::CameraInfo &dataModel, std::ostream &ostream);
1866 ZIVID_CORE_EXPORT void load(Zivid::CameraInfo &dataModel, std::istream &istream);
1867
1868 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::CameraInfo &source);
1869 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(Zivid::CameraInfo &dest, const std::vector<uint8_t> &data);
1870
1871} // namespace Zivid::Detail
1872#endif
1873
1874#ifdef _MSC_VER
1875# pragma warning(pop)
1876#endif
1877
1878#ifndef NO_DOC
1879# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1880namespace std // NOLINT
1881{
1882
1883 template<>
1884 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1885 {};
1886
1887 template<size_t i>
1888 struct tuple_element<i, Zivid::CameraInfo::Revision>
1889 {
1890 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1891
1892 using type // NOLINT
1893 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1894 };
1895
1896 template<>
1897 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1898 {};
1899
1900 template<size_t i>
1901 struct tuple_element<i, Zivid::CameraInfo::UserData>
1902 {
1903 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1904
1905 using type // NOLINT
1906 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1907 };
1908
1909 template<>
1910 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 7>
1911 {};
1912
1913 template<size_t i>
1914 struct tuple_element<i, Zivid::CameraInfo>
1915 {
1916 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 7");
1917
1918 using type // NOLINT
1919 = decltype(declval<Zivid::CameraInfo>().get<i>());
1920 };
1921
1922} // namespace std
1923# endif
1924#endif
1925
1926// If we have access to the DataModel library, automatically include internal DataModel
1927// header. This header is necessary for serialization and deserialization.
1928#if defined(__has_include) && !defined(NO_DOC)
1929# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1930# include "Zivid/CameraInfoInternal.h"
1931# endif
1932#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
The firmware version on the camera.
Definition CameraInfo.h:112
std::string toString() const
Get the value as string.
bool operator==(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:150
FirmwareVersion(std::string value)
Constructor.
Definition CameraInfo.h:139
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:118
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for FirmwareVersion.
Definition CameraInfo.h:130
bool operator<(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:162
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:124
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:115
bool operator<=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:174
bool operator>=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:180
const std::string & value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const FirmwareVersion &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:186
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:121
bool operator>(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:168
bool operator!=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:156
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:127
FirmwareVersion()=default
Default constructor.
Hardware revision of this camera. This corresponds to the revision string that is printed on the prod...
Definition CameraInfo.h:213
HardwareRevision()=default
Default constructor.
bool operator!=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:261
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:225
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:216
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:222
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for HardwareRevision.
Definition CameraInfo.h:235
bool operator==(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:255
bool operator>(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:273
const std::string & value() const
Get the value.
bool operator<(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:267
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:219
friend std::ostream & operator<<(std::ostream &stream, const HardwareRevision &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:291
HardwareRevision(std::string value)
Constructor.
Definition CameraInfo.h:244
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:232
bool operator<=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:279
bool operator>=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:285
std::string toString() const
Get the value as string.
The model name of the camera. This is a user-friendly display name that may contain spaces and specia...
Definition CameraInfo.h:436
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:439
bool operator==(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:478
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:448
ModelName()=default
Default constructor.
bool operator<=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:502
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:445
ModelName(std::string value)
Constructor.
Definition CameraInfo.h:467
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:455
bool operator<(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:490
bool operator>(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:496
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:442
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:514
const std::string & value() const
Get the value.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName.
Definition CameraInfo.h:458
bool operator>=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:508
bool operator!=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:484
The model of the camera.
Definition CameraInfo.h:317
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition CameraInfo.h:347
static const Model zivid2PlusMR60
zivid2PlusMR60
Definition CameraInfo.h:356
static const Model zivid2PlusM130
zivid2PlusM130
Definition CameraInfo.h:352
static const Model zivid3XL250
zivid3XL250
Definition CameraInfo.h:358
static const Model zividTwo
zividTwo
Definition CameraInfo.h:350
static const Model zivid2PlusL110
zivid2PlusL110
Definition CameraInfo.h:354
std::string toString() const
Get the value as string.
constexpr Model(ValueType value)
Constructor.
Definition CameraInfo.h:373
Model()=default
Default constructor.
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition CameraInfo.h:348
ValueType value() const
Get the value.
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:326
friend std::ostream & operator<<(std::ostream &stream, const Model::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraInfo.h:384
static const Model zivid2PlusM60
zivid2PlusM60
Definition CameraInfo.h:353
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:402
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:329
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:320
static const Model zivid2PlusLR110
zivid2PlusLR110
Definition CameraInfo.h:357
static std::set< ValueType > validValues()
All valid values of Model.
Definition CameraInfo.h:361
ValueType
The type of the underlying value.
Definition CameraInfo.h:333
@ zivid2PlusMR60
Definition CameraInfo.h:343
@ zividOnePlusLarge
Definition CameraInfo.h:336
@ zivid2PlusM130
Definition CameraInfo.h:339
@ zividOnePlusSmall
Definition CameraInfo.h:334
@ zividOnePlusMedium
Definition CameraInfo.h:335
@ zivid2PlusM60
Definition CameraInfo.h:340
@ zivid2PlusMR130
Definition CameraInfo.h:342
@ zividTwo
Definition CameraInfo.h:337
@ zivid3XL250
Definition CameraInfo.h:345
@ zivid2PlusLR110
Definition CameraInfo.h:344
@ zividTwoL100
Definition CameraInfo.h:338
@ zivid2PlusL110
Definition CameraInfo.h:341
static const Model zivid2PlusMR130
zivid2PlusMR130
Definition CameraInfo.h:355
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition CameraInfo.h:349
bool operator!=(const Model &other) const
Comparison operator.
Definition CameraInfo.h:396
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:323
static const Model zividTwoL100
zividTwoL100
Definition CameraInfo.h:351
bool operator==(const Model &other) const
Comparison operator.
Definition CameraInfo.h:390
Major hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:565
std::string toString() const
Get the value as string.
bool operator!=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:613
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:584
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:643
static constexpr Range< uint32_t > validRange()
The range of valid values for Major.
Definition CameraInfo.h:587
bool operator>=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:637
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:574
bool operator<=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:631
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:571
bool operator>(const Major &other) const
Comparison operator.
Definition CameraInfo.h:625
uint32_t value() const
Get the value.
constexpr Major(uint32_t value)
Constructor.
Definition CameraInfo.h:596
bool operator<(const Major &other) const
Comparison operator.
Definition CameraInfo.h:619
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:568
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:577
Major()=default
Default constructor.
bool operator==(const Major &other) const
Comparison operator.
Definition CameraInfo.h:607
Minor hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:662
bool operator>(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:722
bool operator!=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:710
bool operator<=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:728
constexpr Minor(uint32_t value)
Constructor.
Definition CameraInfo.h:693
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:665
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:681
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:740
bool operator==(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:704
std::string toString() const
Get the value as string.
Minor()=default
Default constructor.
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:668
bool operator>=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:734
bool operator<(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:716
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor.
Definition CameraInfo.h:684
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:671
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:674
uint32_t value() const
Get the value.
Major/Minor hardware revision number. This field is deprecated and may be removed in a future version...
Definition CameraInfo.h:541
const Major & major() const
Get Major.
Definition CameraInfo.h:862
Revision copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraInfo.h:842
Minor & minor()
Get Minor.
Definition CameraInfo.h:887
Revision & set(const Minor &value)
Set Minor.
Definition CameraInfo.h:893
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition CameraInfo.h:753
Revision & set(const Major &value)
Set Major.
Definition CameraInfo.h:874
bool operator==(const Revision &other) const
Equality operator.
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:910
std::string toString() const
Get the value as string.
const Minor & minor() const
Get Minor.
Definition CameraInfo.h:881
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:547
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:553
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:937
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:550
Major & major()
Get Major.
Definition CameraInfo.h:868
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:902
Revision()
Default constructor.
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:929
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:953
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:544
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:809
bool operator!=(const Revision &other) const
Inequality operator.
The serial number of the camera.
Definition CameraInfo.h:975
SerialNumber(std::string value)
Constructor.
Definition CameraInfo.h:1002
const std::string & value() const
Get the value.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:978
bool operator==(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1013
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:981
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:990
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:987
SerialNumber()=default
Default constructor.
friend std::ostream & operator<<(std::ostream &stream, const SerialNumber &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:1049
std::string toString() const
Get the value as string.
bool operator>(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1031
bool operator<(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1025
bool operator<=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1037
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber.
Definition CameraInfo.h:993
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:984
bool operator>=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1043
bool operator!=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1019
The maximum number of bytes of user data that can be stored in the camera.
Definition CameraInfo.h:1094
bool operator!=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1140
bool operator<=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1158
bool operator>(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1152
MaxSizeBytes()=default
Default constructor.
constexpr MaxSizeBytes(uint64_t value)
Constructor.
Definition CameraInfo.h:1123
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:1103
uint64_t value() const
Get the value.
bool operator<(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1146
bool operator==(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1134
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const MaxSizeBytes &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:1170
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:1100
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes.
Definition CameraInfo.h:1114
uint64_t ValueType
The type of the underlying value.
Definition CameraInfo.h:1111
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:1097
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:1106
bool operator>=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1164
Information about user data capabilities of the camera.
Definition CameraInfo.h:1074
bool operator==(const UserData &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 CameraInfo.h:1330
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:1086
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes.
Definition CameraInfo.h:1295
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:1083
UserData copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraInfo.h:1269
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1345
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 CameraInfo.h:1323
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1310
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition CameraInfo.h:1183
bool operator!=(const UserData &other) const
Inequality operator.
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:1080
UserData()
Default constructor.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:1077
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes.
Definition CameraInfo.h:1289
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes.
Definition CameraInfo.h:1301
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1237
Information about camera model, serial number etc.
Definition CameraInfo.h:78
bool operator==(const CameraInfo &other) const
Equality operator.
static CameraInfo fromSerialized(const std::string &value)
Construct a new CameraInfo instance from a previously serialized string.
Revision & revision()
Get Revision.
Definition CameraInfo.h:1602
const ModelName & modelName() const
Get ModelName.
Definition CameraInfo.h:1577
FirmwareVersion & firmwareVersion()
Get FirmwareVersion.
Definition CameraInfo.h:1526
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1800
const UserData & userData() const
Get UserData.
Definition CameraInfo.h:1648
ModelName & modelName()
Get ModelName.
Definition CameraInfo.h:1583
bool operator!=(const CameraInfo &other) const
Inequality operator.
CameraInfo & set(const Model &value)
Set Model.
Definition CameraInfo.h:1570
const CameraInfo::FirmwareVersion & get() const
Definition CameraInfo.h:1676
const CameraInfo::Model & get() const
Definition CameraInfo.h:1690
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file.
UserData & userData()
Get UserData.
Definition CameraInfo.h:1654
static constexpr const char * description
The description for this value.
Definition CameraInfo.h:90
CameraInfo & set(const ModelName &value)
Set ModelName.
Definition CameraInfo.h:1589
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion.
Definition CameraInfo.h:1520
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1738
const Model & model() const
Get Model.
Definition CameraInfo.h:1558
CameraInfo copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraInfo.h:1501
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1787
Model & model()
Get Model.
Definition CameraInfo.h:1564
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1821
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraInfo.h:81
const CameraInfo::ModelName & get() const
Definition CameraInfo.h:1696
CameraInfo & set(const UserData &value)
Set UserData.
Definition CameraInfo.h:1660
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes.
Definition CameraInfo.h:1667
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraInfo.h:1424
const CameraInfo::UserData & get() const
Definition CameraInfo.h:1730
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:1718
const SerialNumber & serialNumber() const
Get SerialNumber.
Definition CameraInfo.h:1629
SerialNumber & serialNumber()
Get SerialNumber.
Definition CameraInfo.h:1635
const Revision & revision() const
Get Revision.
Definition CameraInfo.h:1596
CameraInfo & set(const HardwareRevision &value)
Set HardwareRevision.
Definition CameraInfo.h:1551
const CameraInfo::HardwareRevision & get() const
Definition CameraInfo.h:1684
static constexpr const char * path
The full path for this value.
Definition CameraInfo.h:84
void load(const std::string &fileName)
Load from the given file.
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion.
Definition CameraInfo.h:1532
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:1710
const HardwareRevision & hardwareRevision() const
Get HardwareRevision.
Definition CameraInfo.h:1539
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1460
CameraInfo & set(const Revision &value)
Set Revision.
Definition CameraInfo.h:1608
CameraInfo & set(const Revision::Major &value)
Set Revision::Major.
Definition CameraInfo.h:1615
std::tuple< CameraInfo::FirmwareVersion, CameraInfo::HardwareRevision, CameraInfo::Model, CameraInfo::ModelName, CameraInfo::Revision, CameraInfo::Revision::Major, CameraInfo::Revision::Minor, CameraInfo::SerialNumber, CameraInfo::UserData, CameraInfo::UserData::MaxSizeBytes > Descendants
Definition CameraInfo.h:1362
CameraInfo & set(const SerialNumber &value)
Set SerialNumber.
Definition CameraInfo.h:1641
std::string serialize() const
Serialize to a string.
HardwareRevision & hardwareRevision()
Get HardwareRevision.
Definition CameraInfo.h:1545
const CameraInfo::SerialNumber & get() const
Definition CameraInfo.h:1724
const CameraInfo::Revision & get() const
Definition CameraInfo.h:1702
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition CameraInfo.h:87
static constexpr size_t version
Definition CameraInfo.h:94
CameraInfo()
Default constructor.
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor.
Definition CameraInfo.h:1622
void save(const std::string &fileName) const
Save to the given file.
Class describing a range of values for a given type T.
Definition Range.h:75
NodeType
Definition NodeType.h:49
@ leafValue
Definition NodeType.h:52
@ group
Definition NodeType.h:50
Definition EnvironmentInfo.h:74
Get version information for the library.
Definition Version.h:58
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:84