Zivid C++ API 2.9.0+4dbba385-1
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{ 1 };
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 };
274 static const Model zividTwo;
275 static const Model zividTwoL100;
276
278 static std::set<ValueType> validValues()
279 {
280 return { ValueType::zividOnePlusSmall,
281 ValueType::zividOnePlusMedium,
282 ValueType::zividOnePlusLarge,
283 ValueType::zividTwo,
284 ValueType::zividTwoL100 };
285 }
286
288 Model() = default;
289
291 explicit constexpr Model(ValueType value)
292 : m_value{ verifyValue(value) }
293 {}
294
297
299 std::string toString() const;
300
302 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
303 {
304 return stream << Model{ value }.toString();
305 }
306
308 bool operator==(const Model &other) const
309 {
310 return m_value == other.m_value;
311 }
312
314 bool operator!=(const Model &other) const
315 {
316 return m_value != other.m_value;
317 }
318
320 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
321 {
322 return stream << value.toString();
323 }
324
325 private:
326 void setFromString(const std::string &value);
327
328 constexpr ValueType static verifyValue(const ValueType &value)
329 {
330 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
331 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
332 || value == ValueType::zividTwoL100
333 ? value
334 : throw std::invalid_argument{
335 "Invalid value: Model{ "
336 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
337 };
338 }
339
340 ValueType m_value{ ValueType::zividOnePlusSmall };
341
342 friend struct DataModel::Detail::Befriend<Model>;
343 };
344
346
347 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
349 {
350 public:
353
355 static constexpr const char *path{ "ModelName" };
356
358 static constexpr const char *name{ "ModelName" };
359
361 static constexpr const char *description{ R"description(The model name of the camera)description" };
362
364 using ValueType = std::string;
365
368 {
369 return { 0, std::numeric_limits<ValueType::size_type>::max() };
370 }
371
373 ModelName() = default;
374
376 explicit ModelName(std::string value)
377 : m_value{ std::move(value) }
378 {}
379
381 const std::string &value() const;
382
384 std::string toString() const;
385
387 bool operator==(const ModelName &other) const
388 {
389 return m_value == other.m_value;
390 }
391
393 bool operator!=(const ModelName &other) const
394 {
395 return m_value != other.m_value;
396 }
397
399 bool operator<(const ModelName &other) const
400 {
401 return m_value < other.m_value;
402 }
403
405 bool operator>(const ModelName &other) const
406 {
407 return m_value > other.m_value;
408 }
409
411 bool operator<=(const ModelName &other) const
412 {
413 return m_value <= other.m_value;
414 }
415
417 bool operator>=(const ModelName &other) const
418 {
419 return m_value >= other.m_value;
420 }
421
423 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
424 {
425 return stream << value.toString();
426 }
427
428 private:
429 void setFromString(const std::string &value);
430
431 std::string m_value{};
432
433 friend struct DataModel::Detail::Befriend<ModelName>;
434 };
435
437
438 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
440 {
441 public:
444
446 static constexpr const char *path{ "Revision" };
447
449 static constexpr const char *name{ "Revision" };
450
452 static constexpr const char *description{ R"description(The hardware revision of the camera)description" };
453
455
456 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
458 {
459 public:
462
464 static constexpr const char *path{ "Revision/Major" };
465
467 static constexpr const char *name{ "Major" };
468
470 static constexpr const char *description{ R"description(Major hardware revision number)description" };
471
473 using ValueType = uint32_t;
474
476 static constexpr Range<uint32_t> validRange()
477 {
478 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
479 }
480
482 Major() = default;
483
485 explicit constexpr Major(uint32_t value)
486 : m_value{ value }
487 {}
488
490 uint32_t value() const;
491
493 std::string toString() const;
494
496 bool operator==(const Major &other) const
497 {
498 return m_value == other.m_value;
499 }
500
502 bool operator!=(const Major &other) const
503 {
504 return m_value != other.m_value;
505 }
506
508 bool operator<(const Major &other) const
509 {
510 return m_value < other.m_value;
511 }
512
514 bool operator>(const Major &other) const
515 {
516 return m_value > other.m_value;
517 }
518
520 bool operator<=(const Major &other) const
521 {
522 return m_value <= other.m_value;
523 }
524
526 bool operator>=(const Major &other) const
527 {
528 return m_value >= other.m_value;
529 }
530
532 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
533 {
534 return stream << value.toString();
535 }
536
537 private:
538 void setFromString(const std::string &value);
539
540 uint32_t m_value{ 0 };
541
542 friend struct DataModel::Detail::Befriend<Major>;
543 };
544
546
547 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
549 {
550 public:
553
555 static constexpr const char *path{ "Revision/Minor" };
556
558 static constexpr const char *name{ "Minor" };
559
561 static constexpr const char *description{ R"description(Minor hardware revision number)description" };
562
564 using ValueType = uint32_t;
565
567 static constexpr Range<uint32_t> validRange()
568 {
569 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
570 }
571
573 Minor() = default;
574
576 explicit constexpr Minor(uint32_t value)
577 : m_value{ value }
578 {}
579
581 uint32_t value() const;
582
584 std::string toString() const;
585
587 bool operator==(const Minor &other) const
588 {
589 return m_value == other.m_value;
590 }
591
593 bool operator!=(const Minor &other) const
594 {
595 return m_value != other.m_value;
596 }
597
599 bool operator<(const Minor &other) const
600 {
601 return m_value < other.m_value;
602 }
603
605 bool operator>(const Minor &other) const
606 {
607 return m_value > other.m_value;
608 }
609
611 bool operator<=(const Minor &other) const
612 {
613 return m_value <= other.m_value;
614 }
615
617 bool operator>=(const Minor &other) const
618 {
619 return m_value >= other.m_value;
620 }
621
623 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
624 {
625 return stream << value.toString();
626 }
627
628 private:
629 void setFromString(const std::string &value);
630
631 uint32_t m_value{ 0 };
632
633 friend struct DataModel::Detail::Befriend<Minor>;
634 };
635
636 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
637
640
653#ifndef NO_DOC
654 template<
655 typename... Args,
656 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
657 typename std::enable_if<
658 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
659 value,
660 int>::type = 0>
661#else
662 template<typename... Args>
663#endif
664 explicit Revision(Args &&...args)
665 {
666 using namespace Zivid::Detail::TypeTraits;
667
668 static_assert(
669 AllArgsDecayedAreUnique<Args...>::value,
670 "Found duplicate types among the arguments passed to Revision(...). "
671 "Types should be listed at most once.");
672
673 set(std::forward<Args>(args)...);
674 }
675
687#ifndef NO_DOC
688 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
689#else
690 template<typename... Args>
691#endif
692 void set(Args &&...args)
693 {
694 using namespace Zivid::Detail::TypeTraits;
695
696 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
697 static_assert(
698 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
699
700 static_assert(
701 AllArgsDecayedAreUnique<Args...>::value,
702 "Found duplicate types among the arguments passed to set(...). "
703 "Types should be listed at most once.");
704
705 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
706 }
707
720#ifndef NO_DOC
721 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
722#else
723 template<typename... Args>
724#endif
725 Revision copyWith(Args &&...args) const
726 {
727 using namespace Zivid::Detail::TypeTraits;
728
729 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
730 static_assert(
731 AllArgsAreDescendantNodes::value,
732 "All arguments passed to copyWith(...) must be descendant nodes.");
733
734 static_assert(
735 AllArgsDecayedAreUnique<Args...>::value,
736 "Found duplicate types among the arguments passed to copyWith(...). "
737 "Types should be listed at most once.");
738
739 auto copy{ *this };
740 copy.set(std::forward<Args>(args)...);
741 return copy;
742 }
743
745 const Major &major() const
746 {
747 return m_major;
748 }
749
752 {
753 return m_major;
754 }
755
757 Revision &set(const Major &value)
758 {
759 m_major = value;
760 return *this;
761 }
762
764 const Minor &minor() const
765 {
766 return m_minor;
767 }
768
771 {
772 return m_minor;
773 }
774
776 Revision &set(const Minor &value)
777 {
778 m_minor = value;
779 return *this;
780 }
781
782 template<
783 typename T,
784 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
786 {
787 return m_major;
788 }
789
790 template<
791 typename T,
792 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
794 {
795 return m_minor;
796 }
797
798 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
800 {
801 return m_major;
802 }
803
804 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
806 {
807 return m_minor;
808 }
809
811 template<typename F>
812 void forEach(const F &f) const
813 {
814 f(m_major);
815 f(m_minor);
816 }
817
819 template<typename F>
820 void forEach(const F &f)
821 {
822 f(m_major);
823 f(m_minor);
824 }
825
827 bool operator==(const Revision &other) const;
828
830 bool operator!=(const Revision &other) const;
831
833 std::string toString() const;
834
836 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
837 {
838 return stream << value.toString();
839 }
840
841 private:
842 void setFromString(const std::string &value);
843
844 void setFromString(const std::string &fullPath, const std::string &value);
845
846 std::string getString(const std::string &fullPath) const;
847
848 Major m_major;
849 Minor m_minor;
850
851 friend struct DataModel::Detail::Befriend<Revision>;
852 };
853
855
856 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
858 {
859 public:
862
864 static constexpr const char *path{ "SerialNumber" };
865
867 static constexpr const char *name{ "SerialNumber" };
868
870 static constexpr const char *description{ R"description(The serial number of the camera)description" };
871
873 using ValueType = std::string;
874
877 {
878 return { 0, std::numeric_limits<ValueType::size_type>::max() };
879 }
880
882 SerialNumber() = default;
883
885 explicit SerialNumber(std::string value)
886 : m_value{ std::move(value) }
887 {}
888
890 const std::string &value() const;
891
893 std::string toString() const;
894
896 bool operator==(const SerialNumber &other) const
897 {
898 return m_value == other.m_value;
899 }
900
902 bool operator!=(const SerialNumber &other) const
903 {
904 return m_value != other.m_value;
905 }
906
908 bool operator<(const SerialNumber &other) const
909 {
910 return m_value < other.m_value;
911 }
912
914 bool operator>(const SerialNumber &other) const
915 {
916 return m_value > other.m_value;
917 }
918
920 bool operator<=(const SerialNumber &other) const
921 {
922 return m_value <= other.m_value;
923 }
924
926 bool operator>=(const SerialNumber &other) const
927 {
928 return m_value >= other.m_value;
929 }
930
932 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
933 {
934 return stream << value.toString();
935 }
936
937 private:
938 void setFromString(const std::string &value);
939
940 std::string m_value{};
941
942 friend struct DataModel::Detail::Befriend<SerialNumber>;
943 };
944
946
947 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
949 {
950 public:
953
955 static constexpr const char *path{ "UserData" };
956
958 static constexpr const char *name{ "UserData" };
959
961 static constexpr const char *description{
962 R"description(Information about user data capabilities of the camera)description"
963 };
964
966
967 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
969 {
970 public:
973
975 static constexpr const char *path{ "UserData/MaxSizeBytes" };
976
978 static constexpr const char *name{ "MaxSizeBytes" };
979
981 static constexpr const char *description{
982 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
983 };
984
986 using ValueType = uint64_t;
987
989 static constexpr Range<uint64_t> validRange()
990 {
991 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
992 }
993
995 MaxSizeBytes() = default;
996
998 explicit constexpr MaxSizeBytes(uint64_t value)
999 : m_value{ value }
1000 {}
1001
1003 uint64_t value() const;
1004
1006 std::string toString() const;
1007
1009 bool operator==(const MaxSizeBytes &other) const
1010 {
1011 return m_value == other.m_value;
1012 }
1013
1015 bool operator!=(const MaxSizeBytes &other) const
1016 {
1017 return m_value != other.m_value;
1018 }
1019
1021 bool operator<(const MaxSizeBytes &other) const
1022 {
1023 return m_value < other.m_value;
1024 }
1025
1027 bool operator>(const MaxSizeBytes &other) const
1028 {
1029 return m_value > other.m_value;
1030 }
1031
1033 bool operator<=(const MaxSizeBytes &other) const
1034 {
1035 return m_value <= other.m_value;
1036 }
1037
1039 bool operator>=(const MaxSizeBytes &other) const
1040 {
1041 return m_value >= other.m_value;
1042 }
1043
1045 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1046 {
1047 return stream << value.toString();
1048 }
1049
1050 private:
1051 void setFromString(const std::string &value);
1052
1053 uint64_t m_value{ 0 };
1054
1055 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1056 };
1057
1058 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1059
1062
1074#ifndef NO_DOC
1075 template<
1076 typename... Args,
1077 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1078 typename std::enable_if<
1079 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1080 value,
1081 int>::type = 0>
1082#else
1083 template<typename... Args>
1084#endif
1085 explicit UserData(Args &&...args)
1086 {
1087 using namespace Zivid::Detail::TypeTraits;
1088
1089 static_assert(
1090 AllArgsDecayedAreUnique<Args...>::value,
1091 "Found duplicate types among the arguments passed to UserData(...). "
1092 "Types should be listed at most once.");
1093
1094 set(std::forward<Args>(args)...);
1095 }
1096
1107#ifndef NO_DOC
1108 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1109#else
1110 template<typename... Args>
1111#endif
1112 void set(Args &&...args)
1113 {
1114 using namespace Zivid::Detail::TypeTraits;
1115
1116 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1117 static_assert(
1118 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1119
1120 static_assert(
1121 AllArgsDecayedAreUnique<Args...>::value,
1122 "Found duplicate types among the arguments passed to set(...). "
1123 "Types should be listed at most once.");
1124
1125 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1126 }
1127
1139#ifndef NO_DOC
1140 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1141#else
1142 template<typename... Args>
1143#endif
1144 UserData copyWith(Args &&...args) const
1145 {
1146 using namespace Zivid::Detail::TypeTraits;
1147
1148 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1149 static_assert(
1150 AllArgsAreDescendantNodes::value,
1151 "All arguments passed to copyWith(...) must be descendant nodes.");
1152
1153 static_assert(
1154 AllArgsDecayedAreUnique<Args...>::value,
1155 "Found duplicate types among the arguments passed to copyWith(...). "
1156 "Types should be listed at most once.");
1157
1158 auto copy{ *this };
1159 copy.set(std::forward<Args>(args)...);
1160 return copy;
1161 }
1162
1165 {
1166 return m_maxSizeBytes;
1167 }
1168
1171 {
1172 return m_maxSizeBytes;
1173 }
1174
1177 {
1178 m_maxSizeBytes = value;
1179 return *this;
1180 }
1181
1182 template<
1183 typename T,
1184 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1186 {
1187 return m_maxSizeBytes;
1188 }
1189
1190 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1192 {
1193 return m_maxSizeBytes;
1194 }
1195
1197 template<typename F>
1198 void forEach(const F &f) const
1199 {
1200 f(m_maxSizeBytes);
1201 }
1202
1204 template<typename F>
1205 void forEach(const F &f)
1206 {
1207 f(m_maxSizeBytes);
1208 }
1209
1211 bool operator==(const UserData &other) const;
1212
1214 bool operator!=(const UserData &other) const;
1215
1217 std::string toString() const;
1218
1220 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1221 {
1222 return stream << value.toString();
1223 }
1224
1225 private:
1226 void setFromString(const std::string &value);
1227
1228 void setFromString(const std::string &fullPath, const std::string &value);
1229
1230 std::string getString(const std::string &fullPath) const;
1231
1232 MaxSizeBytes m_maxSizeBytes;
1233
1234 friend struct DataModel::Detail::Befriend<UserData>;
1235 };
1236
1237 using Descendants = std::tuple<
1247
1250
1252 explicit CameraInfo(const std::string &fileName);
1253
1273#ifndef NO_DOC
1274 template<
1275 typename... Args,
1276 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1277 typename std::enable_if<
1278 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1279 int>::type = 0>
1280#else
1281 template<typename... Args>
1282#endif
1283 explicit CameraInfo(Args &&...args)
1284 {
1285 using namespace Zivid::Detail::TypeTraits;
1286
1287 static_assert(
1288 AllArgsDecayedAreUnique<Args...>::value,
1289 "Found duplicate types among the arguments passed to CameraInfo(...). "
1290 "Types should be listed at most once.");
1291
1292 set(std::forward<Args>(args)...);
1293 }
1294
1313#ifndef NO_DOC
1314 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1315#else
1316 template<typename... Args>
1317#endif
1318 void set(Args &&...args)
1319 {
1320 using namespace Zivid::Detail::TypeTraits;
1321
1322 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1323 static_assert(
1324 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1325
1326 static_assert(
1327 AllArgsDecayedAreUnique<Args...>::value,
1328 "Found duplicate types among the arguments passed to set(...). "
1329 "Types should be listed at most once.");
1330
1331 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1332 }
1333
1353#ifndef NO_DOC
1354 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1355#else
1356 template<typename... Args>
1357#endif
1358 CameraInfo copyWith(Args &&...args) const
1359 {
1360 using namespace Zivid::Detail::TypeTraits;
1361
1362 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1363 static_assert(
1364 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1365
1366 static_assert(
1367 AllArgsDecayedAreUnique<Args...>::value,
1368 "Found duplicate types among the arguments passed to copyWith(...). "
1369 "Types should be listed at most once.");
1370
1371 auto copy{ *this };
1372 copy.set(std::forward<Args>(args)...);
1373 return copy;
1374 }
1375
1378 {
1379 return m_firmwareVersion;
1380 }
1381
1384 {
1385 return m_firmwareVersion;
1386 }
1387
1390 {
1391 m_firmwareVersion = value;
1392 return *this;
1393 }
1394
1396 const Model &model() const
1397 {
1398 return m_model;
1399 }
1400
1403 {
1404 return m_model;
1405 }
1406
1408 CameraInfo &set(const Model &value)
1409 {
1410 m_model = value;
1411 return *this;
1412 }
1413
1415 const ModelName &modelName() const
1416 {
1417 return m_modelName;
1418 }
1419
1422 {
1423 return m_modelName;
1424 }
1425
1427 CameraInfo &set(const ModelName &value)
1428 {
1429 m_modelName = value;
1430 return *this;
1431 }
1432
1434 const Revision &revision() const
1435 {
1436 return m_revision;
1437 }
1438
1441 {
1442 return m_revision;
1443 }
1444
1446 CameraInfo &set(const Revision &value)
1447 {
1448 m_revision = value;
1449 return *this;
1450 }
1451
1454 {
1455 m_revision.set(value);
1456 return *this;
1457 }
1458
1461 {
1462 m_revision.set(value);
1463 return *this;
1464 }
1465
1468 {
1469 return m_serialNumber;
1470 }
1471
1474 {
1475 return m_serialNumber;
1476 }
1477
1480 {
1481 m_serialNumber = value;
1482 return *this;
1483 }
1484
1486 const UserData &userData() const
1487 {
1488 return m_userData;
1489 }
1490
1493 {
1494 return m_userData;
1495 }
1496
1498 CameraInfo &set(const UserData &value)
1499 {
1500 m_userData = value;
1501 return *this;
1502 }
1503
1506 {
1507 m_userData.set(value);
1508 return *this;
1509 }
1510
1511 template<
1512 typename T,
1513 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1515 {
1516 return m_firmwareVersion;
1517 }
1518
1519 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1520 const CameraInfo::Model &get() const
1521 {
1522 return m_model;
1523 }
1524
1525 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1527 {
1528 return m_modelName;
1529 }
1530
1531 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1533 {
1534 return m_revision;
1535 }
1536
1537 template<
1538 typename T,
1539 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1541 {
1542 return m_revision.get<CameraInfo::Revision::Major>();
1543 }
1544
1545 template<
1546 typename T,
1547 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1549 {
1550 return m_revision.get<CameraInfo::Revision::Minor>();
1551 }
1552
1553 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1555 {
1556 return m_serialNumber;
1557 }
1558
1559 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1561 {
1562 return m_userData;
1563 }
1564
1565 template<
1566 typename T,
1567 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1569 {
1570 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1571 }
1572
1573 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1575 {
1576 return m_firmwareVersion;
1577 }
1578
1579 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1580 const CameraInfo::Model &get() const
1581 {
1582 return m_model;
1583 }
1584
1585 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1587 {
1588 return m_modelName;
1589 }
1590
1591 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1593 {
1594 return m_revision;
1595 }
1596
1597 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1599 {
1600 return m_serialNumber;
1601 }
1602
1603 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1605 {
1606 return m_userData;
1607 }
1608
1610 template<typename F>
1611 void forEach(const F &f) const
1612 {
1613 f(m_firmwareVersion);
1614 f(m_model);
1615 f(m_modelName);
1616 f(m_revision);
1617 f(m_serialNumber);
1618 f(m_userData);
1619 }
1620
1622 template<typename F>
1623 void forEach(const F &f)
1624 {
1625 f(m_firmwareVersion);
1626 f(m_model);
1627 f(m_modelName);
1628 f(m_revision);
1629 f(m_serialNumber);
1630 f(m_userData);
1631 }
1632
1634 bool operator==(const CameraInfo &other) const;
1635
1637 bool operator!=(const CameraInfo &other) const;
1638
1640 std::string toString() const;
1641
1643 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1644 {
1645 return stream << value.toString();
1646 }
1647
1649 void save(const std::string &fileName) const;
1650
1652 void load(const std::string &fileName);
1653
1654 private:
1655 void setFromString(const std::string &value);
1656
1657 void setFromString(const std::string &fullPath, const std::string &value);
1658
1659 std::string getString(const std::string &fullPath) const;
1660
1661 FirmwareVersion m_firmwareVersion;
1662 Model m_model;
1663 ModelName m_modelName;
1664 Revision m_revision;
1665 SerialNumber m_serialNumber;
1666 UserData m_userData;
1667
1668 friend struct DataModel::Detail::Befriend<CameraInfo>;
1669 };
1670
1671#ifndef NO_DOC
1673 namespace Detail
1674 {
1675 ZIVID_CORE_EXPORT void save(const CameraInfo &dataModel, std::ostream &ostream);
1676 ZIVID_CORE_EXPORT void load(CameraInfo &dataModel, std::istream &istream);
1677 } // namespace Detail
1678#endif
1679
1680#ifndef NO_DOC
1681 template<>
1682 struct CameraInfo::Version<1>
1683 {
1684 using Type = CameraInfo;
1685 };
1686#endif
1687
1688} // namespace Zivid
1689
1690#ifdef _MSC_VER
1691# pragma warning(pop)
1692#endif
1693
1694#ifndef NO_DOC
1695# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1696namespace std // NOLINT
1697{
1698
1699 template<>
1700 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1701 {};
1702
1703 template<size_t i>
1704 struct tuple_element<i, Zivid::CameraInfo::Revision>
1705 {
1706 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1707
1708 using type // NOLINT
1709 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1710 };
1711
1712 template<>
1713 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1714 {};
1715
1716 template<size_t i>
1717 struct tuple_element<i, Zivid::CameraInfo::UserData>
1718 {
1719 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1720
1721 using type // NOLINT
1722 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1723 };
1724
1725 template<>
1726 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 6>
1727 {};
1728
1729 template<size_t i>
1730 struct tuple_element<i, Zivid::CameraInfo>
1731 {
1732 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 6");
1733
1734 using type // NOLINT
1735 = decltype(declval<Zivid::CameraInfo>().get<i>());
1736 };
1737
1738} // namespace std
1739# endif
1740#endif
1741
1742// If we have access to the DataModel library, automatically include internal DataModel
1743// header. This header is necessary for serialization and deserialization.
1744#if defined(__has_include) && !defined(NO_DOC)
1745# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1746# include "Zivid/CameraInfoInternal.h"
1747# endif
1748#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
Definition: CameraInfo.h:349
bool operator==(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:387
ModelName()=default
Default constructor
bool operator<=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:411
std::string toString() const
Get the value as string
ModelName(std::string value)
Constructor
Definition: CameraInfo.h:376
std::string ValueType
The type of the underlying value
Definition: CameraInfo.h:364
bool operator<(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:399
bool operator>(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:405
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:423
const std::string & value() const
Get the value
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName
Definition: CameraInfo.h:367
bool operator>=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:417
bool operator!=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:393
The model of the camera
Definition: CameraInfo.h:248
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition: CameraInfo.h:271
static const Model zividTwo
zividTwo
Definition: CameraInfo.h:274
std::string toString() const
Get the value as string
constexpr Model(ValueType value)
Constructor
Definition: CameraInfo.h:291
Model()=default
Default constructor
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition: CameraInfo.h:272
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:302
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:320
static std::set< ValueType > validValues()
All valid values of Model
Definition: CameraInfo.h:278
ValueType
The type of the underlying value
Definition: CameraInfo.h:264
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition: CameraInfo.h:273
bool operator!=(const Model &other) const
Comparison operator
Definition: CameraInfo.h:314
static const Model zividTwoL100
zividTwoL100
Definition: CameraInfo.h:275
bool operator==(const Model &other) const
Comparison operator
Definition: CameraInfo.h:308
Major hardware revision number
Definition: CameraInfo.h:458
std::string toString() const
Get the value as string
bool operator!=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:502
uint32_t ValueType
The type of the underlying value
Definition: CameraInfo.h:473
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:532
static constexpr Range< uint32_t > validRange()
The range of valid values for Major
Definition: CameraInfo.h:476
bool operator>=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:526
bool operator<=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:520
bool operator>(const Major &other) const
Comparison operator
Definition: CameraInfo.h:514
uint32_t value() const
Get the value
constexpr Major(uint32_t value)
Constructor
Definition: CameraInfo.h:485
bool operator<(const Major &other) const
Comparison operator
Definition: CameraInfo.h:508
Major()=default
Default constructor
bool operator==(const Major &other) const
Comparison operator
Definition: CameraInfo.h:496
Minor hardware revision number
Definition: CameraInfo.h:549
bool operator>(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:605
bool operator!=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:593
bool operator<=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:611
constexpr Minor(uint32_t value)
Constructor
Definition: CameraInfo.h:576
uint32_t ValueType
The type of the underlying value
Definition: CameraInfo.h:564
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:623
bool operator==(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:587
std::string toString() const
Get the value as string
Minor()=default
Default constructor
bool operator>=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:617
bool operator<(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:599
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor
Definition: CameraInfo.h:567
uint32_t value() const
Get the value
The hardware revision of the camera
Definition: CameraInfo.h:440
const Major & major() const
Get Major
Definition: CameraInfo.h:745
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:725
Minor & minor()
Get Minor
Definition: CameraInfo.h:770
Revision & set(const Minor &value)
Set Minor
Definition: CameraInfo.h:776
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition: CameraInfo.h:636
Revision & set(const Major &value)
Set Major
Definition: CameraInfo.h:757
bool operator==(const Revision &other) const
Equality operator
const CameraInfo::Revision::Minor & get() const
Definition: CameraInfo.h:793
std::string toString() const
Get the value as string
const Minor & minor() const
Get Minor
Definition: CameraInfo.h:764
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraInfo.h:820
Major & major()
Get Major
Definition: CameraInfo.h:751
const CameraInfo::Revision::Major & get() const
Definition: CameraInfo.h:785
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:812
Revision(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:664
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:836
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:692
bool operator!=(const Revision &other) const
Inequality operator
The serial number of the camera
Definition: CameraInfo.h:858
SerialNumber(std::string value)
Constructor
Definition: CameraInfo.h:885
const std::string & value() const
Get the value
bool operator==(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:896
std::string ValueType
The type of the underlying value
Definition: CameraInfo.h:873
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:932
std::string toString() const
Get the value as string
bool operator>(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:914
bool operator<(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:908
bool operator<=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:920
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber
Definition: CameraInfo.h:876
bool operator>=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:926
bool operator!=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:902
The maximum number of bytes of user data that can be stored in the camera
Definition: CameraInfo.h:969
bool operator!=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1015
bool operator<=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1033
bool operator>(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1027
MaxSizeBytes()=default
Default constructor
constexpr MaxSizeBytes(uint64_t value)
Constructor
Definition: CameraInfo.h:998
uint64_t value() const
Get the value
bool operator<(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1021
bool operator==(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1009
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:1045
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes
Definition: CameraInfo.h:989
uint64_t ValueType
The type of the underlying value
Definition: CameraInfo.h:986
bool operator>=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1039
Information about user data capabilities of the camera
Definition: CameraInfo.h:949
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:1205
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes
Definition: CameraInfo.h:1170
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:1144
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:1220
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:1198
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition: CameraInfo.h:1185
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition: CameraInfo.h:1058
bool operator!=(const UserData &other) const
Inequality operator
UserData()
Default constructor
UserData(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:1085
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes
Definition: CameraInfo.h:1164
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes
Definition: CameraInfo.h:1176
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:1112
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:1440
const ModelName & modelName() const
Get ModelName
Definition: CameraInfo.h:1415
FirmwareVersion & firmwareVersion()
Get FirmwareVersion
Definition: CameraInfo.h:1383
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraInfo.h:1623
const UserData & userData() const
Get UserData
Definition: CameraInfo.h:1486
ModelName & modelName()
Get ModelName
Definition: CameraInfo.h:1421
bool operator!=(const CameraInfo &other) const
Inequality operator
CameraInfo & set(const Model &value)
Set Model
Definition: CameraInfo.h:1408
const CameraInfo::FirmwareVersion & get() const
Definition: CameraInfo.h:1514
const CameraInfo::Model & get() const
Definition: CameraInfo.h:1520
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file
UserData & userData()
Get UserData
Definition: CameraInfo.h:1492
CameraInfo & set(const ModelName &value)
Set ModelName
Definition: CameraInfo.h:1427
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion
Definition: CameraInfo.h:1377
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition: CameraInfo.h:1568
const Model & model() const
Get Model
Definition: CameraInfo.h:1396
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:1358
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:1611
Model & model()
Get Model
Definition: CameraInfo.h:1402
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:1643
const CameraInfo::ModelName & get() const
Definition: CameraInfo.h:1526
CameraInfo & set(const UserData &value)
Set UserData
Definition: CameraInfo.h:1498
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes
Definition: CameraInfo.h:1505
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:1283
const CameraInfo::UserData & get() const
Definition: CameraInfo.h:1560
const CameraInfo::Revision::Minor & get() const
Definition: CameraInfo.h:1548
const SerialNumber & serialNumber() const
Get SerialNumber
Definition: CameraInfo.h:1467
SerialNumber & serialNumber()
Get SerialNumber
Definition: CameraInfo.h:1473
const Revision & revision() const
Get Revision
Definition: CameraInfo.h:1434
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:1246
void load(const std::string &fileName)
Load from the given file
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion
Definition: CameraInfo.h:1389
const CameraInfo::Revision::Major & get() const
Definition: CameraInfo.h:1540
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:1318
CameraInfo & set(const Revision &value)
Set Revision
Definition: CameraInfo.h:1446
CameraInfo & set(const Revision::Major &value)
Set Revision::Major
Definition: CameraInfo.h:1453
CameraInfo & set(const SerialNumber &value)
Set SerialNumber
Definition: CameraInfo.h:1479
const CameraInfo::SerialNumber & get() const
Definition: CameraInfo.h:1554
const CameraInfo::Revision & get() const
Definition: CameraInfo.h:1532
std::string toString() const
Get the value as string
CameraInfo()
Default constructor
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor
Definition: CameraInfo.h:1460
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