Zivid C++ API 2.10.0+8ce7dae3-2
Defining the Future of 3D Machine Vision
CameraInfo.h
Go to the documentation of this file.
1
2
3/*******************************************************************************
4
5 * This file is part of the Zivid 3D Camera API
6
7 *
8
9 * Copyright 2015-2023 (C) Zivid AS
10
11 * All rights reserved.
12
13 *
14
15 * Zivid Software License, v1.0
16
17 *
18
19 * Redistribution and use in source and binary forms, with or without
20
21 * modification, are permitted provided that the following conditions are met:
22
23 *
24
25 * 1. Redistributions of source code must retain the above copyright notice,
26
27 * this list of conditions and the following disclaimer.
28
29 *
30
31 * 2. Redistributions in binary form must reproduce the above copyright notice,
32
33 * this list of conditions and the following disclaimer in the documentation
34
35 * and/or other materials provided with the distribution.
36
37 *
38
39 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
40
41 * to endorse or promote products derived from this software without specific
42
43 * prior written permission.
44
45 *
46
47 * 4. This software, with or without modification, must not be used with any
48
49 * other 3D camera than from Zivid AS.
50
51 *
52
53 * 5. Any software provided in binary form under this license must not be
54
55 * reverse engineered, decompiled, modified and/or disassembled.
56
57 *
58
59 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
60
61 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
62
63 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
64
65 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
66
67 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68
69 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
70
71 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
72
73 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74
75 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76
77 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78
79 *
80
81 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
82
83 * Info: http://www.zivid.com
84
85 ******************************************************************************/
86
87
88
89#pragma once
90
91#include <array>
92#include <chrono>
93#include <cmath>
94#include <ctime>
95#include <iomanip>
96#include <memory>
97#include <set>
98#include <sstream>
99#include <string>
100#include <tuple>
101#include <utility>
102#include <vector>
103
109#include "Zivid/Range.h"
110
111#ifdef _MSC_VER
112# pragma warning(push)
113# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
114#endif
115
116namespace Zivid
117{
118
120
121 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
123 {
124 public:
127
129 static constexpr const char *path{ "" };
130
132 static constexpr const char *name{ "CameraInfo" };
133
135 static constexpr const char *description{
136 R"description(Information about camera model, serial number etc.)description"
137 };
138
139 static constexpr size_t version{ 3 };
140
141#ifndef NO_DOC
142 template<size_t>
143 struct Version;
144
145 using LatestVersion = Zivid::CameraInfo;
146
147 // Short identifier. This value is not guaranteed to be universally unique
148 // Todo(ZIVID-2808): Move this to internal DataModelExt header
149 static constexpr std::array<uint8_t, 3> binaryId{ 'n', 'f', 'o' };
150
151#endif
152
154
155 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
157 {
158 public:
161
163 static constexpr const char *path{ "FirmwareVersion" };
164
166 static constexpr const char *name{ "FirmwareVersion" };
167
169 static constexpr const char *description{ R"description(The firmware version on the camera)description" };
170
172 using ValueType = std::string;
173
176 {
177 return { 0, std::numeric_limits<ValueType::size_type>::max() };
178 }
179
181 FirmwareVersion() = default;
182
184 explicit FirmwareVersion(std::string value)
185 : m_value{ std::move(value) }
186 {}
187
189 const std::string &value() const;
190
192 std::string toString() const;
193
195 bool operator==(const FirmwareVersion &other) const
196 {
197 return m_value == other.m_value;
198 }
199
201 bool operator!=(const FirmwareVersion &other) const
202 {
203 return m_value != other.m_value;
204 }
205
207 bool operator<(const FirmwareVersion &other) const
208 {
209 return m_value < other.m_value;
210 }
211
213 bool operator>(const FirmwareVersion &other) const
214 {
215 return m_value > other.m_value;
216 }
217
219 bool operator<=(const FirmwareVersion &other) const
220 {
221 return m_value <= other.m_value;
222 }
223
225 bool operator>=(const FirmwareVersion &other) const
226 {
227 return m_value >= other.m_value;
228 }
229
231 friend std::ostream &operator<<(std::ostream &stream, const FirmwareVersion &value)
232 {
233 return stream << value.toString();
234 }
235
236 private:
237 void setFromString(const std::string &value);
238
239 std::string m_value{};
240
241 friend struct DataModel::Detail::Befriend<FirmwareVersion>;
242 };
243
245
246 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
248 {
249 public:
252
254 static constexpr const char *path{ "Model" };
255
257 static constexpr const char *name{ "Model" };
258
260 static constexpr const char *description{ R"description(The model of the camera)description" };
261
263 enum class ValueType
264 {
265 zividOnePlusSmall,
266 zividOnePlusMedium,
267 zividOnePlusLarge,
268 zividTwo,
269 zividTwoL100,
270 zivid2PlusM130
271 };
275 static const Model zividTwo;
276 static const Model zividTwoL100;
277 static const Model zivid2PlusM130;
278
280 static std::set<ValueType> validValues()
281 {
282 return { ValueType::zividOnePlusSmall, ValueType::zividOnePlusMedium, ValueType::zividOnePlusLarge,
283 ValueType::zividTwo, ValueType::zividTwoL100, ValueType::zivid2PlusM130 };
284 }
285
287 Model() = default;
288
290 explicit constexpr Model(ValueType value)
291 : m_value{ verifyValue(value) }
292 {}
293
296
298 std::string toString() const;
299
301 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
302 {
303 return stream << Model{ value }.toString();
304 }
305
307 bool operator==(const Model &other) const
308 {
309 return m_value == other.m_value;
310 }
311
313 bool operator!=(const Model &other) const
314 {
315 return m_value != other.m_value;
316 }
317
319 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
320 {
321 return stream << value.toString();
322 }
323
324 private:
325 void setFromString(const std::string &value);
326
327 constexpr ValueType static verifyValue(const ValueType &value)
328 {
329 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
330 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
331 || value == ValueType::zividTwoL100 || value == ValueType::zivid2PlusM130
332 ? value
333 : throw std::invalid_argument{
334 "Invalid value: Model{ "
335 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
336 };
337 }
338
339 ValueType m_value{ ValueType::zividOnePlusSmall };
340
341 friend struct DataModel::Detail::Befriend<Model>;
342 };
343
347
348 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
350 {
351 public:
354
356 static constexpr const char *path{ "ModelName" };
357
359 static constexpr const char *name{ "ModelName" };
360
362 static constexpr const char *description{
363 R"description(The model name of the camera. This is a user-friendly display name that may contain spaces and special
364characters. We recommend to use `Model` instead if you want to programmatically check for camera model.
365)description"
366 };
367
369 using ValueType = std::string;
370
373 {
374 return { 0, std::numeric_limits<ValueType::size_type>::max() };
375 }
376
378 ModelName() = default;
379
381 explicit ModelName(std::string value)
382 : m_value{ std::move(value) }
383 {}
384
386 const std::string &value() const;
387
389 std::string toString() const;
390
392 bool operator==(const ModelName &other) const
393 {
394 return m_value == other.m_value;
395 }
396
398 bool operator!=(const ModelName &other) const
399 {
400 return m_value != other.m_value;
401 }
402
404 bool operator<(const ModelName &other) const
405 {
406 return m_value < other.m_value;
407 }
408
410 bool operator>(const ModelName &other) const
411 {
412 return m_value > other.m_value;
413 }
414
416 bool operator<=(const ModelName &other) const
417 {
418 return m_value <= other.m_value;
419 }
420
422 bool operator>=(const ModelName &other) const
423 {
424 return m_value >= other.m_value;
425 }
426
428 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
429 {
430 return stream << value.toString();
431 }
432
433 private:
434 void setFromString(const std::string &value);
435
436 std::string m_value{};
437
438 friend struct DataModel::Detail::Befriend<ModelName>;
439 };
440
442
443 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
445 {
446 public:
449
451 static constexpr const char *path{ "Revision" };
452
454 static constexpr const char *name{ "Revision" };
455
457 static constexpr const char *description{ R"description(The hardware revision of the camera)description" };
458
460
461 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
463 {
464 public:
467
469 static constexpr const char *path{ "Revision/Major" };
470
472 static constexpr const char *name{ "Major" };
473
475 static constexpr const char *description{ R"description(Major hardware revision number)description" };
476
478 using ValueType = uint32_t;
479
481 static constexpr Range<uint32_t> validRange()
482 {
483 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
484 }
485
487 Major() = default;
488
490 explicit constexpr Major(uint32_t value)
491 : m_value{ value }
492 {}
493
495 uint32_t value() const;
496
498 std::string toString() const;
499
501 bool operator==(const Major &other) const
502 {
503 return m_value == other.m_value;
504 }
505
507 bool operator!=(const Major &other) const
508 {
509 return m_value != other.m_value;
510 }
511
513 bool operator<(const Major &other) const
514 {
515 return m_value < other.m_value;
516 }
517
519 bool operator>(const Major &other) const
520 {
521 return m_value > other.m_value;
522 }
523
525 bool operator<=(const Major &other) const
526 {
527 return m_value <= other.m_value;
528 }
529
531 bool operator>=(const Major &other) const
532 {
533 return m_value >= other.m_value;
534 }
535
537 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
538 {
539 return stream << value.toString();
540 }
541
542 private:
543 void setFromString(const std::string &value);
544
545 uint32_t m_value{ 0 };
546
547 friend struct DataModel::Detail::Befriend<Major>;
548 };
549
551
552 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
554 {
555 public:
558
560 static constexpr const char *path{ "Revision/Minor" };
561
563 static constexpr const char *name{ "Minor" };
564
566 static constexpr const char *description{ R"description(Minor hardware revision number)description" };
567
569 using ValueType = uint32_t;
570
572 static constexpr Range<uint32_t> validRange()
573 {
574 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
575 }
576
578 Minor() = default;
579
581 explicit constexpr Minor(uint32_t value)
582 : m_value{ value }
583 {}
584
586 uint32_t value() const;
587
589 std::string toString() const;
590
592 bool operator==(const Minor &other) const
593 {
594 return m_value == other.m_value;
595 }
596
598 bool operator!=(const Minor &other) const
599 {
600 return m_value != other.m_value;
601 }
602
604 bool operator<(const Minor &other) const
605 {
606 return m_value < other.m_value;
607 }
608
610 bool operator>(const Minor &other) const
611 {
612 return m_value > other.m_value;
613 }
614
616 bool operator<=(const Minor &other) const
617 {
618 return m_value <= other.m_value;
619 }
620
622 bool operator>=(const Minor &other) const
623 {
624 return m_value >= other.m_value;
625 }
626
628 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
629 {
630 return stream << value.toString();
631 }
632
633 private:
634 void setFromString(const std::string &value);
635
636 uint32_t m_value{ 0 };
637
638 friend struct DataModel::Detail::Befriend<Minor>;
639 };
640
641 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
642
645
658#ifndef NO_DOC
659 template<
660 typename... Args,
661 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
662 typename std::enable_if<
663 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
664 value,
665 int>::type = 0>
666#else
667 template<typename... Args>
668#endif
669 explicit Revision(Args &&...args)
670 {
671 using namespace Zivid::Detail::TypeTraits;
672
673 static_assert(
674 AllArgsDecayedAreUnique<Args...>::value,
675 "Found duplicate types among the arguments passed to Revision(...). "
676 "Types should be listed at most once.");
677
678 set(std::forward<Args>(args)...);
679 }
680
692#ifndef NO_DOC
693 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
694#else
695 template<typename... Args>
696#endif
697 void set(Args &&...args)
698 {
699 using namespace Zivid::Detail::TypeTraits;
700
701 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
702 static_assert(
703 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
704
705 static_assert(
706 AllArgsDecayedAreUnique<Args...>::value,
707 "Found duplicate types among the arguments passed to set(...). "
708 "Types should be listed at most once.");
709
710 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
711 }
712
725#ifndef NO_DOC
726 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
727#else
728 template<typename... Args>
729#endif
730 Revision copyWith(Args &&...args) const
731 {
732 using namespace Zivid::Detail::TypeTraits;
733
734 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
735 static_assert(
736 AllArgsAreDescendantNodes::value,
737 "All arguments passed to copyWith(...) must be descendant nodes.");
738
739 static_assert(
740 AllArgsDecayedAreUnique<Args...>::value,
741 "Found duplicate types among the arguments passed to copyWith(...). "
742 "Types should be listed at most once.");
743
744 auto copy{ *this };
745 copy.set(std::forward<Args>(args)...);
746 return copy;
747 }
748
750 const Major &major() const
751 {
752 return m_major;
753 }
754
757 {
758 return m_major;
759 }
760
762 Revision &set(const Major &value)
763 {
764 m_major = value;
765 return *this;
766 }
767
769 const Minor &minor() const
770 {
771 return m_minor;
772 }
773
776 {
777 return m_minor;
778 }
779
781 Revision &set(const Minor &value)
782 {
783 m_minor = value;
784 return *this;
785 }
786
787 template<
788 typename T,
789 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
791 {
792 return m_major;
793 }
794
795 template<
796 typename T,
797 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
799 {
800 return m_minor;
801 }
802
803 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
805 {
806 return m_major;
807 }
808
809 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
811 {
812 return m_minor;
813 }
814
816 template<typename F>
817 void forEach(const F &f) const
818 {
819 f(m_major);
820 f(m_minor);
821 }
822
824 template<typename F>
825 void forEach(const F &f)
826 {
827 f(m_major);
828 f(m_minor);
829 }
830
832 bool operator==(const Revision &other) const;
833
835 bool operator!=(const Revision &other) const;
836
838 std::string toString() const;
839
841 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
842 {
843 return stream << value.toString();
844 }
845
846 private:
847 void setFromString(const std::string &value);
848
849 void setFromString(const std::string &fullPath, const std::string &value);
850
851 std::string getString(const std::string &fullPath) const;
852
853 Major m_major;
854 Minor m_minor;
855
856 friend struct DataModel::Detail::Befriend<Revision>;
857 };
858
860
861 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
863 {
864 public:
867
869 static constexpr const char *path{ "SerialNumber" };
870
872 static constexpr const char *name{ "SerialNumber" };
873
875 static constexpr const char *description{ R"description(The serial number of the camera)description" };
876
878 using ValueType = std::string;
879
882 {
883 return { 0, std::numeric_limits<ValueType::size_type>::max() };
884 }
885
887 SerialNumber() = default;
888
890 explicit SerialNumber(std::string value)
891 : m_value{ std::move(value) }
892 {}
893
895 const std::string &value() const;
896
898 std::string toString() const;
899
901 bool operator==(const SerialNumber &other) const
902 {
903 return m_value == other.m_value;
904 }
905
907 bool operator!=(const SerialNumber &other) const
908 {
909 return m_value != other.m_value;
910 }
911
913 bool operator<(const SerialNumber &other) const
914 {
915 return m_value < other.m_value;
916 }
917
919 bool operator>(const SerialNumber &other) const
920 {
921 return m_value > other.m_value;
922 }
923
925 bool operator<=(const SerialNumber &other) const
926 {
927 return m_value <= other.m_value;
928 }
929
931 bool operator>=(const SerialNumber &other) const
932 {
933 return m_value >= other.m_value;
934 }
935
937 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
938 {
939 return stream << value.toString();
940 }
941
942 private:
943 void setFromString(const std::string &value);
944
945 std::string m_value{};
946
947 friend struct DataModel::Detail::Befriend<SerialNumber>;
948 };
949
951
952 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
954 {
955 public:
958
960 static constexpr const char *path{ "UserData" };
961
963 static constexpr const char *name{ "UserData" };
964
966 static constexpr const char *description{
967 R"description(Information about user data capabilities of the camera)description"
968 };
969
971
972 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
974 {
975 public:
978
980 static constexpr const char *path{ "UserData/MaxSizeBytes" };
981
983 static constexpr const char *name{ "MaxSizeBytes" };
984
986 static constexpr const char *description{
987 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
988 };
989
991 using ValueType = uint64_t;
992
994 static constexpr Range<uint64_t> validRange()
995 {
996 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
997 }
998
1000 MaxSizeBytes() = default;
1001
1003 explicit constexpr MaxSizeBytes(uint64_t value)
1004 : m_value{ value }
1005 {}
1006
1008 uint64_t value() const;
1009
1011 std::string toString() const;
1012
1014 bool operator==(const MaxSizeBytes &other) const
1015 {
1016 return m_value == other.m_value;
1017 }
1018
1020 bool operator!=(const MaxSizeBytes &other) const
1021 {
1022 return m_value != other.m_value;
1023 }
1024
1026 bool operator<(const MaxSizeBytes &other) const
1027 {
1028 return m_value < other.m_value;
1029 }
1030
1032 bool operator>(const MaxSizeBytes &other) const
1033 {
1034 return m_value > other.m_value;
1035 }
1036
1038 bool operator<=(const MaxSizeBytes &other) const
1039 {
1040 return m_value <= other.m_value;
1041 }
1042
1044 bool operator>=(const MaxSizeBytes &other) const
1045 {
1046 return m_value >= other.m_value;
1047 }
1048
1050 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1051 {
1052 return stream << value.toString();
1053 }
1054
1055 private:
1056 void setFromString(const std::string &value);
1057
1058 uint64_t m_value{ 0 };
1059
1060 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1061 };
1062
1063 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1064
1067
1079#ifndef NO_DOC
1080 template<
1081 typename... Args,
1082 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1083 typename std::enable_if<
1084 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1085 value,
1086 int>::type = 0>
1087#else
1088 template<typename... Args>
1089#endif
1090 explicit UserData(Args &&...args)
1091 {
1092 using namespace Zivid::Detail::TypeTraits;
1093
1094 static_assert(
1095 AllArgsDecayedAreUnique<Args...>::value,
1096 "Found duplicate types among the arguments passed to UserData(...). "
1097 "Types should be listed at most once.");
1098
1099 set(std::forward<Args>(args)...);
1100 }
1101
1112#ifndef NO_DOC
1113 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1114#else
1115 template<typename... Args>
1116#endif
1117 void set(Args &&...args)
1118 {
1119 using namespace Zivid::Detail::TypeTraits;
1120
1121 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1122 static_assert(
1123 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1124
1125 static_assert(
1126 AllArgsDecayedAreUnique<Args...>::value,
1127 "Found duplicate types among the arguments passed to set(...). "
1128 "Types should be listed at most once.");
1129
1130 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1131 }
1132
1144#ifndef NO_DOC
1145 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1146#else
1147 template<typename... Args>
1148#endif
1149 UserData copyWith(Args &&...args) const
1150 {
1151 using namespace Zivid::Detail::TypeTraits;
1152
1153 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1154 static_assert(
1155 AllArgsAreDescendantNodes::value,
1156 "All arguments passed to copyWith(...) must be descendant nodes.");
1157
1158 static_assert(
1159 AllArgsDecayedAreUnique<Args...>::value,
1160 "Found duplicate types among the arguments passed to copyWith(...). "
1161 "Types should be listed at most once.");
1162
1163 auto copy{ *this };
1164 copy.set(std::forward<Args>(args)...);
1165 return copy;
1166 }
1167
1170 {
1171 return m_maxSizeBytes;
1172 }
1173
1176 {
1177 return m_maxSizeBytes;
1178 }
1179
1182 {
1183 m_maxSizeBytes = value;
1184 return *this;
1185 }
1186
1187 template<
1188 typename T,
1189 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1191 {
1192 return m_maxSizeBytes;
1193 }
1194
1195 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1197 {
1198 return m_maxSizeBytes;
1199 }
1200
1202 template<typename F>
1203 void forEach(const F &f) const
1204 {
1205 f(m_maxSizeBytes);
1206 }
1207
1209 template<typename F>
1210 void forEach(const F &f)
1211 {
1212 f(m_maxSizeBytes);
1213 }
1214
1216 bool operator==(const UserData &other) const;
1217
1219 bool operator!=(const UserData &other) const;
1220
1222 std::string toString() const;
1223
1225 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1226 {
1227 return stream << value.toString();
1228 }
1229
1230 private:
1231 void setFromString(const std::string &value);
1232
1233 void setFromString(const std::string &fullPath, const std::string &value);
1234
1235 std::string getString(const std::string &fullPath) const;
1236
1237 MaxSizeBytes m_maxSizeBytes;
1238
1239 friend struct DataModel::Detail::Befriend<UserData>;
1240 };
1241
1242 using Descendants = std::tuple<
1252
1255
1257 explicit CameraInfo(const std::string &fileName);
1258
1278#ifndef NO_DOC
1279 template<
1280 typename... Args,
1281 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1282 typename std::enable_if<
1283 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1284 int>::type = 0>
1285#else
1286 template<typename... Args>
1287#endif
1288 explicit CameraInfo(Args &&...args)
1289 {
1290 using namespace Zivid::Detail::TypeTraits;
1291
1292 static_assert(
1293 AllArgsDecayedAreUnique<Args...>::value,
1294 "Found duplicate types among the arguments passed to CameraInfo(...). "
1295 "Types should be listed at most once.");
1296
1297 set(std::forward<Args>(args)...);
1298 }
1299
1318#ifndef NO_DOC
1319 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1320#else
1321 template<typename... Args>
1322#endif
1323 void set(Args &&...args)
1324 {
1325 using namespace Zivid::Detail::TypeTraits;
1326
1327 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1328 static_assert(
1329 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1330
1331 static_assert(
1332 AllArgsDecayedAreUnique<Args...>::value,
1333 "Found duplicate types among the arguments passed to set(...). "
1334 "Types should be listed at most once.");
1335
1336 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1337 }
1338
1358#ifndef NO_DOC
1359 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1360#else
1361 template<typename... Args>
1362#endif
1363 CameraInfo copyWith(Args &&...args) const
1364 {
1365 using namespace Zivid::Detail::TypeTraits;
1366
1367 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1368 static_assert(
1369 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1370
1371 static_assert(
1372 AllArgsDecayedAreUnique<Args...>::value,
1373 "Found duplicate types among the arguments passed to copyWith(...). "
1374 "Types should be listed at most once.");
1375
1376 auto copy{ *this };
1377 copy.set(std::forward<Args>(args)...);
1378 return copy;
1379 }
1380
1383 {
1384 return m_firmwareVersion;
1385 }
1386
1389 {
1390 return m_firmwareVersion;
1391 }
1392
1395 {
1396 m_firmwareVersion = value;
1397 return *this;
1398 }
1399
1401 const Model &model() const
1402 {
1403 return m_model;
1404 }
1405
1408 {
1409 return m_model;
1410 }
1411
1413 CameraInfo &set(const Model &value)
1414 {
1415 m_model = value;
1416 return *this;
1417 }
1418
1420 const ModelName &modelName() const
1421 {
1422 return m_modelName;
1423 }
1424
1427 {
1428 return m_modelName;
1429 }
1430
1432 CameraInfo &set(const ModelName &value)
1433 {
1434 m_modelName = value;
1435 return *this;
1436 }
1437
1439 const Revision &revision() const
1440 {
1441 return m_revision;
1442 }
1443
1446 {
1447 return m_revision;
1448 }
1449
1451 CameraInfo &set(const Revision &value)
1452 {
1453 m_revision = value;
1454 return *this;
1455 }
1456
1459 {
1460 m_revision.set(value);
1461 return *this;
1462 }
1463
1466 {
1467 m_revision.set(value);
1468 return *this;
1469 }
1470
1473 {
1474 return m_serialNumber;
1475 }
1476
1479 {
1480 return m_serialNumber;
1481 }
1482
1485 {
1486 m_serialNumber = value;
1487 return *this;
1488 }
1489
1491 const UserData &userData() const
1492 {
1493 return m_userData;
1494 }
1495
1498 {
1499 return m_userData;
1500 }
1501
1503 CameraInfo &set(const UserData &value)
1504 {
1505 m_userData = value;
1506 return *this;
1507 }
1508
1511 {
1512 m_userData.set(value);
1513 return *this;
1514 }
1515
1516 template<
1517 typename T,
1518 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1520 {
1521 return m_firmwareVersion;
1522 }
1523
1524 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1525 const CameraInfo::Model &get() const
1526 {
1527 return m_model;
1528 }
1529
1530 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1532 {
1533 return m_modelName;
1534 }
1535
1536 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1538 {
1539 return m_revision;
1540 }
1541
1542 template<
1543 typename T,
1544 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1546 {
1547 return m_revision.get<CameraInfo::Revision::Major>();
1548 }
1549
1550 template<
1551 typename T,
1552 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1554 {
1555 return m_revision.get<CameraInfo::Revision::Minor>();
1556 }
1557
1558 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1560 {
1561 return m_serialNumber;
1562 }
1563
1564 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1566 {
1567 return m_userData;
1568 }
1569
1570 template<
1571 typename T,
1572 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1574 {
1575 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1576 }
1577
1578 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1580 {
1581 return m_firmwareVersion;
1582 }
1583
1584 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1585 const CameraInfo::Model &get() const
1586 {
1587 return m_model;
1588 }
1589
1590 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1592 {
1593 return m_modelName;
1594 }
1595
1596 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1598 {
1599 return m_revision;
1600 }
1601
1602 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1604 {
1605 return m_serialNumber;
1606 }
1607
1608 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1610 {
1611 return m_userData;
1612 }
1613
1615 template<typename F>
1616 void forEach(const F &f) const
1617 {
1618 f(m_firmwareVersion);
1619 f(m_model);
1620 f(m_modelName);
1621 f(m_revision);
1622 f(m_serialNumber);
1623 f(m_userData);
1624 }
1625
1627 template<typename F>
1628 void forEach(const F &f)
1629 {
1630 f(m_firmwareVersion);
1631 f(m_model);
1632 f(m_modelName);
1633 f(m_revision);
1634 f(m_serialNumber);
1635 f(m_userData);
1636 }
1637
1639 bool operator==(const CameraInfo &other) const;
1640
1642 bool operator!=(const CameraInfo &other) const;
1643
1645 std::string toString() const;
1646
1648 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1649 {
1650 return stream << value.toString();
1651 }
1652
1654 void save(const std::string &fileName) const;
1655
1657 void load(const std::string &fileName);
1658
1659 private:
1660 void setFromString(const std::string &value);
1661
1662 void setFromString(const std::string &fullPath, const std::string &value);
1663
1664 std::string getString(const std::string &fullPath) const;
1665
1666 FirmwareVersion m_firmwareVersion;
1667 Model m_model;
1668 ModelName m_modelName;
1669 Revision m_revision;
1670 SerialNumber m_serialNumber;
1671 UserData m_userData;
1672
1673 friend struct DataModel::Detail::Befriend<CameraInfo>;
1674 };
1675
1676#ifndef NO_DOC
1678 namespace Detail
1679 {
1680 ZIVID_CORE_EXPORT void save(const CameraInfo &dataModel, std::ostream &ostream);
1681 ZIVID_CORE_EXPORT void load(CameraInfo &dataModel, std::istream &istream);
1682 } // namespace Detail
1683#endif
1684
1685#ifndef NO_DOC
1686 template<>
1687 struct CameraInfo::Version<3>
1688 {
1689 using Type = CameraInfo;
1690 };
1691#endif
1692
1693} // namespace Zivid
1694
1695#ifdef _MSC_VER
1696# pragma warning(pop)
1697#endif
1698
1699#ifndef NO_DOC
1700# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1701namespace std // NOLINT
1702{
1703
1704 template<>
1705 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1706 {};
1707
1708 template<size_t i>
1709 struct tuple_element<i, Zivid::CameraInfo::Revision>
1710 {
1711 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1712
1713 using type // NOLINT
1714 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1715 };
1716
1717 template<>
1718 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1719 {};
1720
1721 template<size_t i>
1722 struct tuple_element<i, Zivid::CameraInfo::UserData>
1723 {
1724 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1725
1726 using type // NOLINT
1727 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1728 };
1729
1730 template<>
1731 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 6>
1732 {};
1733
1734 template<size_t i>
1735 struct tuple_element<i, Zivid::CameraInfo>
1736 {
1737 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 6");
1738
1739 using type // NOLINT
1740 = decltype(declval<Zivid::CameraInfo>().get<i>());
1741 };
1742
1743} // namespace std
1744# endif
1745#endif
1746
1747// If we have access to the DataModel library, automatically include internal DataModel
1748// header. This header is necessary for serialization and deserialization.
1749#if defined(__has_include) && !defined(NO_DOC)
1750# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1751# include "Zivid/CameraInfoInternal.h"
1752# endif
1753#endif
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
The firmware version on the camera
Definition: CameraInfo.h:157
std::string toString() const
Get the value as string
bool operator==(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:195
FirmwareVersion(std::string value)
Constructor
Definition: CameraInfo.h:184
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for FirmwareVersion
Definition: CameraInfo.h:175
bool operator<(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:207
bool operator<=(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:219
bool operator>=(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:225
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:231
bool operator>(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:213
bool operator!=(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:201
std::string ValueType
The type of the underlying value
Definition: CameraInfo.h:172
FirmwareVersion()=default
Default constructor
The model name of the camera. This is a user-friendly display name that may contain spaces and specia...
Definition: CameraInfo.h:350
bool operator==(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:392
ModelName()=default
Default constructor
bool operator<=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:416
std::string toString() const
Get the value as string
ModelName(std::string value)
Constructor
Definition: CameraInfo.h:381
std::string ValueType
The type of the underlying value
Definition: CameraInfo.h:369
bool operator<(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:404
bool operator>(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:410
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:428
const std::string & value() const
Get the value
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName
Definition: CameraInfo.h:372
bool operator>=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:422
bool operator!=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:398
The model of the camera
Definition: CameraInfo.h:248
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition: CameraInfo.h:272
static const Model zivid2PlusM130
zivid2PlusM130
Definition: CameraInfo.h:277
static const Model zividTwo
zividTwo
Definition: CameraInfo.h:275
std::string toString() const
Get the value as string
constexpr Model(ValueType value)
Constructor
Definition: CameraInfo.h:290
Model()=default
Default constructor
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition: CameraInfo.h:273
ValueType value() const
Get the value
friend std::ostream & operator<<(std::ostream &stream, const Model::ValueType &value)
Operator to serialize ValueType to a stream
Definition: CameraInfo.h:301
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:319
static std::set< ValueType > validValues()
All valid values of Model
Definition: CameraInfo.h:280
ValueType
The type of the underlying value
Definition: CameraInfo.h:264
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition: CameraInfo.h:274
bool operator!=(const Model &other) const
Comparison operator
Definition: CameraInfo.h:313
static const Model zividTwoL100
zividTwoL100
Definition: CameraInfo.h:276
bool operator==(const Model &other) const
Comparison operator
Definition: CameraInfo.h:307
Major hardware revision number
Definition: CameraInfo.h:463
std::string toString() const
Get the value as string
bool operator!=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:507
uint32_t ValueType
The type of the underlying value
Definition: CameraInfo.h:478
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:537
static constexpr Range< uint32_t > validRange()
The range of valid values for Major
Definition: CameraInfo.h:481
bool operator>=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:531
bool operator<=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:525
bool operator>(const Major &other) const
Comparison operator
Definition: CameraInfo.h:519
uint32_t value() const
Get the value
constexpr Major(uint32_t value)
Constructor
Definition: CameraInfo.h:490
bool operator<(const Major &other) const
Comparison operator
Definition: CameraInfo.h:513
Major()=default
Default constructor
bool operator==(const Major &other) const
Comparison operator
Definition: CameraInfo.h:501
Minor hardware revision number
Definition: CameraInfo.h:554
bool operator>(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:610
bool operator!=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:598
bool operator<=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:616
constexpr Minor(uint32_t value)
Constructor
Definition: CameraInfo.h:581
uint32_t ValueType
The type of the underlying value
Definition: CameraInfo.h:569
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:628
bool operator==(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:592
std::string toString() const
Get the value as string
Minor()=default
Default constructor
bool operator>=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:622
bool operator<(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:604
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor
Definition: CameraInfo.h:572
uint32_t value() const
Get the value
The hardware revision of the camera
Definition: CameraInfo.h:445
const Major & major() const
Get Major
Definition: CameraInfo.h:750
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:730
Minor & minor()
Get Minor
Definition: CameraInfo.h:775
Revision & set(const Minor &value)
Set Minor
Definition: CameraInfo.h:781
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition: CameraInfo.h:641
Revision & set(const Major &value)
Set Major
Definition: CameraInfo.h:762
bool operator==(const Revision &other) const
Equality operator
const CameraInfo::Revision::Minor & get() const
Definition: CameraInfo.h:798
std::string toString() const
Get the value as string
const Minor & minor() const
Get Minor
Definition: CameraInfo.h:769
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraInfo.h:825
Major & major()
Get Major
Definition: CameraInfo.h:756
const CameraInfo::Revision::Major & get() const
Definition: CameraInfo.h:790
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:817
Revision(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:669
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:841
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:697
bool operator!=(const Revision &other) const
Inequality operator
The serial number of the camera
Definition: CameraInfo.h:863
SerialNumber(std::string value)
Constructor
Definition: CameraInfo.h:890
const std::string & value() const
Get the value
bool operator==(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:901
std::string ValueType
The type of the underlying value
Definition: CameraInfo.h:878
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:937
std::string toString() const
Get the value as string
bool operator>(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:919
bool operator<(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:913
bool operator<=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:925
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber
Definition: CameraInfo.h:881
bool operator>=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:931
bool operator!=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:907
The maximum number of bytes of user data that can be stored in the camera
Definition: CameraInfo.h:974
bool operator!=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1020
bool operator<=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1038
bool operator>(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1032
MaxSizeBytes()=default
Default constructor
constexpr MaxSizeBytes(uint64_t value)
Constructor
Definition: CameraInfo.h:1003
uint64_t value() const
Get the value
bool operator<(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1026
bool operator==(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1014
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:1050
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes
Definition: CameraInfo.h:994
uint64_t ValueType
The type of the underlying value
Definition: CameraInfo.h:991
bool operator>=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1044
Information about user data capabilities of the camera
Definition: CameraInfo.h:954
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:1210
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes
Definition: CameraInfo.h:1175
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:1149
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:1225
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:1203
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition: CameraInfo.h:1190
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition: CameraInfo.h:1063
bool operator!=(const UserData &other) const
Inequality operator
UserData()
Default constructor
UserData(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:1090
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes
Definition: CameraInfo.h:1169
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes
Definition: CameraInfo.h:1181
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:1117
Information about camera model, serial number etc.
Definition: CameraInfo.h:123
bool operator==(const CameraInfo &other) const
Equality operator
Revision & revision()
Get Revision
Definition: CameraInfo.h:1445
const ModelName & modelName() const
Get ModelName
Definition: CameraInfo.h:1420
FirmwareVersion & firmwareVersion()
Get FirmwareVersion
Definition: CameraInfo.h:1388
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraInfo.h:1628
const UserData & userData() const
Get UserData
Definition: CameraInfo.h:1491
ModelName & modelName()
Get ModelName
Definition: CameraInfo.h:1426
bool operator!=(const CameraInfo &other) const
Inequality operator
CameraInfo & set(const Model &value)
Set Model
Definition: CameraInfo.h:1413
const CameraInfo::FirmwareVersion & get() const
Definition: CameraInfo.h:1519
const CameraInfo::Model & get() const
Definition: CameraInfo.h:1525
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file
UserData & userData()
Get UserData
Definition: CameraInfo.h:1497
CameraInfo & set(const ModelName &value)
Set ModelName
Definition: CameraInfo.h:1432
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion
Definition: CameraInfo.h:1382
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition: CameraInfo.h:1573
const Model & model() const
Get Model
Definition: CameraInfo.h:1401
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:1363
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:1616
Model & model()
Get Model
Definition: CameraInfo.h:1407
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:1648
const CameraInfo::ModelName & get() const
Definition: CameraInfo.h:1531
CameraInfo & set(const UserData &value)
Set UserData
Definition: CameraInfo.h:1503
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes
Definition: CameraInfo.h:1510
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:1288
const CameraInfo::UserData & get() const
Definition: CameraInfo.h:1565
const CameraInfo::Revision::Minor & get() const
Definition: CameraInfo.h:1553
const SerialNumber & serialNumber() const
Get SerialNumber
Definition: CameraInfo.h:1472
SerialNumber & serialNumber()
Get SerialNumber
Definition: CameraInfo.h:1478
const Revision & revision() const
Get Revision
Definition: CameraInfo.h:1439
std::tuple< CameraInfo::FirmwareVersion, CameraInfo::Model, CameraInfo::ModelName, CameraInfo::Revision, CameraInfo::Revision::Major, CameraInfo::Revision::Minor, CameraInfo::SerialNumber, CameraInfo::UserData, CameraInfo::UserData::MaxSizeBytes > Descendants
Definition: CameraInfo.h:1251
void load(const std::string &fileName)
Load from the given file
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion
Definition: CameraInfo.h:1394
const CameraInfo::Revision::Major & get() const
Definition: CameraInfo.h:1545
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:1323
CameraInfo & set(const Revision &value)
Set Revision
Definition: CameraInfo.h:1451
CameraInfo & set(const Revision::Major &value)
Set Revision::Major
Definition: CameraInfo.h:1458
CameraInfo & set(const SerialNumber &value)
Set SerialNumber
Definition: CameraInfo.h:1484
const CameraInfo::SerialNumber & get() const
Definition: CameraInfo.h:1559
const CameraInfo::Revision & get() const
Definition: CameraInfo.h:1537
std::string toString() const
Get the value as string
CameraInfo()
Default constructor
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor
Definition: CameraInfo.h:1465
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:118
NodeType
Definition: NodeType.h:100
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99