Zivid C++ API 2.11.1+de9b5dae-1
CameraInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2024 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <set>
53#include <sstream>
54#include <string>
55#include <tuple>
56#include <utility>
57#include <vector>
58
64#include "Zivid/Range.h"
65
66#ifdef _MSC_VER
67# pragma warning(push)
68# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
69#endif
70
71namespace Zivid
72{
73
75
76 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
78 {
79 public:
81 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
82
84 static constexpr const char *path{ "" };
85
87 static constexpr const char *name{ "CameraInfo" };
88
90 static constexpr const char *description{
91 R"description(Information about camera model, serial number etc.)description"
92 };
93
94 static constexpr size_t version{ 4 };
95
96#ifndef NO_DOC
97 template<size_t>
98 struct Version;
99
100 using LatestVersion = Zivid::CameraInfo;
101
102 // Short identifier. This value is not guaranteed to be universally unique
103 // Todo(ZIVID-2808): Move this to internal DataModelExt header
104 static constexpr std::array<uint8_t, 3> binaryId{ 'n', 'f', 'o' };
105
106#endif
107
109
110 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
112 {
113 public:
115 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
116
118 static constexpr const char *path{ "FirmwareVersion" };
119
121 static constexpr const char *name{ "FirmwareVersion" };
122
124 static constexpr const char *description{ R"description(The firmware version on the camera)description" };
125
127 using ValueType = std::string;
128
131 {
132 return { 0, std::numeric_limits<ValueType::size_type>::max() };
133 }
134
136 FirmwareVersion() = default;
137
139 explicit FirmwareVersion(std::string value)
140 : m_value{ std::move(value) }
141 {}
142
144 const std::string &value() const;
145
147 std::string toString() const;
148
150 bool operator==(const FirmwareVersion &other) const
151 {
152 return m_value == other.m_value;
153 }
154
156 bool operator!=(const FirmwareVersion &other) const
157 {
158 return m_value != other.m_value;
159 }
160
162 bool operator<(const FirmwareVersion &other) const
163 {
164 return m_value < other.m_value;
165 }
166
168 bool operator>(const FirmwareVersion &other) const
169 {
170 return m_value > other.m_value;
171 }
172
174 bool operator<=(const FirmwareVersion &other) const
175 {
176 return m_value <= other.m_value;
177 }
178
180 bool operator>=(const FirmwareVersion &other) const
181 {
182 return m_value >= other.m_value;
183 }
184
186 friend std::ostream &operator<<(std::ostream &stream, const FirmwareVersion &value)
187 {
188 return stream << value.toString();
189 }
190
191 private:
192 void setFromString(const std::string &value);
193
194 std::string m_value{};
195
196 friend struct DataModel::Detail::Befriend<FirmwareVersion>;
197 };
198
200
201 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
203 {
204 public:
206 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
207
209 static constexpr const char *path{ "Model" };
210
212 static constexpr const char *name{ "Model" };
213
215 static constexpr const char *description{ R"description(The model of the camera)description" };
216
218 enum class ValueType
219 {
220 zividOnePlusSmall,
221 zividOnePlusMedium,
222 zividOnePlusLarge,
223 zividTwo,
224 zividTwoL100,
225 zivid2PlusM130,
226 zivid2PlusM60,
227 zivid2PlusL110
228 };
232 static const Model zividTwo;
233 static const Model zividTwoL100;
234 static const Model zivid2PlusM130;
235 static const Model zivid2PlusM60;
236 static const Model zivid2PlusL110;
237
239 static std::set<ValueType> validValues()
240 {
241 return { ValueType::zividOnePlusSmall, ValueType::zividOnePlusMedium, ValueType::zividOnePlusLarge,
242 ValueType::zividTwo, ValueType::zividTwoL100, ValueType::zivid2PlusM130,
243 ValueType::zivid2PlusM60, ValueType::zivid2PlusL110 };
244 }
245
247 Model() = default;
248
250 explicit constexpr Model(ValueType value)
251 : m_value{ verifyValue(value) }
252 {}
253
256
258 std::string toString() const;
259
261 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
262 {
263 return stream << Model{ value }.toString();
264 }
265
267 bool operator==(const Model &other) const
268 {
269 return m_value == other.m_value;
270 }
271
273 bool operator!=(const Model &other) const
274 {
275 return m_value != other.m_value;
276 }
277
279 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
280 {
281 return stream << value.toString();
282 }
283
284 private:
285 void setFromString(const std::string &value);
286
287 constexpr ValueType static verifyValue(const ValueType &value)
288 {
289 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
290 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
291 || value == ValueType::zividTwoL100 || value == ValueType::zivid2PlusM130
292 || value == ValueType::zivid2PlusM60 || value == ValueType::zivid2PlusL110
293 ? value
294 : throw std::invalid_argument{
295 "Invalid value: Model{ "
296 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
297 };
298 }
299
300 ValueType m_value{ ValueType::zividOnePlusSmall };
301
302 friend struct DataModel::Detail::Befriend<Model>;
303 };
304
308
309 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
311 {
312 public:
314 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
315
317 static constexpr const char *path{ "ModelName" };
318
320 static constexpr const char *name{ "ModelName" };
321
323 static constexpr const char *description{
324 R"description(The model name of the camera. This is a user-friendly display name that may contain spaces and special
325characters. We recommend to use `Model` instead if you want to programmatically check for camera model.
326)description"
327 };
328
330 using ValueType = std::string;
331
334 {
335 return { 0, std::numeric_limits<ValueType::size_type>::max() };
336 }
337
339 ModelName() = default;
340
342 explicit ModelName(std::string value)
343 : m_value{ std::move(value) }
344 {}
345
347 const std::string &value() const;
348
350 std::string toString() const;
351
353 bool operator==(const ModelName &other) const
354 {
355 return m_value == other.m_value;
356 }
357
359 bool operator!=(const ModelName &other) const
360 {
361 return m_value != other.m_value;
362 }
363
365 bool operator<(const ModelName &other) const
366 {
367 return m_value < other.m_value;
368 }
369
371 bool operator>(const ModelName &other) const
372 {
373 return m_value > other.m_value;
374 }
375
377 bool operator<=(const ModelName &other) const
378 {
379 return m_value <= other.m_value;
380 }
381
383 bool operator>=(const ModelName &other) const
384 {
385 return m_value >= other.m_value;
386 }
387
389 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
390 {
391 return stream << value.toString();
392 }
393
394 private:
395 void setFromString(const std::string &value);
396
397 std::string m_value{};
398
399 friend struct DataModel::Detail::Befriend<ModelName>;
400 };
401
403
404 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
406 {
407 public:
409 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
410
412 static constexpr const char *path{ "Revision" };
413
415 static constexpr const char *name{ "Revision" };
416
418 static constexpr const char *description{ R"description(The hardware revision of the camera)description" };
419
421
422 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
424 {
425 public:
427 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
428
430 static constexpr const char *path{ "Revision/Major" };
431
433 static constexpr const char *name{ "Major" };
434
436 static constexpr const char *description{ R"description(Major hardware revision number)description" };
437
439 using ValueType = uint32_t;
440
442 static constexpr Range<uint32_t> validRange()
443 {
444 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
445 }
446
448 Major() = default;
449
451 explicit constexpr Major(uint32_t value)
452 : m_value{ value }
453 {}
454
456 uint32_t value() const;
457
459 std::string toString() const;
460
462 bool operator==(const Major &other) const
463 {
464 return m_value == other.m_value;
465 }
466
468 bool operator!=(const Major &other) const
469 {
470 return m_value != other.m_value;
471 }
472
474 bool operator<(const Major &other) const
475 {
476 return m_value < other.m_value;
477 }
478
480 bool operator>(const Major &other) const
481 {
482 return m_value > other.m_value;
483 }
484
486 bool operator<=(const Major &other) const
487 {
488 return m_value <= other.m_value;
489 }
490
492 bool operator>=(const Major &other) const
493 {
494 return m_value >= other.m_value;
495 }
496
498 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
499 {
500 return stream << value.toString();
501 }
502
503 private:
504 void setFromString(const std::string &value);
505
506 uint32_t m_value{ 0 };
507
508 friend struct DataModel::Detail::Befriend<Major>;
509 };
510
512
513 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
515 {
516 public:
518 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
519
521 static constexpr const char *path{ "Revision/Minor" };
522
524 static constexpr const char *name{ "Minor" };
525
527 static constexpr const char *description{ R"description(Minor hardware revision number)description" };
528
530 using ValueType = uint32_t;
531
533 static constexpr Range<uint32_t> validRange()
534 {
535 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
536 }
537
539 Minor() = default;
540
542 explicit constexpr Minor(uint32_t value)
543 : m_value{ value }
544 {}
545
547 uint32_t value() const;
548
550 std::string toString() const;
551
553 bool operator==(const Minor &other) const
554 {
555 return m_value == other.m_value;
556 }
557
559 bool operator!=(const Minor &other) const
560 {
561 return m_value != other.m_value;
562 }
563
565 bool operator<(const Minor &other) const
566 {
567 return m_value < other.m_value;
568 }
569
571 bool operator>(const Minor &other) const
572 {
573 return m_value > other.m_value;
574 }
575
577 bool operator<=(const Minor &other) const
578 {
579 return m_value <= other.m_value;
580 }
581
583 bool operator>=(const Minor &other) const
584 {
585 return m_value >= other.m_value;
586 }
587
589 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
590 {
591 return stream << value.toString();
592 }
593
594 private:
595 void setFromString(const std::string &value);
596
597 uint32_t m_value{ 0 };
598
599 friend struct DataModel::Detail::Befriend<Minor>;
600 };
601
602 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
603
606
619#ifndef NO_DOC
620 template<
621 typename... Args,
622 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
623 typename std::enable_if<
624 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
625 value,
626 int>::type = 0>
627#else
628 template<typename... Args>
629#endif
630 explicit Revision(Args &&...args)
631 {
632 using namespace Zivid::Detail::TypeTraits;
633
634 static_assert(
635 AllArgsDecayedAreUnique<Args...>::value,
636 "Found duplicate types among the arguments passed to Revision(...). "
637 "Types should be listed at most once.");
638
639 set(std::forward<Args>(args)...);
640 }
641
653#ifndef NO_DOC
654 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
655#else
656 template<typename... Args>
657#endif
658 void set(Args &&...args)
659 {
660 using namespace Zivid::Detail::TypeTraits;
661
662 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
663 static_assert(
664 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
665
666 static_assert(
667 AllArgsDecayedAreUnique<Args...>::value,
668 "Found duplicate types among the arguments passed to set(...). "
669 "Types should be listed at most once.");
670
671 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
672 }
673
686#ifndef NO_DOC
687 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
688#else
689 template<typename... Args>
690#endif
691 Revision copyWith(Args &&...args) const
692 {
693 using namespace Zivid::Detail::TypeTraits;
694
695 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
696 static_assert(
697 AllArgsAreDescendantNodes::value,
698 "All arguments passed to copyWith(...) must be descendant nodes.");
699
700 static_assert(
701 AllArgsDecayedAreUnique<Args...>::value,
702 "Found duplicate types among the arguments passed to copyWith(...). "
703 "Types should be listed at most once.");
704
705 auto copy{ *this };
706 copy.set(std::forward<Args>(args)...);
707 return copy;
708 }
709
711 const Major &major() const
712 {
713 return m_major;
714 }
715
718 {
719 return m_major;
720 }
721
723 Revision &set(const Major &value)
724 {
725 m_major = value;
726 return *this;
727 }
728
730 const Minor &minor() const
731 {
732 return m_minor;
733 }
734
737 {
738 return m_minor;
739 }
740
742 Revision &set(const Minor &value)
743 {
744 m_minor = value;
745 return *this;
746 }
747
748 template<
749 typename T,
750 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
752 {
753 return m_major;
754 }
755
756 template<
757 typename T,
758 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
760 {
761 return m_minor;
762 }
763
764 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
766 {
767 return m_major;
768 }
769
770 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
772 {
773 return m_minor;
774 }
775
777 template<typename F>
778 void forEach(const F &f) const
779 {
780 f(m_major);
781 f(m_minor);
782 }
783
785 template<typename F>
786 void forEach(const F &f)
787 {
788 f(m_major);
789 f(m_minor);
790 }
791
793 bool operator==(const Revision &other) const;
794
796 bool operator!=(const Revision &other) const;
797
799 std::string toString() const;
800
802 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
803 {
804 return stream << value.toString();
805 }
806
807 private:
808 void setFromString(const std::string &value);
809
810 void setFromString(const std::string &fullPath, const std::string &value);
811
812 std::string getString(const std::string &fullPath) const;
813
814 Major m_major;
815 Minor m_minor;
816
817 friend struct DataModel::Detail::Befriend<Revision>;
818 };
819
821
822 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
824 {
825 public:
827 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
828
830 static constexpr const char *path{ "SerialNumber" };
831
833 static constexpr const char *name{ "SerialNumber" };
834
836 static constexpr const char *description{ R"description(The serial number of the camera)description" };
837
839 using ValueType = std::string;
840
843 {
844 return { 0, std::numeric_limits<ValueType::size_type>::max() };
845 }
846
848 SerialNumber() = default;
849
851 explicit SerialNumber(std::string value)
852 : m_value{ std::move(value) }
853 {}
854
856 const std::string &value() const;
857
859 std::string toString() const;
860
862 bool operator==(const SerialNumber &other) const
863 {
864 return m_value == other.m_value;
865 }
866
868 bool operator!=(const SerialNumber &other) const
869 {
870 return m_value != other.m_value;
871 }
872
874 bool operator<(const SerialNumber &other) const
875 {
876 return m_value < other.m_value;
877 }
878
880 bool operator>(const SerialNumber &other) const
881 {
882 return m_value > other.m_value;
883 }
884
886 bool operator<=(const SerialNumber &other) const
887 {
888 return m_value <= other.m_value;
889 }
890
892 bool operator>=(const SerialNumber &other) const
893 {
894 return m_value >= other.m_value;
895 }
896
898 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
899 {
900 return stream << value.toString();
901 }
902
903 private:
904 void setFromString(const std::string &value);
905
906 std::string m_value{};
907
908 friend struct DataModel::Detail::Befriend<SerialNumber>;
909 };
910
912
913 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
915 {
916 public:
918 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
919
921 static constexpr const char *path{ "UserData" };
922
924 static constexpr const char *name{ "UserData" };
925
927 static constexpr const char *description{
928 R"description(Information about user data capabilities of the camera)description"
929 };
930
932
933 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
935 {
936 public:
938 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
939
941 static constexpr const char *path{ "UserData/MaxSizeBytes" };
942
944 static constexpr const char *name{ "MaxSizeBytes" };
945
947 static constexpr const char *description{
948 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
949 };
950
952 using ValueType = uint64_t;
953
955 static constexpr Range<uint64_t> validRange()
956 {
957 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
958 }
959
961 MaxSizeBytes() = default;
962
964 explicit constexpr MaxSizeBytes(uint64_t value)
965 : m_value{ value }
966 {}
967
969 uint64_t value() const;
970
972 std::string toString() const;
973
975 bool operator==(const MaxSizeBytes &other) const
976 {
977 return m_value == other.m_value;
978 }
979
981 bool operator!=(const MaxSizeBytes &other) const
982 {
983 return m_value != other.m_value;
984 }
985
987 bool operator<(const MaxSizeBytes &other) const
988 {
989 return m_value < other.m_value;
990 }
991
993 bool operator>(const MaxSizeBytes &other) const
994 {
995 return m_value > other.m_value;
996 }
997
999 bool operator<=(const MaxSizeBytes &other) const
1000 {
1001 return m_value <= other.m_value;
1002 }
1003
1005 bool operator>=(const MaxSizeBytes &other) const
1006 {
1007 return m_value >= other.m_value;
1008 }
1009
1011 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1012 {
1013 return stream << value.toString();
1014 }
1015
1016 private:
1017 void setFromString(const std::string &value);
1018
1019 uint64_t m_value{ 0 };
1020
1021 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1022 };
1023
1024 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1025
1028
1040#ifndef NO_DOC
1041 template<
1042 typename... Args,
1043 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1044 typename std::enable_if<
1045 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1046 value,
1047 int>::type = 0>
1048#else
1049 template<typename... Args>
1050#endif
1051 explicit UserData(Args &&...args)
1052 {
1053 using namespace Zivid::Detail::TypeTraits;
1054
1055 static_assert(
1056 AllArgsDecayedAreUnique<Args...>::value,
1057 "Found duplicate types among the arguments passed to UserData(...). "
1058 "Types should be listed at most once.");
1059
1060 set(std::forward<Args>(args)...);
1061 }
1062
1073#ifndef NO_DOC
1074 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1075#else
1076 template<typename... Args>
1077#endif
1078 void set(Args &&...args)
1079 {
1080 using namespace Zivid::Detail::TypeTraits;
1081
1082 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1083 static_assert(
1084 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1085
1086 static_assert(
1087 AllArgsDecayedAreUnique<Args...>::value,
1088 "Found duplicate types among the arguments passed to set(...). "
1089 "Types should be listed at most once.");
1090
1091 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1092 }
1093
1105#ifndef NO_DOC
1106 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1107#else
1108 template<typename... Args>
1109#endif
1110 UserData copyWith(Args &&...args) const
1111 {
1112 using namespace Zivid::Detail::TypeTraits;
1113
1114 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1115 static_assert(
1116 AllArgsAreDescendantNodes::value,
1117 "All arguments passed to copyWith(...) must be descendant nodes.");
1118
1119 static_assert(
1120 AllArgsDecayedAreUnique<Args...>::value,
1121 "Found duplicate types among the arguments passed to copyWith(...). "
1122 "Types should be listed at most once.");
1123
1124 auto copy{ *this };
1125 copy.set(std::forward<Args>(args)...);
1126 return copy;
1127 }
1128
1131 {
1132 return m_maxSizeBytes;
1133 }
1134
1137 {
1138 return m_maxSizeBytes;
1139 }
1140
1143 {
1144 m_maxSizeBytes = value;
1145 return *this;
1146 }
1147
1148 template<
1149 typename T,
1150 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1152 {
1153 return m_maxSizeBytes;
1154 }
1155
1156 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1158 {
1159 return m_maxSizeBytes;
1160 }
1161
1163 template<typename F>
1164 void forEach(const F &f) const
1165 {
1166 f(m_maxSizeBytes);
1167 }
1168
1170 template<typename F>
1171 void forEach(const F &f)
1172 {
1173 f(m_maxSizeBytes);
1174 }
1175
1177 bool operator==(const UserData &other) const;
1178
1180 bool operator!=(const UserData &other) const;
1181
1183 std::string toString() const;
1184
1186 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1187 {
1188 return stream << value.toString();
1189 }
1190
1191 private:
1192 void setFromString(const std::string &value);
1193
1194 void setFromString(const std::string &fullPath, const std::string &value);
1195
1196 std::string getString(const std::string &fullPath) const;
1197
1198 MaxSizeBytes m_maxSizeBytes;
1199
1200 friend struct DataModel::Detail::Befriend<UserData>;
1201 };
1202
1203 using Descendants = std::tuple<
1213
1216
1218 explicit CameraInfo(const std::string &fileName);
1219
1239#ifndef NO_DOC
1240 template<
1241 typename... Args,
1242 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1243 typename std::enable_if<
1244 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1245 int>::type = 0>
1246#else
1247 template<typename... Args>
1248#endif
1249 explicit CameraInfo(Args &&...args)
1250 {
1251 using namespace Zivid::Detail::TypeTraits;
1252
1253 static_assert(
1254 AllArgsDecayedAreUnique<Args...>::value,
1255 "Found duplicate types among the arguments passed to CameraInfo(...). "
1256 "Types should be listed at most once.");
1257
1258 set(std::forward<Args>(args)...);
1259 }
1260
1279#ifndef NO_DOC
1280 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1281#else
1282 template<typename... Args>
1283#endif
1284 void set(Args &&...args)
1285 {
1286 using namespace Zivid::Detail::TypeTraits;
1287
1288 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1289 static_assert(
1290 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1291
1292 static_assert(
1293 AllArgsDecayedAreUnique<Args...>::value,
1294 "Found duplicate types among the arguments passed to set(...). "
1295 "Types should be listed at most once.");
1296
1297 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1298 }
1299
1319#ifndef NO_DOC
1320 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1321#else
1322 template<typename... Args>
1323#endif
1324 CameraInfo copyWith(Args &&...args) const
1325 {
1326 using namespace Zivid::Detail::TypeTraits;
1327
1328 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1329 static_assert(
1330 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1331
1332 static_assert(
1333 AllArgsDecayedAreUnique<Args...>::value,
1334 "Found duplicate types among the arguments passed to copyWith(...). "
1335 "Types should be listed at most once.");
1336
1337 auto copy{ *this };
1338 copy.set(std::forward<Args>(args)...);
1339 return copy;
1340 }
1341
1344 {
1345 return m_firmwareVersion;
1346 }
1347
1350 {
1351 return m_firmwareVersion;
1352 }
1353
1356 {
1357 m_firmwareVersion = value;
1358 return *this;
1359 }
1360
1362 const Model &model() const
1363 {
1364 return m_model;
1365 }
1366
1369 {
1370 return m_model;
1371 }
1372
1374 CameraInfo &set(const Model &value)
1375 {
1376 m_model = value;
1377 return *this;
1378 }
1379
1381 const ModelName &modelName() const
1382 {
1383 return m_modelName;
1384 }
1385
1388 {
1389 return m_modelName;
1390 }
1391
1393 CameraInfo &set(const ModelName &value)
1394 {
1395 m_modelName = value;
1396 return *this;
1397 }
1398
1400 const Revision &revision() const
1401 {
1402 return m_revision;
1403 }
1404
1407 {
1408 return m_revision;
1409 }
1410
1412 CameraInfo &set(const Revision &value)
1413 {
1414 m_revision = value;
1415 return *this;
1416 }
1417
1420 {
1421 m_revision.set(value);
1422 return *this;
1423 }
1424
1427 {
1428 m_revision.set(value);
1429 return *this;
1430 }
1431
1434 {
1435 return m_serialNumber;
1436 }
1437
1440 {
1441 return m_serialNumber;
1442 }
1443
1446 {
1447 m_serialNumber = value;
1448 return *this;
1449 }
1450
1452 const UserData &userData() const
1453 {
1454 return m_userData;
1455 }
1456
1459 {
1460 return m_userData;
1461 }
1462
1464 CameraInfo &set(const UserData &value)
1465 {
1466 m_userData = value;
1467 return *this;
1468 }
1469
1472 {
1473 m_userData.set(value);
1474 return *this;
1475 }
1476
1477 template<
1478 typename T,
1479 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1481 {
1482 return m_firmwareVersion;
1483 }
1484
1485 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1486 const CameraInfo::Model &get() const
1487 {
1488 return m_model;
1489 }
1490
1491 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1493 {
1494 return m_modelName;
1495 }
1496
1497 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1499 {
1500 return m_revision;
1501 }
1502
1503 template<
1504 typename T,
1505 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1507 {
1508 return m_revision.get<CameraInfo::Revision::Major>();
1509 }
1510
1511 template<
1512 typename T,
1513 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1515 {
1516 return m_revision.get<CameraInfo::Revision::Minor>();
1517 }
1518
1519 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1521 {
1522 return m_serialNumber;
1523 }
1524
1525 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1527 {
1528 return m_userData;
1529 }
1530
1531 template<
1532 typename T,
1533 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1535 {
1536 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1537 }
1538
1539 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1541 {
1542 return m_firmwareVersion;
1543 }
1544
1545 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1546 const CameraInfo::Model &get() const
1547 {
1548 return m_model;
1549 }
1550
1551 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1553 {
1554 return m_modelName;
1555 }
1556
1557 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1559 {
1560 return m_revision;
1561 }
1562
1563 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1565 {
1566 return m_serialNumber;
1567 }
1568
1569 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1571 {
1572 return m_userData;
1573 }
1574
1576 template<typename F>
1577 void forEach(const F &f) const
1578 {
1579 f(m_firmwareVersion);
1580 f(m_model);
1581 f(m_modelName);
1582 f(m_revision);
1583 f(m_serialNumber);
1584 f(m_userData);
1585 }
1586
1588 template<typename F>
1589 void forEach(const F &f)
1590 {
1591 f(m_firmwareVersion);
1592 f(m_model);
1593 f(m_modelName);
1594 f(m_revision);
1595 f(m_serialNumber);
1596 f(m_userData);
1597 }
1598
1600 bool operator==(const CameraInfo &other) const;
1601
1603 bool operator!=(const CameraInfo &other) const;
1604
1606 std::string toString() const;
1607
1609 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1610 {
1611 return stream << value.toString();
1612 }
1613
1615 void save(const std::string &fileName) const;
1616
1618 void load(const std::string &fileName);
1619
1620 private:
1621 void setFromString(const std::string &value);
1622
1623 void setFromString(const std::string &fullPath, const std::string &value);
1624
1625 std::string getString(const std::string &fullPath) const;
1626
1627 FirmwareVersion m_firmwareVersion;
1628 Model m_model;
1629 ModelName m_modelName;
1630 Revision m_revision;
1631 SerialNumber m_serialNumber;
1632 UserData m_userData;
1633
1634 friend struct DataModel::Detail::Befriend<CameraInfo>;
1635 };
1636
1637#ifndef NO_DOC
1639 namespace Detail
1640 {
1641 ZIVID_CORE_EXPORT void save(const CameraInfo &dataModel, std::ostream &ostream);
1642 ZIVID_CORE_EXPORT void load(CameraInfo &dataModel, std::istream &istream);
1643 } // namespace Detail
1644#endif
1645
1646#ifndef NO_DOC
1647 template<>
1648 struct CameraInfo::Version<4>
1649 {
1650 using Type = CameraInfo;
1651 };
1652#endif
1653
1654} // namespace Zivid
1655
1656#ifdef _MSC_VER
1657# pragma warning(pop)
1658#endif
1659
1660#ifndef NO_DOC
1661# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1662namespace std // NOLINT
1663{
1664
1665 template<>
1666 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1667 {};
1668
1669 template<size_t i>
1670 struct tuple_element<i, Zivid::CameraInfo::Revision>
1671 {
1672 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1673
1674 using type // NOLINT
1675 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1676 };
1677
1678 template<>
1679 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1680 {};
1681
1682 template<size_t i>
1683 struct tuple_element<i, Zivid::CameraInfo::UserData>
1684 {
1685 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1686
1687 using type // NOLINT
1688 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1689 };
1690
1691 template<>
1692 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 6>
1693 {};
1694
1695 template<size_t i>
1696 struct tuple_element<i, Zivid::CameraInfo>
1697 {
1698 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 6");
1699
1700 using type // NOLINT
1701 = decltype(declval<Zivid::CameraInfo>().get<i>());
1702 };
1703
1704} // namespace std
1705# endif
1706#endif
1707
1708// If we have access to the DataModel library, automatically include internal DataModel
1709// header. This header is necessary for serialization and deserialization.
1710#if defined(__has_include) && !defined(NO_DOC)
1711# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1712# include "Zivid/CameraInfoInternal.h"
1713# endif
1714#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
The firmware version on the camera.
Definition CameraInfo.h:112
std::string toString() const
Get the value as string.
bool operator==(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:150
FirmwareVersion(std::string value)
Constructor.
Definition CameraInfo.h:139
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for FirmwareVersion.
Definition CameraInfo.h:130
bool operator<(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:162
bool operator<=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:174
bool operator>=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:180
const std::string & value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const FirmwareVersion &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:186
bool operator>(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:168
bool operator!=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:156
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:127
FirmwareVersion()=default
Default constructor.
The model name of the camera. This is a user-friendly display name that may contain spaces and specia...
Definition CameraInfo.h:311
bool operator==(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:353
ModelName()=default
Default constructor.
bool operator<=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:377
std::string toString() const
Get the value as string.
ModelName(std::string value)
Constructor.
Definition CameraInfo.h:342
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:330
bool operator<(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:365
bool operator>(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:371
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:389
const std::string & value() const
Get the value.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName.
Definition CameraInfo.h:333
bool operator>=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:383
bool operator!=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:359
The model of the camera.
Definition CameraInfo.h:203
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition CameraInfo.h:229
static const Model zivid2PlusM130
zivid2PlusM130
Definition CameraInfo.h:234
static const Model zividTwo
zividTwo
Definition CameraInfo.h:232
static const Model zivid2PlusL110
zivid2PlusL110
Definition CameraInfo.h:236
std::string toString() const
Get the value as string.
constexpr Model(ValueType value)
Constructor.
Definition CameraInfo.h:250
Model()=default
Default constructor.
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition CameraInfo.h:230
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:261
static const Model zivid2PlusM60
zivid2PlusM60
Definition CameraInfo.h:235
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:279
static std::set< ValueType > validValues()
All valid values of Model.
Definition CameraInfo.h:239
ValueType
The type of the underlying value.
Definition CameraInfo.h:219
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition CameraInfo.h:231
bool operator!=(const Model &other) const
Comparison operator.
Definition CameraInfo.h:273
static const Model zividTwoL100
zividTwoL100
Definition CameraInfo.h:233
bool operator==(const Model &other) const
Comparison operator.
Definition CameraInfo.h:267
Major hardware revision number.
Definition CameraInfo.h:424
std::string toString() const
Get the value as string.
bool operator!=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:468
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:439
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:498
static constexpr Range< uint32_t > validRange()
The range of valid values for Major.
Definition CameraInfo.h:442
bool operator>=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:492
bool operator<=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:486
bool operator>(const Major &other) const
Comparison operator.
Definition CameraInfo.h:480
uint32_t value() const
Get the value.
constexpr Major(uint32_t value)
Constructor.
Definition CameraInfo.h:451
bool operator<(const Major &other) const
Comparison operator.
Definition CameraInfo.h:474
Major()=default
Default constructor.
bool operator==(const Major &other) const
Comparison operator.
Definition CameraInfo.h:462
Minor hardware revision number.
Definition CameraInfo.h:515
bool operator>(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:571
bool operator!=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:559
bool operator<=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:577
constexpr Minor(uint32_t value)
Constructor.
Definition CameraInfo.h:542
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:530
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:589
bool operator==(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:553
std::string toString() const
Get the value as string.
Minor()=default
Default constructor.
bool operator>=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:583
bool operator<(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:565
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor.
Definition CameraInfo.h:533
uint32_t value() const
Get the value.
The hardware revision of the camera.
Definition CameraInfo.h:406
const Major & major() const
Get Major.
Definition CameraInfo.h:711
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:691
Minor & minor()
Get Minor.
Definition CameraInfo.h:736
Revision & set(const Minor &value)
Set Minor.
Definition CameraInfo.h:742
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition CameraInfo.h:602
Revision & set(const Major &value)
Set Major.
Definition CameraInfo.h:723
bool operator==(const Revision &other) const
Equality operator.
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:759
std::string toString() const
Get the value as string.
const Minor & minor() const
Get Minor.
Definition CameraInfo.h:730
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:786
Major & major()
Get Major.
Definition CameraInfo.h:717
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:751
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:778
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:802
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:658
bool operator!=(const Revision &other) const
Inequality operator.
The serial number of the camera.
Definition CameraInfo.h:824
SerialNumber(std::string value)
Constructor.
Definition CameraInfo.h:851
const std::string & value() const
Get the value.
bool operator==(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:862
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:839
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:898
std::string toString() const
Get the value as string.
bool operator>(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:880
bool operator<(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:874
bool operator<=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:886
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber.
Definition CameraInfo.h:842
bool operator>=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:892
bool operator!=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:868
The maximum number of bytes of user data that can be stored in the camera.
Definition CameraInfo.h:935
bool operator!=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:981
bool operator<=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:999
bool operator>(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:993
MaxSizeBytes()=default
Default constructor.
constexpr MaxSizeBytes(uint64_t value)
Constructor.
Definition CameraInfo.h:964
uint64_t value() const
Get the value.
bool operator<(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:987
bool operator==(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:975
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:1011
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes.
Definition CameraInfo.h:955
uint64_t ValueType
The type of the underlying value.
Definition CameraInfo.h:952
bool operator>=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1005
Information about user data capabilities of the camera.
Definition CameraInfo.h:915
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:1171
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes.
Definition CameraInfo.h:1136
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:1110
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1186
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:1164
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1151
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition CameraInfo.h:1024
bool operator!=(const UserData &other) const
Inequality operator.
UserData()
Default constructor.
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes.
Definition CameraInfo.h:1130
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes.
Definition CameraInfo.h:1142
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1078
Information about camera model, serial number etc.
Definition CameraInfo.h:78
bool operator==(const CameraInfo &other) const
Equality operator.
Revision & revision()
Get Revision.
Definition CameraInfo.h:1406
const ModelName & modelName() const
Get ModelName.
Definition CameraInfo.h:1381
FirmwareVersion & firmwareVersion()
Get FirmwareVersion.
Definition CameraInfo.h:1349
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1589
const UserData & userData() const
Get UserData.
Definition CameraInfo.h:1452
ModelName & modelName()
Get ModelName.
Definition CameraInfo.h:1387
bool operator!=(const CameraInfo &other) const
Inequality operator.
CameraInfo & set(const Model &value)
Set Model.
Definition CameraInfo.h:1374
const CameraInfo::FirmwareVersion & get() const
Definition CameraInfo.h:1480
const CameraInfo::Model & get() const
Definition CameraInfo.h:1486
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file.
UserData & userData()
Get UserData.
Definition CameraInfo.h:1458
CameraInfo & set(const ModelName &value)
Set ModelName.
Definition CameraInfo.h:1393
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion.
Definition CameraInfo.h:1343
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1534
const Model & model() const
Get Model.
Definition CameraInfo.h:1362
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:1324
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:1577
Model & model()
Get Model.
Definition CameraInfo.h:1368
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1609
const CameraInfo::ModelName & get() const
Definition CameraInfo.h:1492
CameraInfo & set(const UserData &value)
Set UserData.
Definition CameraInfo.h:1464
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes.
Definition CameraInfo.h:1471
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraInfo.h:1249
const CameraInfo::UserData & get() const
Definition CameraInfo.h:1526
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:1514
const SerialNumber & serialNumber() const
Get SerialNumber.
Definition CameraInfo.h:1433
SerialNumber & serialNumber()
Get SerialNumber.
Definition CameraInfo.h:1439
const Revision & revision() const
Get Revision.
Definition CameraInfo.h:1400
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:1212
void load(const std::string &fileName)
Load from the given file.
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion.
Definition CameraInfo.h:1355
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:1506
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1284
CameraInfo & set(const Revision &value)
Set Revision.
Definition CameraInfo.h:1412
CameraInfo & set(const Revision::Major &value)
Set Revision::Major.
Definition CameraInfo.h:1419
CameraInfo & set(const SerialNumber &value)
Set SerialNumber.
Definition CameraInfo.h:1445
const CameraInfo::SerialNumber & get() const
Definition CameraInfo.h:1520
const CameraInfo::Revision & get() const
Definition CameraInfo.h:1498
std::string toString() const
Get the value as string.
CameraInfo()
Default constructor.
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor.
Definition CameraInfo.h:1426
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:73
NodeType
Definition NodeType.h:55
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:54