Zivid C++ API 2.19.0+b5c53d0f-1
CameraState.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2026 (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 <optional>
53#include <set>
54#include <sstream>
55#include <string>
56#include <tuple>
57#include <utility>
58#include <vector>
59
65#include "Zivid/Range.h"
66
67#ifdef _MSC_VER
68# pragma warning(push)
69# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
70#endif
71
72namespace Zivid
73{
74
76
77 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
79 {
80 public:
83
85 static constexpr const char *path{ "" };
86
88 static constexpr const char *name{ "CameraState" };
89
91 static constexpr const char *description{
92 R"description(Information about camera connection state, temperatures, etc.)description"
93 };
94
95 static constexpr size_t version{ 11 };
96
97#ifndef NO_DOC
98 template<size_t>
99 struct Version;
100
101 using LatestVersion = Zivid::CameraState;
102
103 // Short identifier. This value is not guaranteed to be universally unique
104 // Todo(ZIVID-2808): Move this to internal DataModelExt header
105 static constexpr std::array<uint8_t, 3> binaryId{ 'c', 's', 't' };
106
107#endif
108
113
114 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
116 {
117 public:
120
122 static constexpr const char *path{ "Available" };
123
125 static constexpr const char *name{ "Available" };
126
128 static constexpr const char *description{
129 R"description(Flag if camera is physically connected to the computer and is available for use, but not connected in
130software. This corresponds to the Status enums `available` or `firmwareUpdateRequired`. Zivid
131recommends to use the Status enum instead of this bool.
132)description"
133 };
134
136 using ValueType = bool;
137 static const Available yes;
138 static const Available no;
139
141 static std::set<bool> validValues()
142 {
143 return { false, true };
144 }
145
147 Available() = default;
148
150 explicit constexpr Available(bool value)
151 : m_value{ value }
152 {}
153
155 bool value() const;
156
158 std::string toString() const;
159
161 explicit operator bool() const
162 {
163 return m_value;
164 }
165
167 bool operator==(const Available &other) const
168 {
169 return m_value == other.m_value;
170 }
171
173 bool operator!=(const Available &other) const
174 {
175 return m_value != other.m_value;
176 }
177
179 friend std::ostream &operator<<(std::ostream &stream, const Available &value)
180 {
181 return stream << value.toString();
182 }
183
184 private:
185 void setFromString(const std::string &value);
186
187 bool m_value{ false };
188
189 friend struct DataModel::Detail::Befriend<Available>;
190 };
191
195
196 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
198 {
199 public:
202
204 static constexpr const char *path{ "Connected" };
205
207 static constexpr const char *name{ "Connected" };
208
210 static constexpr const char *description{
211 R"description(Flag if camera is connected in software. This bool is true when the Status value is `connected`. Zivid
212recommends to use the Status enum instead of this bool.
213)description"
214 };
215
217 using ValueType = bool;
218 static const Connected yes;
219 static const Connected no;
220
222 static std::set<bool> validValues()
223 {
224 return { false, true };
225 }
226
228 Connected() = default;
229
231 explicit constexpr Connected(bool value)
232 : m_value{ value }
233 {}
234
236 bool value() const;
237
239 std::string toString() const;
240
242 explicit operator bool() const
243 {
244 return m_value;
245 }
246
248 bool operator==(const Connected &other) const
249 {
250 return m_value == other.m_value;
251 }
252
254 bool operator!=(const Connected &other) const
255 {
256 return m_value != other.m_value;
257 }
258
260 friend std::ostream &operator<<(std::ostream &stream, const Connected &value)
261 {
262 return stream << value.toString();
263 }
264
265 private:
266 void setFromString(const std::string &value);
267
268 bool m_value{ false };
269
270 friend struct DataModel::Detail::Befriend<Connected>;
271 };
272
274
275 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
277 {
278 public:
281
283 static constexpr const char *path{ "InaccessibleReason" };
284
286 static constexpr const char *name{ "InaccessibleReason" };
287
289 static constexpr const char *description{
290 R"description(If the camera status is `inaccessible`, then this enum value will give you the reason.)description"
291 };
292
294 enum class ValueType
295 {
300 };
305
307 static std::set<ValueType> validValues()
308 {
313 }
314
317
320 : m_opt{ verifyValue(value) }
321 {}
322
328
330 bool hasValue() const;
331
333 void reset();
334
336 std::string toString() const;
337
339 friend std::ostream &operator<<(std::ostream &stream, const InaccessibleReason::ValueType &value)
340 {
341 return stream << InaccessibleReason{ value }.toString();
342 }
343
345 bool operator==(const InaccessibleReason &other) const
346 {
347 return m_opt == other.m_opt;
348 }
349
351 bool operator!=(const InaccessibleReason &other) const
352 {
353 return m_opt != other.m_opt;
354 }
355
357 friend std::ostream &operator<<(std::ostream &stream, const InaccessibleReason &value)
358 {
359 return stream << value.toString();
360 }
361
362 private:
363 void setFromString(const std::string &value);
364
365 constexpr ValueType static verifyValue(const ValueType &value)
366 {
367 return value == ValueType::ipConflictWithAnotherCamera
368 || value == ValueType::ipConflictWithLocalNetworkAdapter
369 || value == ValueType::ipNotInLocalSubnet || value == ValueType::ipInMultipleLocalSubnets
370 ? value
371 : throw std::invalid_argument{
372 "Invalid value: InaccessibleReason{ "
373 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
374 };
375 }
376
377 std::optional<ValueType> m_opt;
378
379 friend struct DataModel::Detail::Befriend<InaccessibleReason>;
380 };
381
383
384 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
386 {
387 public:
390
392 static constexpr const char *path{ "Network" };
393
395 static constexpr const char *name{ "Network" };
396
398 static constexpr const char *description{ R"description(Current network state)description" };
399
402
403 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
405 {
406 public:
409
411 static constexpr const char *path{ "Network/LocalInterface" };
412
414 static constexpr const char *name{ "LocalInterface" };
415
417 static constexpr const char *description{
418 R"description(Current state of the computer's local network interface.
419)description"
420 };
421
423
424 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
426 {
427 public:
430
432 static constexpr const char *path{ "Network/LocalInterface/Ethernet" };
433
435 static constexpr const char *name{ "Ethernet" };
436
438 static constexpr const char *description{ R"description(Current Ethernet state)description" };
439
442
443 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
445 {
446 public:
449
451 static constexpr const char *path{ "Network/LocalInterface/Ethernet/LinkSpeed" };
452
454 static constexpr const char *name{ "LinkSpeed" };
455
457 static constexpr const char *description{
458 R"description(The link speed that the computer's Ethernet interface is operating at.
459)description"
460 };
461
463 enum class ValueType
464 {
484 };
485 static const LinkSpeed unknown;
486 static const LinkSpeed link10Mbps;
487 static const LinkSpeed link100Mbps;
488 static const LinkSpeed link1Gbps;
489 static const LinkSpeed link2_5Gbps;
490 static const LinkSpeed link5Gbps;
491 static const LinkSpeed link10Gbps;
492 static const LinkSpeed link14Gbps;
493 static const LinkSpeed link20Gbps;
494 static const LinkSpeed link25Gbps;
495 static const LinkSpeed link40Gbps;
496 static const LinkSpeed link50Gbps;
497 static const LinkSpeed link56Gbps;
498 static const LinkSpeed link80Gbps;
499 static const LinkSpeed link100Gbps;
500 static const LinkSpeed link200Gbps;
501 static const LinkSpeed link400Gbps;
502 static const LinkSpeed link800Gbps;
503 static const LinkSpeed link1600Gbps;
504
506 static std::set<ValueType> validValues()
507 {
515 }
516
518 LinkSpeed() = default;
519
521 explicit constexpr LinkSpeed(ValueType value)
522 : m_value{ verifyValue(value) }
523 {}
524
527
529 std::string toString() const;
530
532 friend std::ostream &operator<<(std::ostream &stream, const LinkSpeed::ValueType &value)
533 {
534 return stream << LinkSpeed{ value }.toString();
535 }
536
538 bool operator==(const LinkSpeed &other) const
539 {
540 return m_value == other.m_value;
541 }
542
544 bool operator!=(const LinkSpeed &other) const
545 {
546 return m_value != other.m_value;
547 }
548
550 friend std::ostream &operator<<(std::ostream &stream, const LinkSpeed &value)
551 {
552 return stream << value.toString();
553 }
554
555 private:
556 void setFromString(const std::string &value);
557
558 constexpr ValueType static verifyValue(const ValueType &value)
559 {
560 return value == ValueType::unknown || value == ValueType::link10Mbps
561 || value == ValueType::link100Mbps || value == ValueType::link1Gbps
562 || value == ValueType::link2_5Gbps || value == ValueType::link5Gbps
563 || value == ValueType::link10Gbps || value == ValueType::link14Gbps
564 || value == ValueType::link20Gbps || value == ValueType::link25Gbps
565 || value == ValueType::link40Gbps || value == ValueType::link50Gbps
566 || value == ValueType::link56Gbps || value == ValueType::link80Gbps
567 || value == ValueType::link100Gbps || value == ValueType::link200Gbps
568 || value == ValueType::link400Gbps || value == ValueType::link800Gbps
569 || value == ValueType::link1600Gbps
570 ? value
571 : throw std::invalid_argument{
572 "Invalid value: LinkSpeed{ "
573 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
574 + " }"
575 };
576 }
577
579
580 friend struct DataModel::Detail::Befriend<LinkSpeed>;
581 };
582
583 using Descendants = std::tuple<CameraState::Network::LocalInterface::Ethernet::LinkSpeed>;
584
587
599#ifndef NO_DOC
600 template<
601 typename... Args,
602 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
603 typename std::enable_if<
604 Zivid::Detail::TypeTraits::
605 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
606 int>::type = 0>
607#else
608 template<typename... Args>
609#endif
610 explicit Ethernet(Args &&...args)
611 {
612 using namespace Zivid::Detail::TypeTraits;
613
614 static_assert(
615 AllArgsDecayedAreUnique<Args...>::value,
616 "Found duplicate types among the arguments passed to Ethernet(...). "
617 "Types should be listed at most once.");
618
619 set(std::forward<Args>(args)...);
620 }
621
632#ifndef NO_DOC
633 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
634#else
635 template<typename... Args>
636#endif
637 void set(Args &&...args)
638 {
639 using namespace Zivid::Detail::TypeTraits;
640
641 using AllArgsAreDescendantNodes =
642 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
643 static_assert(
644 AllArgsAreDescendantNodes::value,
645 "All arguments passed to set(...) must be descendant nodes.");
646
647 static_assert(
648 AllArgsDecayedAreUnique<Args...>::value,
649 "Found duplicate types among the arguments passed to set(...). "
650 "Types should be listed at most once.");
651
652 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
653 }
654
666#ifndef NO_DOC
667 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
668#else
669 template<typename... Args>
670#endif
671 Ethernet copyWith(Args &&...args) const
672 {
673 using namespace Zivid::Detail::TypeTraits;
674
675 using AllArgsAreDescendantNodes =
676 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
677 static_assert(
678 AllArgsAreDescendantNodes::value,
679 "All arguments passed to copyWith(...) must be descendant nodes.");
680
681 static_assert(
682 AllArgsDecayedAreUnique<Args...>::value,
683 "Found duplicate types among the arguments passed to copyWith(...). "
684 "Types should be listed at most once.");
685
686 auto copy{ *this };
687 copy.set(std::forward<Args>(args)...);
688 return copy;
689 }
690
692 const LinkSpeed &linkSpeed() const
693 {
694 return m_linkSpeed;
695 }
696
699 {
700 return m_linkSpeed;
701 }
702
704 Ethernet &set(const LinkSpeed &value)
705 {
706 m_linkSpeed = value;
707 return *this;
708 }
709
710 template<
711 typename T,
712 typename std::enable_if<
713 std::is_same<T, CameraState::Network::LocalInterface::Ethernet::LinkSpeed>::value,
714 int>::type = 0>
716 {
717 return m_linkSpeed;
718 }
719
720 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
722 {
723 return m_linkSpeed;
724 }
725
727 template<typename F>
728 void forEach(const F &f) const
729 {
730 f(m_linkSpeed);
731 }
732
734 template<typename F>
735 void forEach(const F &f)
736 {
737 f(m_linkSpeed);
738 }
739
741 bool operator==(const Ethernet &other) const;
742
744 bool operator!=(const Ethernet &other) const;
745
747 std::string toString() const;
748
750 friend std::ostream &operator<<(std::ostream &stream, const Ethernet &value)
751 {
752 return stream << value.toString();
753 }
754
755 private:
756 void setFromString(const std::string &value);
757
758 void setFromString(const std::string &fullPath, const std::string &value);
759
760 std::string getString(const std::string &fullPath) const;
761
762 LinkSpeed m_linkSpeed;
763
764 friend struct DataModel::Detail::Befriend<Ethernet>;
765 };
766
768
769 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
771 {
772 public:
775
777 static constexpr const char *path{ "Network/LocalInterface/IPV4" };
778
780 static constexpr const char *name{ "IPV4" };
781
783 static constexpr const char *description{
784 R"description(Current IPv4 protocol state of the computer's local network interface.)description"
785 };
786
789
790 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
792 {
793 public:
796
798 static constexpr const char *path{ "Network/LocalInterface/IPV4/Subnet" };
799
801 static constexpr const char *name{ "Subnet" };
802
804 static constexpr const char *description{
805 R"description(An IPv4 subnet that the local network interface is connected to.
806)description"
807 };
808
810
811 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
813 {
814 public:
817
819 static constexpr const char *path{ "Network/LocalInterface/IPV4/Subnet/Address" };
820
822 static constexpr const char *name{ "Address" };
823
825 static constexpr const char *description{
826 R"description(IP address of the computer's local network interface.)description"
827 };
828
830 using ValueType = std::string;
831
834 {
835 return { 0, std::numeric_limits<ValueType::size_type>::max() };
836 }
837
839 Address() = default;
840
842 explicit Address(std::string value)
843 : m_value{ std::move(value) }
844 {}
845
847 const std::string &value() const;
848
850 std::string toString() const;
851
853 bool operator==(const Address &other) const
854 {
855 return m_value == other.m_value;
856 }
857
859 bool operator!=(const Address &other) const
860 {
861 return m_value != other.m_value;
862 }
863
865 bool operator<(const Address &other) const
866 {
867 return m_value < other.m_value;
868 }
869
871 bool operator>(const Address &other) const
872 {
873 return m_value > other.m_value;
874 }
875
877 bool operator<=(const Address &other) const
878 {
879 return m_value <= other.m_value;
880 }
881
883 bool operator>=(const Address &other) const
884 {
885 return m_value >= other.m_value;
886 }
887
889 friend std::ostream &operator<<(std::ostream &stream, const Address &value)
890 {
891 return stream << value.toString();
892 }
893
894 private:
895 void setFromString(const std::string &value);
896
897 std::string m_value{};
898
899 friend struct DataModel::Detail::Befriend<Address>;
900 };
901
903
904 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
906 {
907 public:
910
912 static constexpr const char *path{ "Network/LocalInterface/IPV4/Subnet/Mask" };
913
915 static constexpr const char *name{ "Mask" };
916
918 static constexpr const char *description{
919 R"description(Subnet mask of the computer's local network interface.)description"
920 };
921
923 using ValueType = std::string;
924
927 {
928 return { 0, std::numeric_limits<ValueType::size_type>::max() };
929 }
930
932 Mask() = default;
933
935 explicit Mask(std::string value)
936 : m_value{ std::move(value) }
937 {}
938
940 const std::string &value() const;
941
943 std::string toString() const;
944
946 bool operator==(const Mask &other) const
947 {
948 return m_value == other.m_value;
949 }
950
952 bool operator!=(const Mask &other) const
953 {
954 return m_value != other.m_value;
955 }
956
958 bool operator<(const Mask &other) const
959 {
960 return m_value < other.m_value;
961 }
962
964 bool operator>(const Mask &other) const
965 {
966 return m_value > other.m_value;
967 }
968
970 bool operator<=(const Mask &other) const
971 {
972 return m_value <= other.m_value;
973 }
974
976 bool operator>=(const Mask &other) const
977 {
978 return m_value >= other.m_value;
979 }
980
982 friend std::ostream &operator<<(std::ostream &stream, const Mask &value)
983 {
984 return stream << value.toString();
985 }
986
987 private:
988 void setFromString(const std::string &value);
989
990 std::string m_value{};
991
992 friend struct DataModel::Detail::Befriend<Mask>;
993 };
994
995 using Descendants = std::tuple<
998
1001
1014#ifndef NO_DOC
1015 template<
1016 typename... Args,
1017 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1018 typename std::enable_if<
1019 Zivid::Detail::TypeTraits::
1020 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1021 int>::type = 0>
1022#else
1023 template<typename... Args>
1024#endif
1025 explicit Subnet(Args &&...args)
1026 {
1027 using namespace Zivid::Detail::TypeTraits;
1028
1029 static_assert(
1030 AllArgsDecayedAreUnique<Args...>::value,
1031 "Found duplicate types among the arguments passed to Subnet(...). "
1032 "Types should be listed at most once.");
1033
1034 set(std::forward<Args>(args)...);
1035 }
1036
1048#ifndef NO_DOC
1049 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1050#else
1051 template<typename... Args>
1052#endif
1053 void set(Args &&...args)
1054 {
1055 using namespace Zivid::Detail::TypeTraits;
1056
1057 using AllArgsAreDescendantNodes =
1058 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1059 static_assert(
1060 AllArgsAreDescendantNodes::value,
1061 "All arguments passed to set(...) must be descendant nodes.");
1062
1063 static_assert(
1064 AllArgsDecayedAreUnique<Args...>::value,
1065 "Found duplicate types among the arguments passed to set(...). "
1066 "Types should be listed at most once.");
1067
1068 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1069 }
1070
1083#ifndef NO_DOC
1084 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1085#else
1086 template<typename... Args>
1087#endif
1088 Subnet copyWith(Args &&...args) const
1089 {
1090 using namespace Zivid::Detail::TypeTraits;
1091
1092 using AllArgsAreDescendantNodes =
1093 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1094 static_assert(
1095 AllArgsAreDescendantNodes::value,
1096 "All arguments passed to copyWith(...) must be descendant nodes.");
1097
1098 static_assert(
1099 AllArgsDecayedAreUnique<Args...>::value,
1100 "Found duplicate types among the arguments passed to copyWith(...). "
1101 "Types should be listed at most once.");
1102
1103 auto copy{ *this };
1104 copy.set(std::forward<Args>(args)...);
1105 return copy;
1106 }
1107
1109 const Address &address() const
1110 {
1111 return m_address;
1112 }
1113
1116 {
1117 return m_address;
1118 }
1119
1121 Subnet &set(const Address &value)
1122 {
1123 m_address = value;
1124 return *this;
1125 }
1126
1128 const Mask &mask() const
1129 {
1130 return m_mask;
1131 }
1132
1135 {
1136 return m_mask;
1137 }
1138
1140 Subnet &set(const Mask &value)
1141 {
1142 m_mask = value;
1143 return *this;
1144 }
1145
1146 template<
1147 typename T,
1148 typename std::enable_if<
1149 std::is_same<T, CameraState::Network::LocalInterface::IPV4::Subnet::Address>::value,
1150 int>::type = 0>
1152 {
1153 return m_address;
1154 }
1155
1156 template<
1157 typename T,
1158 typename std::enable_if<
1159 std::is_same<T, CameraState::Network::LocalInterface::IPV4::Subnet::Mask>::value,
1160 int>::type = 0>
1162 {
1163 return m_mask;
1164 }
1165
1166 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1168 {
1169 return m_address;
1170 }
1171
1172 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1174 {
1175 return m_mask;
1176 }
1177
1179 template<typename F>
1180 void forEach(const F &f) const
1181 {
1182 f(m_address);
1183 f(m_mask);
1184 }
1185
1187 template<typename F>
1188 void forEach(const F &f)
1189 {
1190 f(m_address);
1191 f(m_mask);
1192 }
1193
1195 bool operator==(const Subnet &other) const;
1196
1198 bool operator!=(const Subnet &other) const;
1199
1201 std::string toString() const;
1202
1204 friend std::ostream &operator<<(std::ostream &stream, const Subnet &value)
1205 {
1206 return stream << value.toString();
1207 }
1208
1209 private:
1210 void setFromString(const std::string &value);
1211
1212 void setFromString(const std::string &fullPath, const std::string &value);
1213
1214 std::string getString(const std::string &fullPath) const;
1215
1216 Address m_address;
1217 Mask m_mask;
1218
1219 friend struct DataModel::Detail::Befriend<Subnet>;
1220 };
1221
1226
1227 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1229 {
1230 public:
1233
1235 static constexpr const char *path{ "Network/LocalInterface/IPV4/Subnets" };
1236
1238 static constexpr const char *name{ "Subnets" };
1239
1241 static constexpr const char *description{
1242 R"description(List of IPv4 addresses and subnet masks that the interface is configured with. This list can
1243contain multiple entries if the local network interface is configured with multiple IPv4
1244addresses.
1245)description"
1246 };
1247
1249 using ValueType = std::vector<CameraState::Network::LocalInterface::IPV4::Subnet>;
1250
1253 {
1254 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1255 }
1256
1258 Subnets() = default;
1259
1261 explicit Subnets(std::vector<CameraState::Network::LocalInterface::IPV4::Subnet> value)
1262 : m_value{ std::move(value) }
1263 {}
1264
1266 explicit Subnets(
1267 std::initializer_list<CameraState::Network::LocalInterface::IPV4::Subnet> value)
1268 : Subnets{ ValueType{ value } }
1269 {}
1270
1272 const std::vector<CameraState::Network::LocalInterface::IPV4::Subnet> &value() const;
1273
1275 std::string toString() const;
1276
1278 std::size_t size() const noexcept;
1279
1281 bool isEmpty() const noexcept;
1282
1288 template<typename... Args>
1289 void emplaceBack(Args &&...args)
1290 {
1291 m_value.emplace_back(std::forward<Args>(args)...);
1292 }
1293
1300
1307
1314
1321
1323 template<typename F>
1324 void forEach(const F &f)
1325 {
1326 for(auto &child : m_value)
1327 {
1328 f(child);
1329 }
1330 }
1331
1333 template<typename F>
1334 void forEach(const F &f) const
1335 {
1336 for(const auto &child : m_value)
1337 {
1338 f(child);
1339 }
1340 }
1341
1343 using Iterator = std::vector<CameraState::Network::LocalInterface::IPV4::Subnet>::iterator;
1344
1346 Iterator begin() noexcept;
1347
1349 Iterator end() noexcept;
1350
1353 std::vector<CameraState::Network::LocalInterface::IPV4::Subnet>::const_iterator;
1354
1356 ConstIterator begin() const noexcept;
1357
1359 ConstIterator end() const noexcept;
1360
1362 ConstIterator cbegin() const noexcept;
1363
1365 ConstIterator cend() const noexcept;
1366
1368 bool operator==(const Subnets &other) const
1369 {
1370 return m_value == other.m_value;
1371 }
1372
1374 bool operator!=(const Subnets &other) const
1375 {
1376 return m_value != other.m_value;
1377 }
1378
1380 friend std::ostream &operator<<(std::ostream &stream, const Subnets &value)
1381 {
1382 return stream << value.toString();
1383 }
1384
1385 private:
1386 void setFromString(const std::string &value);
1387
1388 std::vector<CameraState::Network::LocalInterface::IPV4::Subnet> m_value{};
1389
1390 friend struct DataModel::Detail::Befriend<Subnets>;
1391 };
1392
1393 using Descendants = std::tuple<CameraState::Network::LocalInterface::IPV4::Subnets>;
1394
1397
1409#ifndef NO_DOC
1410 template<
1411 typename... Args,
1412 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1413 typename std::enable_if<
1414 Zivid::Detail::TypeTraits::
1415 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1416 int>::type = 0>
1417#else
1418 template<typename... Args>
1419#endif
1420 explicit IPV4(Args &&...args)
1421 {
1422 using namespace Zivid::Detail::TypeTraits;
1423
1424 static_assert(
1425 AllArgsDecayedAreUnique<Args...>::value,
1426 "Found duplicate types among the arguments passed to IPV4(...). "
1427 "Types should be listed at most once.");
1428
1429 set(std::forward<Args>(args)...);
1430 }
1431
1442#ifndef NO_DOC
1443 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1444#else
1445 template<typename... Args>
1446#endif
1447 void set(Args &&...args)
1448 {
1449 using namespace Zivid::Detail::TypeTraits;
1450
1451 using AllArgsAreDescendantNodes =
1452 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1453 static_assert(
1454 AllArgsAreDescendantNodes::value,
1455 "All arguments passed to set(...) must be descendant nodes.");
1456
1457 static_assert(
1458 AllArgsDecayedAreUnique<Args...>::value,
1459 "Found duplicate types among the arguments passed to set(...). "
1460 "Types should be listed at most once.");
1461
1462 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1463 }
1464
1476#ifndef NO_DOC
1477 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1478#else
1479 template<typename... Args>
1480#endif
1481 IPV4 copyWith(Args &&...args) const
1482 {
1483 using namespace Zivid::Detail::TypeTraits;
1484
1485 using AllArgsAreDescendantNodes =
1486 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1487 static_assert(
1488 AllArgsAreDescendantNodes::value,
1489 "All arguments passed to copyWith(...) must be descendant nodes.");
1490
1491 static_assert(
1492 AllArgsDecayedAreUnique<Args...>::value,
1493 "Found duplicate types among the arguments passed to copyWith(...). "
1494 "Types should be listed at most once.");
1495
1496 auto copy{ *this };
1497 copy.set(std::forward<Args>(args)...);
1498 return copy;
1499 }
1500
1502 const Subnets &subnets() const
1503 {
1504 return m_subnets;
1505 }
1506
1509 {
1510 return m_subnets;
1511 }
1512
1514 IPV4 &set(const Subnets &value)
1515 {
1516 m_subnets = value;
1517 return *this;
1518 }
1519
1520 template<
1521 typename T,
1522 typename std::enable_if<
1523 std::is_same<T, CameraState::Network::LocalInterface::IPV4::Subnets>::value,
1524 int>::type = 0>
1526 {
1527 return m_subnets;
1528 }
1529
1530 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1532 {
1533 return m_subnets;
1534 }
1535
1537 template<typename F>
1538 void forEach(const F &f) const
1539 {
1540 f(m_subnets);
1541 }
1542
1544 template<typename F>
1545 void forEach(const F &f)
1546 {
1547 f(m_subnets);
1548 }
1549
1551 bool operator==(const IPV4 &other) const;
1552
1554 bool operator!=(const IPV4 &other) const;
1555
1557 std::string toString() const;
1558
1560 friend std::ostream &operator<<(std::ostream &stream, const IPV4 &value)
1561 {
1562 return stream << value.toString();
1563 }
1564
1565 private:
1566 void setFromString(const std::string &value);
1567
1568 void setFromString(const std::string &fullPath, const std::string &value);
1569
1570 std::string getString(const std::string &fullPath) const;
1571
1572 Subnets m_subnets;
1573
1574 friend struct DataModel::Detail::Befriend<IPV4>;
1575 };
1576
1578
1579 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1581 {
1582 public:
1585
1587 static constexpr const char *path{ "Network/LocalInterface/InterfaceName" };
1588
1590 static constexpr const char *name{ "InterfaceName" };
1591
1593 static constexpr const char *description{
1594 R"description(Name of the computer's local network interface.)description"
1595 };
1596
1598 using ValueType = std::string;
1599
1602 {
1603 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1604 }
1605
1607 InterfaceName() = default;
1608
1610 explicit InterfaceName(std::string value)
1611 : m_value{ std::move(value) }
1612 {}
1613
1615 const std::string &value() const;
1616
1618 std::string toString() const;
1619
1621 bool operator==(const InterfaceName &other) const
1622 {
1623 return m_value == other.m_value;
1624 }
1625
1627 bool operator!=(const InterfaceName &other) const
1628 {
1629 return m_value != other.m_value;
1630 }
1631
1633 bool operator<(const InterfaceName &other) const
1634 {
1635 return m_value < other.m_value;
1636 }
1637
1639 bool operator>(const InterfaceName &other) const
1640 {
1641 return m_value > other.m_value;
1642 }
1643
1645 bool operator<=(const InterfaceName &other) const
1646 {
1647 return m_value <= other.m_value;
1648 }
1649
1651 bool operator>=(const InterfaceName &other) const
1652 {
1653 return m_value >= other.m_value;
1654 }
1655
1657 friend std::ostream &operator<<(std::ostream &stream, const InterfaceName &value)
1658 {
1659 return stream << value.toString();
1660 }
1661
1662 private:
1663 void setFromString(const std::string &value);
1664
1665 std::string m_value{};
1666
1667 friend struct DataModel::Detail::Befriend<InterfaceName>;
1668 };
1669
1670 using Descendants = std::tuple<
1676
1679
1695#ifndef NO_DOC
1696 template<
1697 typename... Args,
1698 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1699 typename std::enable_if<
1700 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1701 value,
1702 int>::type = 0>
1703#else
1704 template<typename... Args>
1705#endif
1706 explicit LocalInterface(Args &&...args)
1707 {
1708 using namespace Zivid::Detail::TypeTraits;
1709
1710 static_assert(
1711 AllArgsDecayedAreUnique<Args...>::value,
1712 "Found duplicate types among the arguments passed to LocalInterface(...). "
1713 "Types should be listed at most once.");
1714
1715 set(std::forward<Args>(args)...);
1716 }
1717
1732#ifndef NO_DOC
1733 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1734#else
1735 template<typename... Args>
1736#endif
1737 void set(Args &&...args)
1738 {
1739 using namespace Zivid::Detail::TypeTraits;
1740
1741 using AllArgsAreDescendantNodes =
1742 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1743 static_assert(
1744 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1745
1746 static_assert(
1747 AllArgsDecayedAreUnique<Args...>::value,
1748 "Found duplicate types among the arguments passed to set(...). "
1749 "Types should be listed at most once.");
1750
1751 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1752 }
1753
1769#ifndef NO_DOC
1770 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1771#else
1772 template<typename... Args>
1773#endif
1774 LocalInterface copyWith(Args &&...args) const
1775 {
1776 using namespace Zivid::Detail::TypeTraits;
1777
1778 using AllArgsAreDescendantNodes =
1779 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1780 static_assert(
1781 AllArgsAreDescendantNodes::value,
1782 "All arguments passed to copyWith(...) must be descendant nodes.");
1783
1784 static_assert(
1785 AllArgsDecayedAreUnique<Args...>::value,
1786 "Found duplicate types among the arguments passed to copyWith(...). "
1787 "Types should be listed at most once.");
1788
1789 auto copy{ *this };
1790 copy.set(std::forward<Args>(args)...);
1791 return copy;
1792 }
1793
1795 const Ethernet &ethernet() const
1796 {
1797 return m_ethernet;
1798 }
1799
1802 {
1803 return m_ethernet;
1804 }
1805
1808 {
1809 m_ethernet = value;
1810 return *this;
1811 }
1812
1815 {
1816 m_ethernet.set(value);
1817 return *this;
1818 }
1819
1821 const IPV4 &ipv4() const
1822 {
1823 return m_ipv4;
1824 }
1825
1828 {
1829 return m_ipv4;
1830 }
1831
1833 LocalInterface &set(const IPV4 &value)
1834 {
1835 m_ipv4 = value;
1836 return *this;
1837 }
1838
1841 {
1842 m_ipv4.set(value);
1843 return *this;
1844 }
1845
1848 {
1849 return m_interfaceName;
1850 }
1851
1854 {
1855 return m_interfaceName;
1856 }
1857
1860 {
1861 m_interfaceName = value;
1862 return *this;
1863 }
1864
1865 template<
1866 typename T,
1867 typename std::enable_if<
1868 std::is_same<T, CameraState::Network::LocalInterface::Ethernet>::value,
1869 int>::type = 0>
1871 {
1872 return m_ethernet;
1873 }
1874
1875 template<
1876 typename T,
1877 typename std::enable_if<
1878 std::is_same<T, CameraState::Network::LocalInterface::Ethernet::LinkSpeed>::value,
1879 int>::type = 0>
1881 {
1883 }
1884
1885 template<
1886 typename T,
1887 typename std::enable_if<std::is_same<T, CameraState::Network::LocalInterface::IPV4>::value, int>::
1888 type = 0>
1890 {
1891 return m_ipv4;
1892 }
1893
1894 template<
1895 typename T,
1896 typename std::enable_if<
1897 std::is_same<T, CameraState::Network::LocalInterface::IPV4::Subnets>::value,
1898 int>::type = 0>
1900 {
1902 }
1903
1904 template<
1905 typename T,
1906 typename std::enable_if<
1907 std::is_same<T, CameraState::Network::LocalInterface::InterfaceName>::value,
1908 int>::type = 0>
1910 {
1911 return m_interfaceName;
1912 }
1913
1914 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1916 {
1917 return m_ethernet;
1918 }
1919
1920 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1922 {
1923 return m_ipv4;
1924 }
1925
1926 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1928 {
1929 return m_interfaceName;
1930 }
1931
1933 template<typename F>
1934 void forEach(const F &f) const
1935 {
1936 f(m_ethernet);
1937 f(m_ipv4);
1938 f(m_interfaceName);
1939 }
1940
1942 template<typename F>
1943 void forEach(const F &f)
1944 {
1945 f(m_ethernet);
1946 f(m_ipv4);
1947 f(m_interfaceName);
1948 }
1949
1951 bool operator==(const LocalInterface &other) const;
1952
1954 bool operator!=(const LocalInterface &other) const;
1955
1957 std::string toString() const;
1958
1960 friend std::ostream &operator<<(std::ostream &stream, const LocalInterface &value)
1961 {
1962 return stream << value.toString();
1963 }
1964
1965 private:
1966 void setFromString(const std::string &value);
1967
1968 void setFromString(const std::string &fullPath, const std::string &value);
1969
1970 std::string getString(const std::string &fullPath) const;
1971
1972 Ethernet m_ethernet;
1973 IPV4 m_ipv4;
1974 InterfaceName m_interfaceName;
1975
1976 friend struct DataModel::Detail::Befriend<LocalInterface>;
1977 };
1978
1980
1981 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1983 {
1984 public:
1987
1989 static constexpr const char *path{ "Network/Ethernet" };
1990
1992 static constexpr const char *name{ "Ethernet" };
1993
1995 static constexpr const char *description{ R"description(Current Ethernet state)description" };
1996
1999
2000 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2002 {
2003 public:
2006
2008 static constexpr const char *path{ "Network/Ethernet/LinkSpeed" };
2009
2011 static constexpr const char *name{ "LinkSpeed" };
2012
2014 static constexpr const char *description{
2015 R"description(The link speed that the camera's Ethernet interface is operating at.
2016)description"
2017 };
2018
2020 enum class ValueType
2021 {
2041 };
2042 static const LinkSpeed unknown;
2043 static const LinkSpeed link10Mbps;
2044 static const LinkSpeed link100Mbps;
2045 static const LinkSpeed link1Gbps;
2046 static const LinkSpeed link2_5Gbps;
2047 static const LinkSpeed link5Gbps;
2048 static const LinkSpeed link10Gbps;
2049 static const LinkSpeed link14Gbps;
2050 static const LinkSpeed link20Gbps;
2051 static const LinkSpeed link25Gbps;
2052 static const LinkSpeed link40Gbps;
2053 static const LinkSpeed link50Gbps;
2054 static const LinkSpeed link56Gbps;
2055 static const LinkSpeed link80Gbps;
2056 static const LinkSpeed link100Gbps;
2057 static const LinkSpeed link200Gbps;
2058 static const LinkSpeed link400Gbps;
2059 static const LinkSpeed link800Gbps;
2061
2063 static std::set<ValueType> validValues()
2064 {
2072 }
2073
2075 LinkSpeed() = default;
2076
2078 explicit constexpr LinkSpeed(ValueType value)
2079 : m_value{ verifyValue(value) }
2080 {}
2081
2084
2086 std::string toString() const;
2087
2089 friend std::ostream &operator<<(std::ostream &stream, const LinkSpeed::ValueType &value)
2090 {
2091 return stream << LinkSpeed{ value }.toString();
2092 }
2093
2095 bool operator==(const LinkSpeed &other) const
2096 {
2097 return m_value == other.m_value;
2098 }
2099
2101 bool operator!=(const LinkSpeed &other) const
2102 {
2103 return m_value != other.m_value;
2104 }
2105
2107 friend std::ostream &operator<<(std::ostream &stream, const LinkSpeed &value)
2108 {
2109 return stream << value.toString();
2110 }
2111
2112 private:
2113 void setFromString(const std::string &value);
2114
2115 constexpr ValueType static verifyValue(const ValueType &value)
2116 {
2117 return value == ValueType::unknown || value == ValueType::link10Mbps
2118 || value == ValueType::link100Mbps || value == ValueType::link1Gbps
2119 || value == ValueType::link2_5Gbps || value == ValueType::link5Gbps
2120 || value == ValueType::link10Gbps || value == ValueType::link14Gbps
2121 || value == ValueType::link20Gbps || value == ValueType::link25Gbps
2122 || value == ValueType::link40Gbps || value == ValueType::link50Gbps
2123 || value == ValueType::link56Gbps || value == ValueType::link80Gbps
2124 || value == ValueType::link100Gbps || value == ValueType::link200Gbps
2125 || value == ValueType::link400Gbps || value == ValueType::link800Gbps
2126 || value == ValueType::link1600Gbps
2127 ? value
2128 : throw std::invalid_argument{
2129 "Invalid value: LinkSpeed{ "
2130 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
2131 + " }"
2132 };
2133 }
2134
2136
2137 friend struct DataModel::Detail::Befriend<LinkSpeed>;
2138 };
2139
2140 using Descendants = std::tuple<CameraState::Network::Ethernet::LinkSpeed>;
2141
2144
2156#ifndef NO_DOC
2157 template<
2158 typename... Args,
2159 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2160 typename std::enable_if<
2161 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2162 value,
2163 int>::type = 0>
2164#else
2165 template<typename... Args>
2166#endif
2167 explicit Ethernet(Args &&...args)
2168 {
2169 using namespace Zivid::Detail::TypeTraits;
2170
2171 static_assert(
2172 AllArgsDecayedAreUnique<Args...>::value,
2173 "Found duplicate types among the arguments passed to Ethernet(...). "
2174 "Types should be listed at most once.");
2175
2176 set(std::forward<Args>(args)...);
2177 }
2178
2189#ifndef NO_DOC
2190 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2191#else
2192 template<typename... Args>
2193#endif
2194 void set(Args &&...args)
2195 {
2196 using namespace Zivid::Detail::TypeTraits;
2197
2198 using AllArgsAreDescendantNodes =
2199 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2200 static_assert(
2201 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2202
2203 static_assert(
2204 AllArgsDecayedAreUnique<Args...>::value,
2205 "Found duplicate types among the arguments passed to set(...). "
2206 "Types should be listed at most once.");
2207
2208 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2209 }
2210
2222#ifndef NO_DOC
2223 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2224#else
2225 template<typename... Args>
2226#endif
2227 Ethernet copyWith(Args &&...args) const
2228 {
2229 using namespace Zivid::Detail::TypeTraits;
2230
2231 using AllArgsAreDescendantNodes =
2232 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2233 static_assert(
2234 AllArgsAreDescendantNodes::value,
2235 "All arguments passed to copyWith(...) must be descendant nodes.");
2236
2237 static_assert(
2238 AllArgsDecayedAreUnique<Args...>::value,
2239 "Found duplicate types among the arguments passed to copyWith(...). "
2240 "Types should be listed at most once.");
2241
2242 auto copy{ *this };
2243 copy.set(std::forward<Args>(args)...);
2244 return copy;
2245 }
2246
2248 const LinkSpeed &linkSpeed() const
2249 {
2250 return m_linkSpeed;
2251 }
2252
2255 {
2256 return m_linkSpeed;
2257 }
2258
2260 Ethernet &set(const LinkSpeed &value)
2261 {
2262 m_linkSpeed = value;
2263 return *this;
2264 }
2265
2266 template<
2267 typename T,
2268 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet::LinkSpeed>::value, int>::
2269 type = 0>
2271 {
2272 return m_linkSpeed;
2273 }
2274
2275 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2277 {
2278 return m_linkSpeed;
2279 }
2280
2282 template<typename F>
2283 void forEach(const F &f) const
2284 {
2285 f(m_linkSpeed);
2286 }
2287
2289 template<typename F>
2290 void forEach(const F &f)
2291 {
2292 f(m_linkSpeed);
2293 }
2294
2296 bool operator==(const Ethernet &other) const;
2297
2299 bool operator!=(const Ethernet &other) const;
2300
2302 std::string toString() const;
2303
2305 friend std::ostream &operator<<(std::ostream &stream, const Ethernet &value)
2306 {
2307 return stream << value.toString();
2308 }
2309
2310 private:
2311 void setFromString(const std::string &value);
2312
2313 void setFromString(const std::string &fullPath, const std::string &value);
2314
2315 std::string getString(const std::string &fullPath) const;
2316
2317 LinkSpeed m_linkSpeed;
2318
2319 friend struct DataModel::Detail::Befriend<Ethernet>;
2320 };
2321
2323
2324 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2326 {
2327 public:
2330
2332 static constexpr const char *path{ "Network/Hostname" };
2333
2335 static constexpr const char *name{ "Hostname" };
2336
2338 static constexpr const char *description{ R"description(Current hostname of the camera)description" };
2339
2341 using ValueType = std::string;
2342
2345 {
2346 return { 0, std::numeric_limits<ValueType::size_type>::max() };
2347 }
2348
2350 Hostname() = default;
2351
2353 explicit Hostname(std::string value)
2354 : m_value{ std::move(value) }
2355 {}
2356
2358 const std::string &value() const;
2359
2361 std::string toString() const;
2362
2364 bool operator==(const Hostname &other) const
2365 {
2366 return m_value == other.m_value;
2367 }
2368
2370 bool operator!=(const Hostname &other) const
2371 {
2372 return m_value != other.m_value;
2373 }
2374
2376 bool operator<(const Hostname &other) const
2377 {
2378 return m_value < other.m_value;
2379 }
2380
2382 bool operator>(const Hostname &other) const
2383 {
2384 return m_value > other.m_value;
2385 }
2386
2388 bool operator<=(const Hostname &other) const
2389 {
2390 return m_value <= other.m_value;
2391 }
2392
2394 bool operator>=(const Hostname &other) const
2395 {
2396 return m_value >= other.m_value;
2397 }
2398
2400 friend std::ostream &operator<<(std::ostream &stream, const Hostname &value)
2401 {
2402 return stream << value.toString();
2403 }
2404
2405 private:
2406 void setFromString(const std::string &value);
2407
2408 std::string m_value{};
2409
2410 friend struct DataModel::Detail::Befriend<Hostname>;
2411 };
2412
2414
2415 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2417 {
2418 public:
2421
2423 static constexpr const char *path{ "Network/IPV4" };
2424
2426 static constexpr const char *name{ "IPV4" };
2427
2429 static constexpr const char *description{ R"description(Current IPv4 protocol state)description" };
2430
2432
2433 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2435 {
2436 public:
2439
2441 static constexpr const char *path{ "Network/IPV4/Address" };
2442
2444 static constexpr const char *name{ "Address" };
2445
2447 static constexpr const char *description{ R"description(Current IPv4 address)description" };
2448
2450 using ValueType = std::string;
2451
2454 {
2455 return { 0, std::numeric_limits<ValueType::size_type>::max() };
2456 }
2457
2459 Address() = default;
2460
2462 explicit Address(std::string value)
2463 : m_value{ std::move(value) }
2464 {}
2465
2467 const std::string &value() const;
2468
2470 std::string toString() const;
2471
2473 bool operator==(const Address &other) const
2474 {
2475 return m_value == other.m_value;
2476 }
2477
2479 bool operator!=(const Address &other) const
2480 {
2481 return m_value != other.m_value;
2482 }
2483
2485 bool operator<(const Address &other) const
2486 {
2487 return m_value < other.m_value;
2488 }
2489
2491 bool operator>(const Address &other) const
2492 {
2493 return m_value > other.m_value;
2494 }
2495
2497 bool operator<=(const Address &other) const
2498 {
2499 return m_value <= other.m_value;
2500 }
2501
2503 bool operator>=(const Address &other) const
2504 {
2505 return m_value >= other.m_value;
2506 }
2507
2509 friend std::ostream &operator<<(std::ostream &stream, const Address &value)
2510 {
2511 return stream << value.toString();
2512 }
2513
2514 private:
2515 void setFromString(const std::string &value);
2516
2517 std::string m_value{};
2518
2519 friend struct DataModel::Detail::Befriend<Address>;
2520 };
2521
2522 using Descendants = std::tuple<CameraState::Network::IPV4::Address>;
2523
2526
2538#ifndef NO_DOC
2539 template<
2540 typename... Args,
2541 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2542 typename std::enable_if<
2543 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2544 value,
2545 int>::type = 0>
2546#else
2547 template<typename... Args>
2548#endif
2549 explicit IPV4(Args &&...args)
2550 {
2551 using namespace Zivid::Detail::TypeTraits;
2552
2553 static_assert(
2554 AllArgsDecayedAreUnique<Args...>::value,
2555 "Found duplicate types among the arguments passed to IPV4(...). "
2556 "Types should be listed at most once.");
2557
2558 set(std::forward<Args>(args)...);
2559 }
2560
2571#ifndef NO_DOC
2572 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2573#else
2574 template<typename... Args>
2575#endif
2576 void set(Args &&...args)
2577 {
2578 using namespace Zivid::Detail::TypeTraits;
2579
2580 using AllArgsAreDescendantNodes =
2581 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2582 static_assert(
2583 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2584
2585 static_assert(
2586 AllArgsDecayedAreUnique<Args...>::value,
2587 "Found duplicate types among the arguments passed to set(...). "
2588 "Types should be listed at most once.");
2589
2590 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2591 }
2592
2604#ifndef NO_DOC
2605 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2606#else
2607 template<typename... Args>
2608#endif
2609 IPV4 copyWith(Args &&...args) const
2610 {
2611 using namespace Zivid::Detail::TypeTraits;
2612
2613 using AllArgsAreDescendantNodes =
2614 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2615 static_assert(
2616 AllArgsAreDescendantNodes::value,
2617 "All arguments passed to copyWith(...) must be descendant nodes.");
2618
2619 static_assert(
2620 AllArgsDecayedAreUnique<Args...>::value,
2621 "Found duplicate types among the arguments passed to copyWith(...). "
2622 "Types should be listed at most once.");
2623
2624 auto copy{ *this };
2625 copy.set(std::forward<Args>(args)...);
2626 return copy;
2627 }
2628
2630 const Address &address() const
2631 {
2632 return m_address;
2633 }
2634
2637 {
2638 return m_address;
2639 }
2640
2642 IPV4 &set(const Address &value)
2643 {
2644 m_address = value;
2645 return *this;
2646 }
2647
2648 template<
2649 typename T,
2650 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value, int>::type = 0>
2652 {
2653 return m_address;
2654 }
2655
2656 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2658 {
2659 return m_address;
2660 }
2661
2663 template<typename F>
2664 void forEach(const F &f) const
2665 {
2666 f(m_address);
2667 }
2668
2670 template<typename F>
2671 void forEach(const F &f)
2672 {
2673 f(m_address);
2674 }
2675
2677 bool operator==(const IPV4 &other) const;
2678
2680 bool operator!=(const IPV4 &other) const;
2681
2683 std::string toString() const;
2684
2686 friend std::ostream &operator<<(std::ostream &stream, const IPV4 &value)
2687 {
2688 return stream << value.toString();
2689 }
2690
2691 private:
2692 void setFromString(const std::string &value);
2693
2694 void setFromString(const std::string &fullPath, const std::string &value);
2695
2696 std::string getString(const std::string &fullPath) const;
2697
2698 Address m_address;
2699
2700 friend struct DataModel::Detail::Befriend<IPV4>;
2701 };
2702
2710
2711 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2713 {
2714 public:
2717
2719 static constexpr const char *path{ "Network/LocalInterfaces" };
2720
2722 static constexpr const char *name{ "LocalInterfaces" };
2723
2725 static constexpr const char *description{
2726 R"description(List of the computer's local network interfaces that discovered the camera. In the most common scenario
2727with the camera connected to the computer with an Ethernet cable, this list will contain only the
2728network interface for that Ethernet port. In more complex network scenarios it can be the case that the
2729camera is discovered by multiple interfaces, and in that case this list will contain multiple network
2730interfaces. However, when `CameraState::Status` is `connected`, only the one network interface that has
2731the active TCP/IP connection to the camera will be listed.
2732)description"
2733 };
2734
2736 using ValueType = std::vector<CameraState::Network::LocalInterface>;
2737
2740 {
2741 return { 0, std::numeric_limits<ValueType::size_type>::max() };
2742 }
2743
2745 LocalInterfaces() = default;
2746
2748 explicit LocalInterfaces(std::vector<CameraState::Network::LocalInterface> value)
2749 : m_value{ std::move(value) }
2750 {}
2751
2753 explicit LocalInterfaces(std::initializer_list<CameraState::Network::LocalInterface> value)
2755 {}
2756
2758 const std::vector<CameraState::Network::LocalInterface> &value() const;
2759
2761 std::string toString() const;
2762
2764 std::size_t size() const noexcept;
2765
2767 bool isEmpty() const noexcept;
2768
2774 template<typename... Args>
2775 void emplaceBack(Args &&...args)
2776 {
2777 m_value.emplace_back(std::forward<Args>(args)...);
2778 }
2779
2786
2792 const CameraState::Network::LocalInterface &at(std::size_t pos) const;
2793
2800
2807
2809 template<typename F>
2810 void forEach(const F &f)
2811 {
2812 for(auto &child : m_value)
2813 {
2814 f(child);
2815 }
2816 }
2817
2819 template<typename F>
2820 void forEach(const F &f) const
2821 {
2822 for(const auto &child : m_value)
2823 {
2824 f(child);
2825 }
2826 }
2827
2829 using Iterator = std::vector<CameraState::Network::LocalInterface>::iterator;
2830
2832 Iterator begin() noexcept;
2833
2835 Iterator end() noexcept;
2836
2838 using ConstIterator = std::vector<CameraState::Network::LocalInterface>::const_iterator;
2839
2841 ConstIterator begin() const noexcept;
2842
2844 ConstIterator end() const noexcept;
2845
2847 ConstIterator cbegin() const noexcept;
2848
2850 ConstIterator cend() const noexcept;
2851
2853 bool operator==(const LocalInterfaces &other) const
2854 {
2855 return m_value == other.m_value;
2856 }
2857
2859 bool operator!=(const LocalInterfaces &other) const
2860 {
2861 return m_value != other.m_value;
2862 }
2863
2865 friend std::ostream &operator<<(std::ostream &stream, const LocalInterfaces &value)
2866 {
2867 return stream << value.toString();
2868 }
2869
2870 private:
2871 void setFromString(const std::string &value);
2872
2873 std::vector<CameraState::Network::LocalInterface> m_value{};
2874
2875 friend struct DataModel::Detail::Befriend<LocalInterfaces>;
2876 };
2877
2878 using Descendants = std::tuple<
2885
2888
2905#ifndef NO_DOC
2906 template<
2907 typename... Args,
2908 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2909 typename std::enable_if<
2910 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2911 value,
2912 int>::type = 0>
2913#else
2914 template<typename... Args>
2915#endif
2916 explicit Network(Args &&...args)
2917 {
2918 using namespace Zivid::Detail::TypeTraits;
2919
2920 static_assert(
2921 AllArgsDecayedAreUnique<Args...>::value,
2922 "Found duplicate types among the arguments passed to Network(...). "
2923 "Types should be listed at most once.");
2924
2925 set(std::forward<Args>(args)...);
2926 }
2927
2943#ifndef NO_DOC
2944 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2945#else
2946 template<typename... Args>
2947#endif
2948 void set(Args &&...args)
2949 {
2950 using namespace Zivid::Detail::TypeTraits;
2951
2952 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2953 static_assert(
2954 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2955
2956 static_assert(
2957 AllArgsDecayedAreUnique<Args...>::value,
2958 "Found duplicate types among the arguments passed to set(...). "
2959 "Types should be listed at most once.");
2960
2961 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2962 }
2963
2980#ifndef NO_DOC
2981 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2982#else
2983 template<typename... Args>
2984#endif
2985 Network copyWith(Args &&...args) const
2986 {
2987 using namespace Zivid::Detail::TypeTraits;
2988
2989 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2990 static_assert(
2991 AllArgsAreDescendantNodes::value,
2992 "All arguments passed to copyWith(...) must be descendant nodes.");
2993
2994 static_assert(
2995 AllArgsDecayedAreUnique<Args...>::value,
2996 "Found duplicate types among the arguments passed to copyWith(...). "
2997 "Types should be listed at most once.");
2998
2999 auto copy{ *this };
3000 copy.set(std::forward<Args>(args)...);
3001 return copy;
3002 }
3003
3005 const Ethernet &ethernet() const
3006 {
3007 return m_ethernet;
3008 }
3009
3012 {
3013 return m_ethernet;
3014 }
3015
3017 Network &set(const Ethernet &value)
3018 {
3019 m_ethernet = value;
3020 return *this;
3021 }
3022
3025 {
3026 m_ethernet.set(value);
3027 return *this;
3028 }
3029
3031 const Hostname &hostname() const
3032 {
3033 return m_hostname;
3034 }
3035
3038 {
3039 return m_hostname;
3040 }
3041
3043 Network &set(const Hostname &value)
3044 {
3045 m_hostname = value;
3046 return *this;
3047 }
3048
3050 const IPV4 &ipv4() const
3051 {
3052 return m_ipv4;
3053 }
3054
3057 {
3058 return m_ipv4;
3059 }
3060
3062 Network &set(const IPV4 &value)
3063 {
3064 m_ipv4 = value;
3065 return *this;
3066 }
3067
3070 {
3071 m_ipv4.set(value);
3072 return *this;
3073 }
3074
3077 {
3078 return m_localInterfaces;
3079 }
3080
3083 {
3084 return m_localInterfaces;
3085 }
3086
3089 {
3090 m_localInterfaces = value;
3091 return *this;
3092 }
3093
3094 template<
3095 typename T,
3096 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet>::value, int>::type = 0>
3098 {
3099 return m_ethernet;
3100 }
3101
3102 template<
3103 typename T,
3104 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet::LinkSpeed>::value, int>::type =
3105 0>
3107 {
3108 return m_ethernet.get<CameraState::Network::Ethernet::LinkSpeed>();
3109 }
3110
3111 template<
3112 typename T,
3113 typename std::enable_if<std::is_same<T, CameraState::Network::Hostname>::value, int>::type = 0>
3115 {
3116 return m_hostname;
3117 }
3118
3119 template<
3120 typename T,
3121 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4>::value, int>::type = 0>
3123 {
3124 return m_ipv4;
3125 }
3126
3127 template<
3128 typename T,
3129 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value, int>::type = 0>
3131 {
3132 return m_ipv4.get<CameraState::Network::IPV4::Address>();
3133 }
3134
3135 template<
3136 typename T,
3137 typename std::enable_if<std::is_same<T, CameraState::Network::LocalInterfaces>::value, int>::type = 0>
3139 {
3140 return m_localInterfaces;
3141 }
3142
3143 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3145 {
3146 return m_ethernet;
3147 }
3148
3149 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3151 {
3152 return m_hostname;
3153 }
3154
3155 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3157 {
3158 return m_ipv4;
3159 }
3160
3161 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
3163 {
3164 return m_localInterfaces;
3165 }
3166
3168 template<typename F>
3169 void forEach(const F &f) const
3170 {
3171 f(m_ethernet);
3172 f(m_hostname);
3173 f(m_ipv4);
3174 f(m_localInterfaces);
3175 }
3176
3178 template<typename F>
3179 void forEach(const F &f)
3180 {
3181 f(m_ethernet);
3182 f(m_hostname);
3183 f(m_ipv4);
3184 f(m_localInterfaces);
3185 }
3186
3188 bool operator==(const Network &other) const;
3189
3191 bool operator!=(const Network &other) const;
3192
3194 std::string toString() const;
3195
3197 friend std::ostream &operator<<(std::ostream &stream, const Network &value)
3198 {
3199 return stream << value.toString();
3200 }
3201
3202 private:
3203 void setFromString(const std::string &value);
3204
3205 void setFromString(const std::string &fullPath, const std::string &value);
3206
3207 std::string getString(const std::string &fullPath) const;
3208
3209 Ethernet m_ethernet;
3210 Hostname m_hostname;
3211 IPV4 m_ipv4;
3212 LocalInterfaces m_localInterfaces;
3213
3214 friend struct DataModel::Detail::Befriend<Network>;
3215 };
3216
3251
3252 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3254 {
3255 public:
3258
3260 static constexpr const char *path{ "Status" };
3261
3263 static constexpr const char *name{ "Status" };
3264
3266 static constexpr const char *description{
3267 R"description(This enum describes the current status of this camera. The enum can have the following values:
3268
3269* `inaccessible`: The camera was discovered, but the SDK is not able to connect to this camera. This can
3270 be because the IP settings of the camera and the PC are not compatible, or because there are several
3271 cameras with the same IP connected to your PC. The `InaccessibleReason` enum will give you more
3272 details about why this camera is not accessible. The network configuration of the camera can be changed
3273 using the ZividNetworkCameraConfigurator CLI tool. See the knowledge base for more information.
3274
3275* `busy`: The camera is currently in use by another process. This can be a different process on the same
3276 PC, or on a different PC if the camera is shared on a network.
3277
3278* `applyingNetworkConfiguration`: The camera network configuration is being changed by the current process.
3279
3280* `firmwareUpdateRequired`: The camera is accessible, but requires a firmware update before you can connect
3281 to it.
3282
3283* `updatingFirmware`: The camera firmware is currently being updated in the current process.
3284
3285* `available`: The camera is available for use by the current process. This means that you can invoke
3286 camera.connect() on this camera.
3287
3288* `connecting`: The camera is currently connecting in the current process.
3289
3290* `connected`: The camera is connected in the current process. This means camera.connect() has successfully
3291 completed and you can capture using this camera.
3292
3293* `disconnecting`: The camera is currently disconnecting in the current process. When disconnection has
3294 completed, the camera will normally go back to the `available` state.
3295
3296* `disappeared`: The camera was found earlier, but it can no longer be found. The connection between the
3297 PC and the camera may be disrupted, or the camera may have lost power. When in `disappeared` state, the
3298 camera will not be returned from `Application::cameras()`. The camera will go back to one of the other
3299 states if the camera is later found again.
3300)description"
3301 };
3302
3304 enum class ValueType
3305 {
3316 };
3317 static const Status inaccessible;
3318 static const Status busy;
3322 static const Status available;
3323 static const Status connecting;
3324 static const Status connected;
3325 static const Status disconnecting;
3326 static const Status disappeared;
3327
3329 static std::set<ValueType> validValues()
3330 {
3331 return { ValueType::inaccessible,
3341 }
3342
3344 Status() = default;
3345
3347 explicit constexpr Status(ValueType value)
3348 : m_value{ verifyValue(value) }
3349 {}
3350
3353
3355 std::string toString() const;
3356
3358 friend std::ostream &operator<<(std::ostream &stream, const Status::ValueType &value)
3359 {
3360 return stream << Status{ value }.toString();
3361 }
3362
3364 bool operator==(const Status &other) const
3365 {
3366 return m_value == other.m_value;
3367 }
3368
3370 bool operator!=(const Status &other) const
3371 {
3372 return m_value != other.m_value;
3373 }
3374
3376 friend std::ostream &operator<<(std::ostream &stream, const Status &value)
3377 {
3378 return stream << value.toString();
3379 }
3380
3381 private:
3382 void setFromString(const std::string &value);
3383
3384 constexpr ValueType static verifyValue(const ValueType &value)
3385 {
3386 return value == ValueType::inaccessible || value == ValueType::busy
3387 || value == ValueType::applyingNetworkConfiguration
3388 || value == ValueType::firmwareUpdateRequired || value == ValueType::updatingFirmware
3389 || value == ValueType::available || value == ValueType::connecting
3390 || value == ValueType::connected || value == ValueType::disconnecting
3391 || value == ValueType::disappeared
3392 ? value
3393 : throw std::invalid_argument{
3394 "Invalid value: Status{ "
3395 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
3396 };
3397 }
3398
3400
3401 friend struct DataModel::Detail::Befriend<Status>;
3402 };
3403
3405
3406 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3408 {
3409 public:
3412
3414 static constexpr const char *path{ "Temperature" };
3415
3417 static constexpr const char *name{ "Temperature" };
3418
3420 static constexpr const char *description{ R"description(Current temperature(s))description" };
3421
3423
3424 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3426 {
3427 public:
3430
3432 static constexpr const char *path{ "Temperature/DMD" };
3433
3435 static constexpr const char *name{ "DMD" };
3436
3438 static constexpr const char *description{ R"description(DMD temperature)description" };
3439
3441 using ValueType = double;
3442
3444 static constexpr Range<double> validRange()
3445 {
3446 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
3447 }
3448
3450 DMD() = default;
3451
3453 explicit constexpr DMD(double value)
3454 : m_value{ value }
3455 {}
3456
3458 double value() const;
3459
3461 std::string toString() const;
3462
3464 bool operator==(const DMD &other) const
3465 {
3466 return m_value == other.m_value;
3467 }
3468
3470 bool operator!=(const DMD &other) const
3471 {
3472 return m_value != other.m_value;
3473 }
3474
3476 bool operator<(const DMD &other) const
3477 {
3478 return m_value < other.m_value;
3479 }
3480
3482 bool operator>(const DMD &other) const
3483 {
3484 return m_value > other.m_value;
3485 }
3486
3488 bool operator<=(const DMD &other) const
3489 {
3490 return m_value <= other.m_value;
3491 }
3492
3494 bool operator>=(const DMD &other) const
3495 {
3496 return m_value >= other.m_value;
3497 }
3498
3500 friend std::ostream &operator<<(std::ostream &stream, const DMD &value)
3501 {
3502 return stream << value.toString();
3503 }
3504
3505 private:
3506 void setFromString(const std::string &value);
3507
3508 double m_value{ 0.0 };
3509
3510 friend struct DataModel::Detail::Befriend<DMD>;
3511 };
3512
3514
3515 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3517 {
3518 public:
3521
3523 static constexpr const char *path{ "Temperature/General" };
3524
3526 static constexpr const char *name{ "General" };
3527
3529 static constexpr const char *description{ R"description(General temperature)description" };
3530
3532 using ValueType = double;
3533
3535 static constexpr Range<double> validRange()
3536 {
3537 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
3538 }
3539
3541 General() = default;
3542
3544 explicit constexpr General(double value)
3545 : m_value{ value }
3546 {}
3547
3549 double value() const;
3550
3552 std::string toString() const;
3553
3555 bool operator==(const General &other) const
3556 {
3557 return m_value == other.m_value;
3558 }
3559
3561 bool operator!=(const General &other) const
3562 {
3563 return m_value != other.m_value;
3564 }
3565
3567 bool operator<(const General &other) const
3568 {
3569 return m_value < other.m_value;
3570 }
3571
3573 bool operator>(const General &other) const
3574 {
3575 return m_value > other.m_value;
3576 }
3577
3579 bool operator<=(const General &other) const
3580 {
3581 return m_value <= other.m_value;
3582 }
3583
3585 bool operator>=(const General &other) const
3586 {
3587 return m_value >= other.m_value;
3588 }
3589
3591 friend std::ostream &operator<<(std::ostream &stream, const General &value)
3592 {
3593 return stream << value.toString();
3594 }
3595
3596 private:
3597 void setFromString(const std::string &value);
3598
3599 double m_value{ 0.0 };
3600
3601 friend struct DataModel::Detail::Befriend<General>;
3602 };
3603
3605
3606 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3608 {
3609 public:
3612
3614 static constexpr const char *path{ "Temperature/LED" };
3615
3617 static constexpr const char *name{ "LED" };
3618
3620 static constexpr const char *description{ R"description(LED temperature)description" };
3621
3623 using ValueType = double;
3624
3626 static constexpr Range<double> validRange()
3627 {
3628 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
3629 }
3630
3632 LED() = default;
3633
3635 explicit constexpr LED(double value)
3636 : m_value{ value }
3637 {}
3638
3640 double value() const;
3641
3643 std::string toString() const;
3644
3646 bool operator==(const LED &other) const
3647 {
3648 return m_value == other.m_value;
3649 }
3650
3652 bool operator!=(const LED &other) const
3653 {
3654 return m_value != other.m_value;
3655 }
3656
3658 bool operator<(const LED &other) const
3659 {
3660 return m_value < other.m_value;
3661 }
3662
3664 bool operator>(const LED &other) const
3665 {
3666 return m_value > other.m_value;
3667 }
3668
3670 bool operator<=(const LED &other) const
3671 {
3672 return m_value <= other.m_value;
3673 }
3674
3676 bool operator>=(const LED &other) const
3677 {
3678 return m_value >= other.m_value;
3679 }
3680
3682 friend std::ostream &operator<<(std::ostream &stream, const LED &value)
3683 {
3684 return stream << value.toString();
3685 }
3686
3687 private:
3688 void setFromString(const std::string &value);
3689
3690 double m_value{ 0.0 };
3691
3692 friend struct DataModel::Detail::Befriend<LED>;
3693 };
3694
3696
3697 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3699 {
3700 public:
3703
3705 static constexpr const char *path{ "Temperature/Lens" };
3706
3708 static constexpr const char *name{ "Lens" };
3709
3711 static constexpr const char *description{ R"description(Lens temperature)description" };
3712
3714 using ValueType = double;
3715
3717 static constexpr Range<double> validRange()
3718 {
3719 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
3720 }
3721
3723 Lens() = default;
3724
3726 explicit constexpr Lens(double value)
3727 : m_value{ value }
3728 {}
3729
3731 double value() const;
3732
3734 std::string toString() const;
3735
3737 bool operator==(const Lens &other) const
3738 {
3739 return m_value == other.m_value;
3740 }
3741
3743 bool operator!=(const Lens &other) const
3744 {
3745 return m_value != other.m_value;
3746 }
3747
3749 bool operator<(const Lens &other) const
3750 {
3751 return m_value < other.m_value;
3752 }
3753
3755 bool operator>(const Lens &other) const
3756 {
3757 return m_value > other.m_value;
3758 }
3759
3761 bool operator<=(const Lens &other) const
3762 {
3763 return m_value <= other.m_value;
3764 }
3765
3767 bool operator>=(const Lens &other) const
3768 {
3769 return m_value >= other.m_value;
3770 }
3771
3773 friend std::ostream &operator<<(std::ostream &stream, const Lens &value)
3774 {
3775 return stream << value.toString();
3776 }
3777
3778 private:
3779 void setFromString(const std::string &value);
3780
3781 double m_value{ 0.0 };
3782
3783 friend struct DataModel::Detail::Befriend<Lens>;
3784 };
3785
3787
3788 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3790 {
3791 public:
3794
3796 static constexpr const char *path{ "Temperature/PCB" };
3797
3799 static constexpr const char *name{ "PCB" };
3800
3802 static constexpr const char *description{ R"description(PCB temperature)description" };
3803
3805 using ValueType = double;
3806
3808 static constexpr Range<double> validRange()
3809 {
3810 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
3811 }
3812
3814 PCB() = default;
3815
3817 explicit constexpr PCB(double value)
3818 : m_value{ value }
3819 {}
3820
3822 double value() const;
3823
3825 std::string toString() const;
3826
3828 bool operator==(const PCB &other) const
3829 {
3830 return m_value == other.m_value;
3831 }
3832
3834 bool operator!=(const PCB &other) const
3835 {
3836 return m_value != other.m_value;
3837 }
3838
3840 bool operator<(const PCB &other) const
3841 {
3842 return m_value < other.m_value;
3843 }
3844
3846 bool operator>(const PCB &other) const
3847 {
3848 return m_value > other.m_value;
3849 }
3850
3852 bool operator<=(const PCB &other) const
3853 {
3854 return m_value <= other.m_value;
3855 }
3856
3858 bool operator>=(const PCB &other) const
3859 {
3860 return m_value >= other.m_value;
3861 }
3862
3864 friend std::ostream &operator<<(std::ostream &stream, const PCB &value)
3865 {
3866 return stream << value.toString();
3867 }
3868
3869 private:
3870 void setFromString(const std::string &value);
3871
3872 double m_value{ 0.0 };
3873
3874 friend struct DataModel::Detail::Befriend<PCB>;
3875 };
3876
3877 using Descendants = std::tuple<
3883
3886
3902#ifndef NO_DOC
3903 template<
3904 typename... Args,
3905 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3906 typename std::enable_if<
3907 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
3908 value,
3909 int>::type = 0>
3910#else
3911 template<typename... Args>
3912#endif
3913 explicit Temperature(Args &&...args)
3914 {
3915 using namespace Zivid::Detail::TypeTraits;
3916
3917 static_assert(
3918 AllArgsDecayedAreUnique<Args...>::value,
3919 "Found duplicate types among the arguments passed to Temperature(...). "
3920 "Types should be listed at most once.");
3921
3922 set(std::forward<Args>(args)...);
3923 }
3924
3939#ifndef NO_DOC
3940 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3941#else
3942 template<typename... Args>
3943#endif
3944 void set(Args &&...args)
3945 {
3946 using namespace Zivid::Detail::TypeTraits;
3947
3948 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3949 static_assert(
3950 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3951
3952 static_assert(
3953 AllArgsDecayedAreUnique<Args...>::value,
3954 "Found duplicate types among the arguments passed to set(...). "
3955 "Types should be listed at most once.");
3956
3957 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
3958 }
3959
3975#ifndef NO_DOC
3976 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
3977#else
3978 template<typename... Args>
3979#endif
3980 Temperature copyWith(Args &&...args) const
3981 {
3982 using namespace Zivid::Detail::TypeTraits;
3983
3984 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3985 static_assert(
3986 AllArgsAreDescendantNodes::value,
3987 "All arguments passed to copyWith(...) must be descendant nodes.");
3988
3989 static_assert(
3990 AllArgsDecayedAreUnique<Args...>::value,
3991 "Found duplicate types among the arguments passed to copyWith(...). "
3992 "Types should be listed at most once.");
3993
3994 auto copy{ *this };
3995 copy.set(std::forward<Args>(args)...);
3996 return copy;
3997 }
3998
4000 const DMD &dmd() const
4001 {
4002 return m_dmd;
4003 }
4004
4007 {
4008 return m_dmd;
4009 }
4010
4012 Temperature &set(const DMD &value)
4013 {
4014 m_dmd = value;
4015 return *this;
4016 }
4017
4019 const General &general() const
4020 {
4021 return m_general;
4022 }
4023
4026 {
4027 return m_general;
4028 }
4029
4031 Temperature &set(const General &value)
4032 {
4033 m_general = value;
4034 return *this;
4035 }
4036
4038 const LED &led() const
4039 {
4040 return m_led;
4041 }
4042
4045 {
4046 return m_led;
4047 }
4048
4050 Temperature &set(const LED &value)
4051 {
4052 m_led = value;
4053 return *this;
4054 }
4055
4057 const Lens &lens() const
4058 {
4059 return m_lens;
4060 }
4061
4064 {
4065 return m_lens;
4066 }
4067
4069 Temperature &set(const Lens &value)
4070 {
4071 m_lens = value;
4072 return *this;
4073 }
4074
4076 const PCB &pcb() const
4077 {
4078 return m_pcb;
4079 }
4080
4083 {
4084 return m_pcb;
4085 }
4086
4088 Temperature &set(const PCB &value)
4089 {
4090 m_pcb = value;
4091 return *this;
4092 }
4093
4094 template<
4095 typename T,
4096 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value, int>::type = 0>
4098 {
4099 return m_dmd;
4100 }
4101
4102 template<
4103 typename T,
4104 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value, int>::type = 0>
4106 {
4107 return m_general;
4108 }
4109
4110 template<
4111 typename T,
4112 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value, int>::type = 0>
4114 {
4115 return m_led;
4116 }
4117
4118 template<
4119 typename T,
4120 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value, int>::type = 0>
4122 {
4123 return m_lens;
4124 }
4125
4126 template<
4127 typename T,
4128 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value, int>::type = 0>
4130 {
4131 return m_pcb;
4132 }
4133
4134 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
4136 {
4137 return m_dmd;
4138 }
4139
4140 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
4142 {
4143 return m_general;
4144 }
4145
4146 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
4148 {
4149 return m_led;
4150 }
4151
4152 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
4154 {
4155 return m_lens;
4156 }
4157
4158 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
4160 {
4161 return m_pcb;
4162 }
4163
4165 template<typename F>
4166 void forEach(const F &f) const
4167 {
4168 f(m_dmd);
4169 f(m_general);
4170 f(m_led);
4171 f(m_lens);
4172 f(m_pcb);
4173 }
4174
4176 template<typename F>
4177 void forEach(const F &f)
4178 {
4179 f(m_dmd);
4180 f(m_general);
4181 f(m_led);
4182 f(m_lens);
4183 f(m_pcb);
4184 }
4185
4187 bool operator==(const Temperature &other) const;
4188
4190 bool operator!=(const Temperature &other) const;
4191
4193 std::string toString() const;
4194
4196 friend std::ostream &operator<<(std::ostream &stream, const Temperature &value)
4197 {
4198 return stream << value.toString();
4199 }
4200
4201 private:
4202 void setFromString(const std::string &value);
4203
4204 void setFromString(const std::string &fullPath, const std::string &value);
4205
4206 std::string getString(const std::string &fullPath) const;
4207
4208 DMD m_dmd;
4209 General m_general;
4210 LED m_led;
4211 Lens m_lens;
4212 PCB m_pcb;
4213
4214 friend struct DataModel::Detail::Befriend<Temperature>;
4215 };
4216
4217 using Descendants = std::tuple<
4235
4238
4240 explicit CameraState(const std::string &fileName);
4241
4247 [[nodiscard]] static CameraState fromSerialized(const std::string &value);
4248
4254 std::string serialize() const;
4255
4283#ifndef NO_DOC
4284 template<
4285 typename... Args,
4286 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
4287 typename std::enable_if<
4288 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
4289 int>::type = 0>
4290#else
4291 template<typename... Args>
4292#endif
4293 explicit CameraState(Args &&...args)
4294 {
4295 using namespace Zivid::Detail::TypeTraits;
4296
4297 static_assert(
4298 AllArgsDecayedAreUnique<Args...>::value,
4299 "Found duplicate types among the arguments passed to CameraState(...). "
4300 "Types should be listed at most once.");
4301
4302 set(std::forward<Args>(args)...);
4303 }
4304
4331#ifndef NO_DOC
4332 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
4333#else
4334 template<typename... Args>
4335#endif
4336 void set(Args &&...args)
4337 {
4338 using namespace Zivid::Detail::TypeTraits;
4339
4340 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4341 static_assert(
4342 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
4343
4344 static_assert(
4345 AllArgsDecayedAreUnique<Args...>::value,
4346 "Found duplicate types among the arguments passed to set(...). "
4347 "Types should be listed at most once.");
4348
4349 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
4350 }
4351
4379#ifndef NO_DOC
4380 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
4381#else
4382 template<typename... Args>
4383#endif
4384 CameraState copyWith(Args &&...args) const
4385 {
4386 using namespace Zivid::Detail::TypeTraits;
4387
4388 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4389 static_assert(
4390 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
4391
4392 static_assert(
4393 AllArgsDecayedAreUnique<Args...>::value,
4394 "Found duplicate types among the arguments passed to copyWith(...). "
4395 "Types should be listed at most once.");
4396
4397 auto copy{ *this };
4398 copy.set(std::forward<Args>(args)...);
4399 return copy;
4400 }
4401
4403 const Available &isAvailable() const
4404 {
4405 return m_available;
4406 }
4407
4410 {
4411 return m_available;
4412 }
4413
4416 {
4417 m_available = value;
4418 return *this;
4419 }
4420
4422 const Connected &isConnected() const
4423 {
4424 return m_connected;
4425 }
4426
4429 {
4430 return m_connected;
4431 }
4432
4435 {
4436 m_connected = value;
4437 return *this;
4438 }
4439
4442 {
4443 return m_inaccessibleReason;
4444 }
4445
4448 {
4449 return m_inaccessibleReason;
4450 }
4451
4454 {
4455 m_inaccessibleReason = value;
4456 return *this;
4457 }
4458
4460 const Network &network() const
4461 {
4462 return m_network;
4463 }
4464
4467 {
4468 return m_network;
4469 }
4470
4472 CameraState &set(const Network &value)
4473 {
4474 m_network = value;
4475 return *this;
4476 }
4477
4480 {
4481 m_network.set(value);
4482 return *this;
4483 }
4484
4487 {
4488 m_network.set(value);
4489 return *this;
4490 }
4491
4494 {
4495 m_network.set(value);
4496 return *this;
4497 }
4498
4501 {
4502 m_network.set(value);
4503 return *this;
4504 }
4505
4508 {
4509 m_network.set(value);
4510 return *this;
4511 }
4512
4515 {
4516 m_network.set(value);
4517 return *this;
4518 }
4519
4521 const Status &status() const
4522 {
4523 return m_status;
4524 }
4525
4528 {
4529 return m_status;
4530 }
4531
4533 CameraState &set(const Status &value)
4534 {
4535 m_status = value;
4536 return *this;
4537 }
4538
4541 {
4542 return m_temperature;
4543 }
4544
4547 {
4548 return m_temperature;
4549 }
4550
4553 {
4554 m_temperature = value;
4555 return *this;
4556 }
4557
4560 {
4561 m_temperature.set(value);
4562 return *this;
4563 }
4564
4567 {
4568 m_temperature.set(value);
4569 return *this;
4570 }
4571
4574 {
4575 m_temperature.set(value);
4576 return *this;
4577 }
4578
4581 {
4582 m_temperature.set(value);
4583 return *this;
4584 }
4585
4588 {
4589 m_temperature.set(value);
4590 return *this;
4591 }
4592
4593 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Available>::value, int>::type = 0>
4595 {
4596 return m_available;
4597 }
4598
4599 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Connected>::value, int>::type = 0>
4601 {
4602 return m_connected;
4603 }
4604
4605 template<
4606 typename T,
4607 typename std::enable_if<std::is_same<T, CameraState::InaccessibleReason>::value, int>::type = 0>
4609 {
4610 return m_inaccessibleReason;
4611 }
4612
4613 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Network>::value, int>::type = 0>
4615 {
4616 return m_network;
4617 }
4618
4619 template<
4620 typename T,
4621 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet>::value, int>::type = 0>
4623 {
4624 return m_network.get<CameraState::Network::Ethernet>();
4625 }
4626
4627 template<
4628 typename T,
4629 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet::LinkSpeed>::value, int>::type = 0>
4631 {
4632 return m_network.get<CameraState::Network::Ethernet::LinkSpeed>();
4633 }
4634
4635 template<
4636 typename T,
4637 typename std::enable_if<std::is_same<T, CameraState::Network::Hostname>::value, int>::type = 0>
4639 {
4640 return m_network.get<CameraState::Network::Hostname>();
4641 }
4642
4643 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Network::IPV4>::value, int>::type = 0>
4645 {
4646 return m_network.get<CameraState::Network::IPV4>();
4647 }
4648
4649 template<
4650 typename T,
4651 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value, int>::type = 0>
4653 {
4654 return m_network.get<CameraState::Network::IPV4::Address>();
4655 }
4656
4657 template<
4658 typename T,
4659 typename std::enable_if<std::is_same<T, CameraState::Network::LocalInterfaces>::value, int>::type = 0>
4661 {
4662 return m_network.get<CameraState::Network::LocalInterfaces>();
4663 }
4664
4665 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Status>::value, int>::type = 0>
4667 {
4668 return m_status;
4669 }
4670
4671 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Temperature>::value, int>::type = 0>
4673 {
4674 return m_temperature;
4675 }
4676
4677 template<
4678 typename T,
4679 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value, int>::type = 0>
4681 {
4682 return m_temperature.get<CameraState::Temperature::DMD>();
4683 }
4684
4685 template<
4686 typename T,
4687 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value, int>::type = 0>
4689 {
4690 return m_temperature.get<CameraState::Temperature::General>();
4691 }
4692
4693 template<
4694 typename T,
4695 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value, int>::type = 0>
4697 {
4698 return m_temperature.get<CameraState::Temperature::LED>();
4699 }
4700
4701 template<
4702 typename T,
4703 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value, int>::type = 0>
4705 {
4706 return m_temperature.get<CameraState::Temperature::Lens>();
4707 }
4708
4709 template<
4710 typename T,
4711 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value, int>::type = 0>
4713 {
4714 return m_temperature.get<CameraState::Temperature::PCB>();
4715 }
4716
4717 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
4719 {
4720 return m_available;
4721 }
4722
4723 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
4725 {
4726 return m_connected;
4727 }
4728
4729 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
4731 {
4732 return m_inaccessibleReason;
4733 }
4734
4735 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
4737 {
4738 return m_network;
4739 }
4740
4741 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
4743 {
4744 return m_status;
4745 }
4746
4747 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
4749 {
4750 return m_temperature;
4751 }
4752
4754 template<typename F>
4755 void forEach(const F &f) const
4756 {
4757 f(m_available);
4758 f(m_connected);
4759 f(m_inaccessibleReason);
4760 f(m_network);
4761 f(m_status);
4762 f(m_temperature);
4763 }
4764
4766 template<typename F>
4767 void forEach(const F &f)
4768 {
4769 f(m_available);
4770 f(m_connected);
4771 f(m_inaccessibleReason);
4772 f(m_network);
4773 f(m_status);
4774 f(m_temperature);
4775 }
4776
4778 bool operator==(const CameraState &other) const;
4779
4781 bool operator!=(const CameraState &other) const;
4782
4784 std::string toString() const;
4785
4787 friend std::ostream &operator<<(std::ostream &stream, const CameraState &value)
4788 {
4789 return stream << value.toString();
4790 }
4791
4793 void save(const std::string &fileName) const;
4794
4796 void load(const std::string &fileName);
4797
4798 private:
4799 void setFromString(const std::string &value);
4800
4801 void setFromString(const std::string &fullPath, const std::string &value);
4802
4803 std::string getString(const std::string &fullPath) const;
4804
4805 Available m_available;
4806 Connected m_connected;
4807 InaccessibleReason m_inaccessibleReason;
4808 Network m_network;
4809 Status m_status;
4810 Temperature m_temperature;
4811
4812 friend struct DataModel::Detail::Befriend<CameraState>;
4813 };
4814
4815#ifndef NO_DOC
4816 template<>
4817 struct CameraState::Version<11>
4818 {
4819 using Type = CameraState;
4820 };
4821#endif
4822
4823} // namespace Zivid
4824
4825#ifndef NO_DOC
4827namespace Zivid::Detail
4828{
4829
4830 ZIVID_CORE_EXPORT void save(const Zivid::CameraState &dataModel, std::ostream &ostream);
4831 ZIVID_CORE_EXPORT void load(Zivid::CameraState &dataModel, std::istream &istream);
4832
4833} // namespace Zivid::Detail
4834#endif
4835
4836#ifdef _MSC_VER
4837# pragma warning(pop)
4838#endif
4839
4840#ifndef NO_DOC
4841# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
4842namespace std // NOLINT
4843{
4844
4845 template<>
4846 struct tuple_size<Zivid::CameraState::Network> : integral_constant<size_t, 4>
4847 {};
4848
4849 template<size_t i>
4850 struct tuple_element<i, Zivid::CameraState::Network>
4851 {
4852 static_assert(i < tuple_size<Zivid::CameraState::Network>::value, "Index must be less than 4");
4853
4854 using type // NOLINT
4855 = decltype(declval<Zivid::CameraState::Network>().get<i>());
4856 };
4857
4858 template<>
4859 struct tuple_size<Zivid::CameraState::Network::Ethernet> : integral_constant<size_t, 1>
4860 {};
4861
4862 template<size_t i>
4863 struct tuple_element<i, Zivid::CameraState::Network::Ethernet>
4864 {
4865 static_assert(i < tuple_size<Zivid::CameraState::Network::Ethernet>::value, "Index must be less than 1");
4866
4867 using type // NOLINT
4868 = decltype(declval<Zivid::CameraState::Network::Ethernet>().get<i>());
4869 };
4870
4871 template<>
4872 struct tuple_size<Zivid::CameraState::Network::IPV4> : integral_constant<size_t, 1>
4873 {};
4874
4875 template<size_t i>
4876 struct tuple_element<i, Zivid::CameraState::Network::IPV4>
4877 {
4878 static_assert(i < tuple_size<Zivid::CameraState::Network::IPV4>::value, "Index must be less than 1");
4879
4880 using type // NOLINT
4881 = decltype(declval<Zivid::CameraState::Network::IPV4>().get<i>());
4882 };
4883
4884 template<>
4885 struct tuple_size<Zivid::CameraState::Temperature> : integral_constant<size_t, 5>
4886 {};
4887
4888 template<size_t i>
4889 struct tuple_element<i, Zivid::CameraState::Temperature>
4890 {
4891 static_assert(i < tuple_size<Zivid::CameraState::Temperature>::value, "Index must be less than 5");
4892
4893 using type // NOLINT
4894 = decltype(declval<Zivid::CameraState::Temperature>().get<i>());
4895 };
4896
4897 template<>
4898 struct tuple_size<Zivid::CameraState> : integral_constant<size_t, 6>
4899 {};
4900
4901 template<size_t i>
4902 struct tuple_element<i, Zivid::CameraState>
4903 {
4904 static_assert(i < tuple_size<Zivid::CameraState>::value, "Index must be less than 6");
4905
4906 using type // NOLINT
4907 = decltype(declval<Zivid::CameraState>().get<i>());
4908 };
4909
4910} // namespace std
4911# endif
4912#endif
4913
4914// If we have access to the DataModel library, automatically include internal DataModel
4915// header. This header is necessary for serialization and deserialization.
4916#if defined(__has_include) && !defined(NO_DOC)
4917# if __has_include("Zivid/CameraStateInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
4918# include "Zivid/CameraStateInternal.h"
4919# endif
4920#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Flag if camera is physically connected to the computer and is available for use, but not connected in...
Definition CameraState.h:116
static std::set< bool > validValues()
All valid values of Available.
Definition CameraState.h:141
static const Available no
Off/disabled.
Definition CameraState.h:138
bool operator==(const Available &other) const
Comparison operator.
Definition CameraState.h:167
std::string toString() const
Get the value as string.
bool ValueType
The type of the underlying value.
Definition CameraState.h:136
static const Available yes
On/enabled.
Definition CameraState.h:137
friend std::ostream & operator<<(std::ostream &stream, const Available &value)
Operator to serialize the value to a stream.
Definition CameraState.h:179
static constexpr const char * path
The full path for this value.
Definition CameraState.h:122
bool operator!=(const Available &other) const
Comparison operator.
Definition CameraState.h:173
constexpr Available(bool value)
Constructor.
Definition CameraState.h:150
bool value() const
Get the value.
static constexpr const char * name
The name of this value.
Definition CameraState.h:125
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:119
Available()=default
Default constructor.
static constexpr const char * description
The description for this value.
Definition CameraState.h:128
Flag if camera is connected in software. This bool is true when the Status value is connected....
Definition CameraState.h:198
Connected()=default
Default constructor.
static const Connected yes
On/enabled.
Definition CameraState.h:218
static const Connected no
Off/disabled.
Definition CameraState.h:219
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:201
bool operator!=(const Connected &other) const
Comparison operator.
Definition CameraState.h:254
static constexpr const char * name
The name of this value.
Definition CameraState.h:207
constexpr Connected(bool value)
Constructor.
Definition CameraState.h:231
bool value() const
Get the value.
std::string toString() const
Get the value as string.
static constexpr const char * description
The description for this value.
Definition CameraState.h:210
friend std::ostream & operator<<(std::ostream &stream, const Connected &value)
Operator to serialize the value to a stream.
Definition CameraState.h:260
static std::set< bool > validValues()
All valid values of Connected.
Definition CameraState.h:222
bool operator==(const Connected &other) const
Comparison operator.
Definition CameraState.h:248
static constexpr const char * path
The full path for this value.
Definition CameraState.h:204
bool ValueType
The type of the underlying value.
Definition CameraState.h:217
If the camera status is inaccessible, then this enum value will give you the reason.
Definition CameraState.h:277
static const InaccessibleReason ipNotInLocalSubnet
ipNotInLocalSubnet
Definition CameraState.h:303
constexpr InaccessibleReason(ValueType value)
Constructor.
Definition CameraState.h:319
bool hasValue() const
Check if the value is set.
static constexpr const char * path
The full path for this value.
Definition CameraState.h:283
static const InaccessibleReason ipConflictWithAnotherCamera
ipConflictWithAnotherCamera
Definition CameraState.h:301
friend std::ostream & operator<<(std::ostream &stream, const InaccessibleReason::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:339
bool operator==(const InaccessibleReason &other) const
Comparison operator.
Definition CameraState.h:345
static constexpr const char * description
The description for this value.
Definition CameraState.h:289
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const InaccessibleReason &value)
Operator to serialize the value to a stream.
Definition CameraState.h:357
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:280
static const InaccessibleReason ipConflictWithLocalNetworkAdapter
ipConflictWithLocalNetworkAdapter
Definition CameraState.h:302
InaccessibleReason()=default
Default constructor.
static const InaccessibleReason ipInMultipleLocalSubnets
ipInMultipleLocalSubnets
Definition CameraState.h:304
static constexpr const char * name
The name of this value.
Definition CameraState.h:286
ValueType
The type of the underlying value.
Definition CameraState.h:295
@ ipConflictWithLocalNetworkAdapter
Definition CameraState.h:297
@ ipNotInLocalSubnet
Definition CameraState.h:298
@ ipInMultipleLocalSubnets
Definition CameraState.h:299
@ ipConflictWithAnotherCamera
Definition CameraState.h:296
ValueType value() const
Get the value.
void reset()
Reset the node to unset state.
bool operator!=(const InaccessibleReason &other) const
Comparison operator.
Definition CameraState.h:351
static std::set< ValueType > validValues()
All valid values of InaccessibleReason.
Definition CameraState.h:307
The link speed that the camera's Ethernet interface is operating at.
Definition CameraState.h:2002
static const LinkSpeed link2_5Gbps
link2_5Gbps
Definition CameraState.h:2046
static const LinkSpeed link400Gbps
link400Gbps
Definition CameraState.h:2058
static const LinkSpeed link20Gbps
link20Gbps
Definition CameraState.h:2050
static const LinkSpeed link1600Gbps
link1600Gbps
Definition CameraState.h:2060
std::string toString() const
Get the value as string.
static const LinkSpeed link25Gbps
link25Gbps
Definition CameraState.h:2051
static const LinkSpeed link100Gbps
link100Gbps
Definition CameraState.h:2056
static const LinkSpeed unknown
unknown
Definition CameraState.h:2042
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2005
bool operator!=(const LinkSpeed &other) const
Comparison operator.
Definition CameraState.h:2101
static const LinkSpeed link800Gbps
link800Gbps
Definition CameraState.h:2059
static constexpr const char * name
The name of this value.
Definition CameraState.h:2011
static const LinkSpeed link100Mbps
link100Mbps
Definition CameraState.h:2044
static const LinkSpeed link14Gbps
link14Gbps
Definition CameraState.h:2049
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2008
friend std::ostream & operator<<(std::ostream &stream, const LinkSpeed::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:2089
static const LinkSpeed link56Gbps
link56Gbps
Definition CameraState.h:2054
static const LinkSpeed link5Gbps
link5Gbps
Definition CameraState.h:2047
static constexpr const char * description
The description for this value.
Definition CameraState.h:2014
static const LinkSpeed link10Gbps
link10Gbps
Definition CameraState.h:2048
ValueType value() const
Get the value.
static const LinkSpeed link80Gbps
link80Gbps
Definition CameraState.h:2055
friend std::ostream & operator<<(std::ostream &stream, const LinkSpeed &value)
Operator to serialize the value to a stream.
Definition CameraState.h:2107
constexpr LinkSpeed(ValueType value)
Constructor.
Definition CameraState.h:2078
static const LinkSpeed link200Gbps
link200Gbps
Definition CameraState.h:2057
static const LinkSpeed link10Mbps
link10Mbps
Definition CameraState.h:2043
static std::set< ValueType > validValues()
All valid values of LinkSpeed.
Definition CameraState.h:2063
static const LinkSpeed link40Gbps
link40Gbps
Definition CameraState.h:2052
static const LinkSpeed link1Gbps
link1Gbps
Definition CameraState.h:2045
ValueType
The type of the underlying value.
Definition CameraState.h:2021
bool operator==(const LinkSpeed &other) const
Comparison operator.
Definition CameraState.h:2095
static const LinkSpeed link50Gbps
link50Gbps
Definition CameraState.h:2053
Current Ethernet state.
Definition CameraState.h:1983
friend std::ostream & operator<<(std::ostream &stream, const Ethernet &value)
Operator to send the value as string to a stream.
Definition CameraState.h:2305
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:1986
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:2290
Ethernet copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:2227
static constexpr const char * name
The name of this value.
Definition CameraState.h:1992
const CameraState::Network::Ethernet::LinkSpeed & get() const
Definition CameraState.h:2270
std::tuple< CameraState::Network::Ethernet::LinkSpeed > Descendants
Definition CameraState.h:2140
LinkSpeed & linkSpeed()
Get LinkSpeed.
Definition CameraState.h:2254
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:2283
static constexpr const char * description
The description for this value.
Definition CameraState.h:1995
static constexpr const char * path
The full path for this value.
Definition CameraState.h:1989
Ethernet & set(const LinkSpeed &value)
Set LinkSpeed.
Definition CameraState.h:2260
bool operator!=(const Ethernet &other) const
Inequality operator.
std::string toString() const
Get the value as string.
bool operator==(const Ethernet &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:2194
const LinkSpeed & linkSpeed() const
Get LinkSpeed.
Definition CameraState.h:2248
Current hostname of the camera.
Definition CameraState.h:2326
friend std::ostream & operator<<(std::ostream &stream, const Hostname &value)
Operator to serialize the value to a stream.
Definition CameraState.h:2400
std::string ValueType
The type of the underlying value.
Definition CameraState.h:2341
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2329
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2332
bool operator>(const Hostname &other) const
Comparison operator.
Definition CameraState.h:2382
bool operator!=(const Hostname &other) const
Comparison operator.
Definition CameraState.h:2370
bool operator>=(const Hostname &other) const
Comparison operator.
Definition CameraState.h:2394
bool operator==(const Hostname &other) const
Comparison operator.
Definition CameraState.h:2364
bool operator<(const Hostname &other) const
Comparison operator.
Definition CameraState.h:2376
Hostname()=default
Default constructor.
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition CameraState.h:2335
const std::string & value() const
Get the value.
static constexpr const char * description
The description for this value.
Definition CameraState.h:2338
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Hostname.
Definition CameraState.h:2344
bool operator<=(const Hostname &other) const
Comparison operator.
Definition CameraState.h:2388
Hostname(std::string value)
Constructor.
Definition CameraState.h:2353
Current IPv4 address.
Definition CameraState.h:2435
Address()=default
Default constructor.
bool operator<(const Address &other) const
Comparison operator.
Definition CameraState.h:2485
static constexpr const char * description
The description for this value.
Definition CameraState.h:2447
bool operator==(const Address &other) const
Comparison operator.
Definition CameraState.h:2473
bool operator<=(const Address &other) const
Comparison operator.
Definition CameraState.h:2497
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Address.
Definition CameraState.h:2453
bool operator>(const Address &other) const
Comparison operator.
Definition CameraState.h:2491
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2438
bool operator!=(const Address &other) const
Comparison operator.
Definition CameraState.h:2479
const std::string & value() const
Get the value.
static constexpr const char * name
The name of this value.
Definition CameraState.h:2444
friend std::ostream & operator<<(std::ostream &stream, const Address &value)
Operator to serialize the value to a stream.
Definition CameraState.h:2509
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2441
bool operator>=(const Address &other) const
Comparison operator.
Definition CameraState.h:2503
Address(std::string value)
Constructor.
Definition CameraState.h:2462
std::string toString() const
Get the value as string.
std::string ValueType
The type of the underlying value.
Definition CameraState.h:2450
Current IPv4 protocol state.
Definition CameraState.h:2417
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2420
IPV4()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:2576
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:2664
static constexpr const char * description
The description for this value.
Definition CameraState.h:2429
const Address & address() const
Get Address.
Definition CameraState.h:2630
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2423
friend std::ostream & operator<<(std::ostream &stream, const IPV4 &value)
Operator to send the value as string to a stream.
Definition CameraState.h:2686
IPV4 copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:2609
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:2651
static constexpr const char * name
The name of this value.
Definition CameraState.h:2426
bool operator==(const IPV4 &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 CameraState.h:2671
IPV4 & set(const Address &value)
Set Address.
Definition CameraState.h:2642
std::string toString() const
Get the value as string.
std::tuple< CameraState::Network::IPV4::Address > Descendants
Definition CameraState.h:2522
Address & address()
Get Address.
Definition CameraState.h:2636
bool operator!=(const IPV4 &other) const
Inequality operator.
The link speed that the computer's Ethernet interface is operating at.
Definition CameraState.h:445
static const LinkSpeed link10Gbps
link10Gbps
Definition CameraState.h:491
constexpr LinkSpeed(ValueType value)
Constructor.
Definition CameraState.h:521
static const LinkSpeed link10Mbps
link10Mbps
Definition CameraState.h:486
static const LinkSpeed link100Gbps
link100Gbps
Definition CameraState.h:499
static const LinkSpeed link25Gbps
link25Gbps
Definition CameraState.h:494
static const LinkSpeed link5Gbps
link5Gbps
Definition CameraState.h:490
static const LinkSpeed link50Gbps
link50Gbps
Definition CameraState.h:496
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:448
static const LinkSpeed link100Mbps
link100Mbps
Definition CameraState.h:487
static const LinkSpeed link800Gbps
link800Gbps
Definition CameraState.h:502
static const LinkSpeed link400Gbps
link400Gbps
Definition CameraState.h:501
bool operator!=(const LinkSpeed &other) const
Comparison operator.
Definition CameraState.h:544
static const LinkSpeed link14Gbps
link14Gbps
Definition CameraState.h:492
static const LinkSpeed link40Gbps
link40Gbps
Definition CameraState.h:495
static const LinkSpeed link56Gbps
link56Gbps
Definition CameraState.h:497
ValueType
The type of the underlying value.
Definition CameraState.h:464
static const LinkSpeed link1Gbps
link1Gbps
Definition CameraState.h:488
bool operator==(const LinkSpeed &other) const
Comparison operator.
Definition CameraState.h:538
friend std::ostream & operator<<(std::ostream &stream, const LinkSpeed::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:532
static std::set< ValueType > validValues()
All valid values of LinkSpeed.
Definition CameraState.h:506
static const LinkSpeed link2_5Gbps
link2_5Gbps
Definition CameraState.h:489
static const LinkSpeed link80Gbps
link80Gbps
Definition CameraState.h:498
friend std::ostream & operator<<(std::ostream &stream, const LinkSpeed &value)
Operator to serialize the value to a stream.
Definition CameraState.h:550
static constexpr const char * description
The description for this value.
Definition CameraState.h:457
static const LinkSpeed link1600Gbps
link1600Gbps
Definition CameraState.h:503
static const LinkSpeed link200Gbps
link200Gbps
Definition CameraState.h:500
static const LinkSpeed unknown
unknown
Definition CameraState.h:485
static const LinkSpeed link20Gbps
link20Gbps
Definition CameraState.h:493
static constexpr const char * path
The full path for this value.
Definition CameraState.h:451
static constexpr const char * name
The name of this value.
Definition CameraState.h:454
std::string toString() const
Get the value as string.
Current Ethernet state.
Definition CameraState.h:426
friend std::ostream & operator<<(std::ostream &stream, const Ethernet &value)
Operator to send the value as string to a stream.
Definition CameraState.h:750
Ethernet copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:671
std::tuple< CameraState::Network::LocalInterface::Ethernet::LinkSpeed > Descendants
Definition CameraState.h:583
static constexpr const char * path
The full path for this value.
Definition CameraState.h:432
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:429
LinkSpeed & linkSpeed()
Get LinkSpeed.
Definition CameraState.h:698
bool operator==(const Ethernet &other) const
Equality operator.
bool operator!=(const Ethernet &other) const
Inequality operator.
const LinkSpeed & linkSpeed() const
Get LinkSpeed.
Definition CameraState.h:692
static constexpr const char * description
The description for this value.
Definition CameraState.h:438
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:728
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:637
Ethernet & set(const LinkSpeed &value)
Set LinkSpeed.
Definition CameraState.h:704
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:735
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition CameraState.h:435
const CameraState::Network::LocalInterface::Ethernet::LinkSpeed & get() const
Definition CameraState.h:715
IP address of the computer's local network interface.
Definition CameraState.h:813
bool operator>=(const Address &other) const
Comparison operator.
Definition CameraState.h:883
bool operator<(const Address &other) const
Comparison operator.
Definition CameraState.h:865
bool operator<=(const Address &other) const
Comparison operator.
Definition CameraState.h:877
static constexpr const char * name
The name of this value.
Definition CameraState.h:822
std::string ValueType
The type of the underlying value.
Definition CameraState.h:830
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Address.
Definition CameraState.h:833
std::string toString() const
Get the value as string.
static constexpr const char * path
The full path for this value.
Definition CameraState.h:819
friend std::ostream & operator<<(std::ostream &stream, const Address &value)
Operator to serialize the value to a stream.
Definition CameraState.h:889
Address(std::string value)
Constructor.
Definition CameraState.h:842
bool operator!=(const Address &other) const
Comparison operator.
Definition CameraState.h:859
static constexpr const char * description
The description for this value.
Definition CameraState.h:825
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:816
bool operator>(const Address &other) const
Comparison operator.
Definition CameraState.h:871
bool operator==(const Address &other) const
Comparison operator.
Definition CameraState.h:853
Subnet mask of the computer's local network interface.
Definition CameraState.h:906
bool operator!=(const Mask &other) const
Comparison operator.
Definition CameraState.h:952
bool operator>=(const Mask &other) const
Comparison operator.
Definition CameraState.h:976
Mask(std::string value)
Constructor.
Definition CameraState.h:935
static constexpr const char * description
The description for this value.
Definition CameraState.h:918
friend std::ostream & operator<<(std::ostream &stream, const Mask &value)
Operator to serialize the value to a stream.
Definition CameraState.h:982
bool operator==(const Mask &other) const
Comparison operator.
Definition CameraState.h:946
bool operator>(const Mask &other) const
Comparison operator.
Definition CameraState.h:964
static constexpr const char * name
The name of this value.
Definition CameraState.h:915
bool operator<(const Mask &other) const
Comparison operator.
Definition CameraState.h:958
bool operator<=(const Mask &other) const
Comparison operator.
Definition CameraState.h:970
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:909
std::string toString() const
Get the value as string.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Mask.
Definition CameraState.h:926
std::string ValueType
The type of the underlying value.
Definition CameraState.h:923
static constexpr const char * path
The full path for this value.
Definition CameraState.h:912
const std::string & value() const
Get the value.
An IPv4 subnet that the local network interface is connected to.
Definition CameraState.h:792
std::string toString() const
Get the value as string.
static constexpr const char * path
The full path for this value.
Definition CameraState.h:798
Subnet copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:1088
const Mask & mask() const
Get Mask.
Definition CameraState.h:1128
static constexpr const char * name
The name of this value.
Definition CameraState.h:801
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1053
const CameraState::Network::LocalInterface::IPV4::Subnet::Address & get() const
Definition CameraState.h:1151
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:795
bool operator!=(const Subnet &other) const
Inequality operator.
Mask & mask()
Get Mask.
Definition CameraState.h:1134
std::tuple< CameraState::Network::LocalInterface::IPV4::Subnet::Address, CameraState::Network::LocalInterface::IPV4::Subnet::Mask > Descendants
Definition CameraState.h:995
bool operator==(const Subnet &other) const
Equality operator.
static constexpr const char * description
The description for this value.
Definition CameraState.h:804
friend std::ostream & operator<<(std::ostream &stream, const Subnet &value)
Operator to send the value as string to a stream.
Definition CameraState.h:1204
const CameraState::Network::LocalInterface::IPV4::Subnet::Mask & get() const
Definition CameraState.h:1161
const Address & address() const
Get Address.
Definition CameraState.h:1109
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1188
Subnet & set(const Address &value)
Set Address.
Definition CameraState.h:1121
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1180
Subnet & set(const Mask &value)
Set Mask.
Definition CameraState.h:1140
Address & address()
Get Address.
Definition CameraState.h:1115
List of IPv4 addresses and subnet masks that the interface is configured with. This list can contain ...
Definition CameraState.h:1229
CameraState::Network::LocalInterface::IPV4::Subnet & operator[](std::size_t pos)
Returns a reference to the element at position pos in the list.
static constexpr const char * description
The description for this value.
Definition CameraState.h:1241
void emplaceBack(Args &&...args)
Appends a new element to the end of the list.
Definition CameraState.h:1289
bool operator!=(const Subnets &other) const
Comparison operator.
Definition CameraState.h:1374
bool isEmpty() const noexcept
Check if the list is empty.
std::vector< CameraState::Network::LocalInterface::IPV4::Subnet > ValueType
The type of the underlying value.
Definition CameraState.h:1249
Subnets(std::vector< CameraState::Network::LocalInterface::IPV4::Subnet > value)
Constructor.
Definition CameraState.h:1261
std::string toString() const
Get the value as string.
const CameraState::Network::LocalInterface::IPV4::Subnet & at(std::size_t pos) const
Returns a const reference to the element at position pos in the list.
Subnets(std::initializer_list< CameraState::Network::LocalInterface::IPV4::Subnet > value)
Constructor.
Definition CameraState.h:1266
void forEach(const F &f)
Run the given function on each element in the list.
Definition CameraState.h:1324
friend std::ostream & operator<<(std::ostream &stream, const Subnets &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1380
std::vector< CameraState::Network::LocalInterface::IPV4::Subnet >::const_iterator ConstIterator
Constant iterator type for Subnets.
Definition CameraState.h:1352
static constexpr const char * name
The name of this value.
Definition CameraState.h:1238
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:1232
Iterator end() noexcept
Returns an iterator to the element following the last element of the list.
ConstIterator cbegin() const noexcept
Returns a constant iterator to the first element of the list.
std::size_t size() const noexcept
Get the size of the list.
CameraState::Network::LocalInterface::IPV4::Subnet & at(std::size_t pos)
Returns a reference to the element at position pos in the list.
const CameraState::Network::LocalInterface::IPV4::Subnet & operator[](std::size_t pos) const
Returns a const reference to the element at position pos in the list.
static constexpr const char * path
The full path for this value.
Definition CameraState.h:1235
std::vector< CameraState::Network::LocalInterface::IPV4::Subnet >::iterator Iterator
Iterator type for Subnets.
Definition CameraState.h:1343
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Subnets.
Definition CameraState.h:1252
ConstIterator cend() const noexcept
Returns a constant iterator to the element following the last element of the list.
void forEach(const F &f) const
Run the given function on each element in the list.
Definition CameraState.h:1334
const std::vector< CameraState::Network::LocalInterface::IPV4::Subnet > & value() const
Get the value.
Iterator begin() noexcept
Returns an iterator to the first element of the list.
Current IPv4 protocol state of the computer's local network interface.
Definition CameraState.h:771
static constexpr const char * path
The full path for this value.
Definition CameraState.h:777
const Subnets & subnets() const
Get Subnets.
Definition CameraState.h:1502
IPV4 copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:1481
const CameraState::Network::LocalInterface::IPV4::Subnets & get() const
Definition CameraState.h:1525
std::tuple< CameraState::Network::LocalInterface::IPV4::Subnets > Descendants
Definition CameraState.h:1393
friend std::ostream & operator<<(std::ostream &stream, const IPV4 &value)
Operator to send the value as string to a stream.
Definition CameraState.h:1560
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:774
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1538
bool operator!=(const IPV4 &other) const
Inequality operator.
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1447
static constexpr const char * description
The description for this value.
Definition CameraState.h:783
bool operator==(const IPV4 &other) const
Equality operator.
std::string toString() const
Get the value as string.
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1545
IPV4 & set(const Subnets &value)
Set Subnets.
Definition CameraState.h:1514
Subnets & subnets()
Get Subnets.
Definition CameraState.h:1508
static constexpr const char * name
The name of this value.
Definition CameraState.h:780
Name of the computer's local network interface.
Definition CameraState.h:1581
bool operator==(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1621
std::string ValueType
The type of the underlying value.
Definition CameraState.h:1598
const std::string & value() const
Get the value.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for InterfaceName.
Definition CameraState.h:1601
InterfaceName(std::string value)
Constructor.
Definition CameraState.h:1610
bool operator<=(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1645
friend std::ostream & operator<<(std::ostream &stream, const InterfaceName &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1657
bool operator>(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1639
bool operator<(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1633
static constexpr const char * path
The full path for this value.
Definition CameraState.h:1587
std::string toString() const
Get the value as string.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:1584
bool operator!=(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1627
bool operator>=(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1651
static constexpr const char * name
The name of this value.
Definition CameraState.h:1590
static constexpr const char * description
The description for this value.
Definition CameraState.h:1593
Current state of the computer's local network interface.
Definition CameraState.h:405
const CameraState::Network::LocalInterface::IPV4::Subnets & get() const
Definition CameraState.h:1899
static constexpr const char * path
The full path for this value.
Definition CameraState.h:411
const CameraState::Network::LocalInterface::Ethernet & get() const
Definition CameraState.h:1870
Ethernet & ethernet()
Get Ethernet.
Definition CameraState.h:1801
const CameraState::Network::LocalInterface::Ethernet::LinkSpeed & get() const
Definition CameraState.h:1880
bool operator!=(const LocalInterface &other) const
Inequality operator.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:408
InterfaceName & interfaceName()
Get InterfaceName.
Definition CameraState.h:1853
bool operator==(const LocalInterface &other) const
Equality operator.
LocalInterface & set(const IPV4::Subnets &value)
Set IPV4::Subnets.
Definition CameraState.h:1840
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1943
LocalInterface copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:1774
std::string toString() const
Get the value as string.
const InterfaceName & interfaceName() const
Get InterfaceName.
Definition CameraState.h:1847
const Ethernet & ethernet() const
Get Ethernet.
Definition CameraState.h:1795
const IPV4 & ipv4() const
Get IPV4.
Definition CameraState.h:1821
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1934
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1737
friend std::ostream & operator<<(std::ostream &stream, const LocalInterface &value)
Operator to send the value as string to a stream.
Definition CameraState.h:1960
const CameraState::Network::LocalInterface::IPV4 & get() const
Definition CameraState.h:1889
LocalInterface & set(const Ethernet &value)
Set Ethernet.
Definition CameraState.h:1807
static constexpr const char * description
The description for this value.
Definition CameraState.h:417
LocalInterface & set(const Ethernet::LinkSpeed &value)
Set Ethernet::LinkSpeed.
Definition CameraState.h:1814
LocalInterface & set(const InterfaceName &value)
Set InterfaceName.
Definition CameraState.h:1859
static constexpr const char * name
The name of this value.
Definition CameraState.h:414
std::tuple< CameraState::Network::LocalInterface::Ethernet, CameraState::Network::LocalInterface::Ethernet::LinkSpeed, CameraState::Network::LocalInterface::IPV4, CameraState::Network::LocalInterface::IPV4::Subnets, CameraState::Network::LocalInterface::InterfaceName > Descendants
Definition CameraState.h:1670
IPV4 & ipv4()
Get IPV4.
Definition CameraState.h:1827
const CameraState::Network::LocalInterface::InterfaceName & get() const
Definition CameraState.h:1909
LocalInterface & set(const IPV4 &value)
Set IPV4.
Definition CameraState.h:1833
List of the computer's local network interfaces that discovered the camera. In the most common scenar...
Definition CameraState.h:2713
std::vector< CameraState::Network::LocalInterface >::iterator Iterator
Iterator type for LocalInterfaces.
Definition CameraState.h:2829
bool operator!=(const LocalInterfaces &other) const
Comparison operator.
Definition CameraState.h:2859
bool isEmpty() const noexcept
Check if the list is empty.
const std::vector< CameraState::Network::LocalInterface > & value() const
Get the value.
ConstIterator cbegin() const noexcept
Returns a constant iterator to the first element of the list.
CameraState::Network::LocalInterface & operator[](std::size_t pos)
Returns a reference to the element at position pos in the list.
std::string toString() const
Get the value as string.
LocalInterfaces()=default
Default constructor.
static constexpr const char * description
The description for this value.
Definition CameraState.h:2725
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2716
Iterator end() noexcept
Returns an iterator to the element following the last element of the list.
std::vector< CameraState::Network::LocalInterface > ValueType
The type of the underlying value.
Definition CameraState.h:2736
LocalInterfaces(std::initializer_list< CameraState::Network::LocalInterface > value)
Constructor.
Definition CameraState.h:2753
const CameraState::Network::LocalInterface & operator[](std::size_t pos) const
Returns a const reference to the element at position pos in the list.
void emplaceBack(Args &&...args)
Appends a new element to the end of the list.
Definition CameraState.h:2775
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for LocalInterfaces.
Definition CameraState.h:2739
Iterator begin() noexcept
Returns an iterator to the first element of the list.
const CameraState::Network::LocalInterface & at(std::size_t pos) const
Returns a const reference to the element at position pos in the list.
LocalInterfaces(std::vector< CameraState::Network::LocalInterface > value)
Constructor.
Definition CameraState.h:2748
ConstIterator cend() const noexcept
Returns a constant iterator to the element following the last element of the list.
void forEach(const F &f) const
Run the given function on each element in the list.
Definition CameraState.h:2820
std::vector< CameraState::Network::LocalInterface >::const_iterator ConstIterator
Constant iterator type for LocalInterfaces.
Definition CameraState.h:2838
static constexpr const char * name
The name of this value.
Definition CameraState.h:2722
void forEach(const F &f)
Run the given function on each element in the list.
Definition CameraState.h:2810
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2719
CameraState::Network::LocalInterface & at(std::size_t pos)
Returns a reference to the element at position pos in the list.
std::size_t size() const noexcept
Get the size of the list.
friend std::ostream & operator<<(std::ostream &stream, const LocalInterfaces &value)
Operator to serialize the value to a stream.
Definition CameraState.h:2865
Current network state.
Definition CameraState.h:386
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:2948
const LocalInterfaces & localInterfaces() const
Get LocalInterfaces.
Definition CameraState.h:3076
Network & set(const Ethernet::LinkSpeed &value)
Set Ethernet::LinkSpeed.
Definition CameraState.h:3024
Hostname & hostname()
Get Hostname.
Definition CameraState.h:3037
static constexpr const char * path
The full path for this value.
Definition CameraState.h:392
std::string toString() const
Get the value as string.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:389
friend std::ostream & operator<<(std::ostream &stream, const Network &value)
Operator to send the value as string to a stream.
Definition CameraState.h:3197
Network & set(const Ethernet &value)
Set Ethernet.
Definition CameraState.h:3017
const Ethernet & ethernet() const
Get Ethernet.
Definition CameraState.h:3005
const CameraState::Network::Ethernet & get() const
Definition CameraState.h:3097
std::tuple< CameraState::Network::Ethernet, CameraState::Network::Ethernet::LinkSpeed, CameraState::Network::Hostname, CameraState::Network::IPV4, CameraState::Network::IPV4::Address, CameraState::Network::LocalInterfaces > Descendants
Definition CameraState.h:2878
const Hostname & hostname() const
Get Hostname.
Definition CameraState.h:3031
const CameraState::Network::LocalInterfaces & get() const
Definition CameraState.h:3138
const CameraState::Network::Ethernet::LinkSpeed & get() const
Definition CameraState.h:3106
const CameraState::Network::Hostname & get() const
Definition CameraState.h:3114
Ethernet & ethernet()
Get Ethernet.
Definition CameraState.h:3011
bool operator==(const Network &other) const
Equality operator.
LocalInterfaces & localInterfaces()
Get LocalInterfaces.
Definition CameraState.h:3082
static constexpr const char * description
The description for this value.
Definition CameraState.h:398
Network()
Default constructor.
Network & set(const IPV4 &value)
Set IPV4.
Definition CameraState.h:3062
Network copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:2985
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:3130
Network & set(const LocalInterfaces &value)
Set LocalInterfaces.
Definition CameraState.h:3088
const CameraState::Network::IPV4 & get() const
Definition CameraState.h:3122
Network & set(const IPV4::Address &value)
Set IPV4::Address.
Definition CameraState.h:3069
static constexpr const char * name
The name of this value.
Definition CameraState.h:395
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:3179
IPV4 & ipv4()
Get IPV4.
Definition CameraState.h:3056
bool operator!=(const Network &other) const
Inequality operator.
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:3169
const IPV4 & ipv4() const
Get IPV4.
Definition CameraState.h:3050
Network & set(const Hostname &value)
Set Hostname.
Definition CameraState.h:3043
This enum describes the current status of this camera. The enum can have the following values:
Definition CameraState.h:3254
constexpr Status(ValueType value)
Constructor.
Definition CameraState.h:3347
static std::set< ValueType > validValues()
All valid values of Status.
Definition CameraState.h:3329
static const Status connected
connected
Definition CameraState.h:3324
static const Status disconnecting
disconnecting
Definition CameraState.h:3325
static const Status inaccessible
inaccessible
Definition CameraState.h:3317
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition CameraState.h:3305
@ connected
Definition CameraState.h:3313
@ disconnecting
Definition CameraState.h:3314
@ firmwareUpdateRequired
Definition CameraState.h:3309
@ updatingFirmware
Definition CameraState.h:3310
@ inaccessible
Definition CameraState.h:3306
@ busy
Definition CameraState.h:3307
@ connecting
Definition CameraState.h:3312
@ disappeared
Definition CameraState.h:3315
@ available
Definition CameraState.h:3311
@ applyingNetworkConfiguration
Definition CameraState.h:3308
static const Status applyingNetworkConfiguration
applyingNetworkConfiguration
Definition CameraState.h:3319
friend std::ostream & operator<<(std::ostream &stream, const Status &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3376
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3257
static const Status firmwareUpdateRequired
firmwareUpdateRequired
Definition CameraState.h:3320
ValueType value() const
Get the value.
bool operator!=(const Status &other) const
Comparison operator.
Definition CameraState.h:3370
static const Status connecting
connecting
Definition CameraState.h:3323
bool operator==(const Status &other) const
Comparison operator.
Definition CameraState.h:3364
static const Status busy
busy
Definition CameraState.h:3318
Status()=default
Default constructor.
static const Status available
available
Definition CameraState.h:3322
static const Status updatingFirmware
updatingFirmware
Definition CameraState.h:3321
static constexpr const char * description
The description for this value.
Definition CameraState.h:3266
static const Status disappeared
disappeared
Definition CameraState.h:3326
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3260
static constexpr const char * name
The name of this value.
Definition CameraState.h:3263
friend std::ostream & operator<<(std::ostream &stream, const Status::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:3358
DMD temperature.
Definition CameraState.h:3426
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3429
bool operator>(const DMD &other) const
Comparison operator.
Definition CameraState.h:3482
std::string toString() const
Get the value as string.
static constexpr const char * description
The description for this value.
Definition CameraState.h:3438
double value() const
Get the value.
bool operator!=(const DMD &other) const
Comparison operator.
Definition CameraState.h:3470
bool operator<(const DMD &other) const
Comparison operator.
Definition CameraState.h:3476
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3432
bool operator>=(const DMD &other) const
Comparison operator.
Definition CameraState.h:3494
double ValueType
The type of the underlying value.
Definition CameraState.h:3441
bool operator<=(const DMD &other) const
Comparison operator.
Definition CameraState.h:3488
friend std::ostream & operator<<(std::ostream &stream, const DMD &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3500
constexpr DMD(double value)
Constructor.
Definition CameraState.h:3453
bool operator==(const DMD &other) const
Comparison operator.
Definition CameraState.h:3464
static constexpr const char * name
The name of this value.
Definition CameraState.h:3435
static constexpr Range< double > validRange()
The range of valid values for DMD.
Definition CameraState.h:3444
DMD()=default
Default constructor.
General temperature.
Definition CameraState.h:3517
double ValueType
The type of the underlying value.
Definition CameraState.h:3532
static constexpr const char * name
The name of this value.
Definition CameraState.h:3526
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3520
std::string toString() const
Get the value as string.
double value() const
Get the value.
bool operator<(const General &other) const
Comparison operator.
Definition CameraState.h:3567
constexpr General(double value)
Constructor.
Definition CameraState.h:3544
static constexpr Range< double > validRange()
The range of valid values for General.
Definition CameraState.h:3535
bool operator==(const General &other) const
Comparison operator.
Definition CameraState.h:3555
General()=default
Default constructor.
bool operator<=(const General &other) const
Comparison operator.
Definition CameraState.h:3579
bool operator!=(const General &other) const
Comparison operator.
Definition CameraState.h:3561
bool operator>(const General &other) const
Comparison operator.
Definition CameraState.h:3573
static constexpr const char * description
The description for this value.
Definition CameraState.h:3529
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3523
friend std::ostream & operator<<(std::ostream &stream, const General &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3591
bool operator>=(const General &other) const
Comparison operator.
Definition CameraState.h:3585
LED temperature.
Definition CameraState.h:3608
bool operator<=(const LED &other) const
Comparison operator.
Definition CameraState.h:3670
std::string toString() const
Get the value as string.
bool operator<(const LED &other) const
Comparison operator.
Definition CameraState.h:3658
double value() const
Get the value.
LED()=default
Default constructor.
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3614
constexpr LED(double value)
Constructor.
Definition CameraState.h:3635
friend std::ostream & operator<<(std::ostream &stream, const LED &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3682
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3611
static constexpr const char * name
The name of this value.
Definition CameraState.h:3617
bool operator!=(const LED &other) const
Comparison operator.
Definition CameraState.h:3652
bool operator==(const LED &other) const
Comparison operator.
Definition CameraState.h:3646
bool operator>=(const LED &other) const
Comparison operator.
Definition CameraState.h:3676
bool operator>(const LED &other) const
Comparison operator.
Definition CameraState.h:3664
static constexpr const char * description
The description for this value.
Definition CameraState.h:3620
static constexpr Range< double > validRange()
The range of valid values for LED.
Definition CameraState.h:3626
double ValueType
The type of the underlying value.
Definition CameraState.h:3623
Lens temperature.
Definition CameraState.h:3699
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3702
double ValueType
The type of the underlying value.
Definition CameraState.h:3714
static constexpr const char * name
The name of this value.
Definition CameraState.h:3708
bool operator==(const Lens &other) const
Comparison operator.
Definition CameraState.h:3737
Lens()=default
Default constructor.
bool operator<=(const Lens &other) const
Comparison operator.
Definition CameraState.h:3761
double value() const
Get the value.
bool operator>(const Lens &other) const
Comparison operator.
Definition CameraState.h:3755
bool operator!=(const Lens &other) const
Comparison operator.
Definition CameraState.h:3743
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3705
bool operator>=(const Lens &other) const
Comparison operator.
Definition CameraState.h:3767
static constexpr const char * description
The description for this value.
Definition CameraState.h:3711
std::string toString() const
Get the value as string.
constexpr Lens(double value)
Constructor.
Definition CameraState.h:3726
static constexpr Range< double > validRange()
The range of valid values for Lens.
Definition CameraState.h:3717
bool operator<(const Lens &other) const
Comparison operator.
Definition CameraState.h:3749
friend std::ostream & operator<<(std::ostream &stream, const Lens &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3773
PCB temperature.
Definition CameraState.h:3790
bool operator!=(const PCB &other) const
Comparison operator.
Definition CameraState.h:3834
constexpr PCB(double value)
Constructor.
Definition CameraState.h:3817
static constexpr Range< double > validRange()
The range of valid values for PCB.
Definition CameraState.h:3808
bool operator>=(const PCB &other) const
Comparison operator.
Definition CameraState.h:3858
PCB()=default
Default constructor.
bool operator<=(const PCB &other) const
Comparison operator.
Definition CameraState.h:3852
friend std::ostream & operator<<(std::ostream &stream, const PCB &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3864
static constexpr const char * name
The name of this value.
Definition CameraState.h:3799
bool operator==(const PCB &other) const
Comparison operator.
Definition CameraState.h:3828
static constexpr const char * description
The description for this value.
Definition CameraState.h:3802
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3796
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3793
double value() const
Get the value.
bool operator>(const PCB &other) const
Comparison operator.
Definition CameraState.h:3846
double ValueType
The type of the underlying value.
Definition CameraState.h:3805
std::string toString() const
Get the value as string.
bool operator<(const PCB &other) const
Comparison operator.
Definition CameraState.h:3840
Current temperature(s)
Definition CameraState.h:3408
DMD & dmd()
Get DMD.
Definition CameraState.h:4006
Temperature & set(const General &value)
Set General.
Definition CameraState.h:4031
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3411
const PCB & pcb() const
Get PCB.
Definition CameraState.h:4076
const CameraState::Temperature::Lens & get() const
Definition CameraState.h:4121
static constexpr const char * name
The name of this value.
Definition CameraState.h:3417
Temperature & set(const Lens &value)
Set Lens.
Definition CameraState.h:4069
const CameraState::Temperature::DMD & get() const
Definition CameraState.h:4097
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3414
const CameraState::Temperature::PCB & get() const
Definition CameraState.h:4129
const CameraState::Temperature::General & get() const
Definition CameraState.h:4105
Temperature & set(const PCB &value)
Set PCB.
Definition CameraState.h:4088
const General & general() const
Get General.
Definition CameraState.h:4019
bool operator!=(const Temperature &other) const
Inequality operator.
const LED & led() const
Get LED.
Definition CameraState.h:4038
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:4166
friend std::ostream & operator<<(std::ostream &stream, const Temperature &value)
Operator to send the value as string to a stream.
Definition CameraState.h:4196
Temperature & set(const LED &value)
Set LED.
Definition CameraState.h:4050
std::string toString() const
Get the value as string.
LED & led()
Get LED.
Definition CameraState.h:4044
bool operator==(const Temperature &other) const
Equality operator.
const Lens & lens() const
Get Lens.
Definition CameraState.h:4057
Temperature copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:3980
General & general()
Get General.
Definition CameraState.h:4025
std::tuple< CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition CameraState.h:3877
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:3944
const DMD & dmd() const
Get DMD.
Definition CameraState.h:4000
static constexpr const char * description
The description for this value.
Definition CameraState.h:3420
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:4177
const CameraState::Temperature::LED & get() const
Definition CameraState.h:4113
Lens & lens()
Get Lens.
Definition CameraState.h:4063
Temperature()
Default constructor.
Temperature & set(const DMD &value)
Set DMD.
Definition CameraState.h:4012
PCB & pcb()
Get PCB.
Definition CameraState.h:4082
Information about camera connection state, temperatures, etc.
Definition CameraState.h:79
CameraState & set(const Network::Ethernet::LinkSpeed &value)
Set Network::Ethernet::LinkSpeed.
Definition CameraState.h:4486
const Temperature & temperature() const
Get Temperature.
Definition CameraState.h:4540
CameraState copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:4384
const CameraState::Network::IPV4 & get() const
Definition CameraState.h:4644
const CameraState::Temperature::Lens & get() const
Definition CameraState.h:4704
void load(const std::string &fileName)
Load from the given file.
CameraState(const std::string &fileName)
Construct CameraState by loading from file.
std::string serialize() const
Serialize to a string.
CameraState & set(const Temperature &value)
Set Temperature.
Definition CameraState.h:4552
static constexpr const char * description
The description for this value.
Definition CameraState.h:91
const CameraState::Connected & get() const
Definition CameraState.h:4600
Temperature & temperature()
Get Temperature.
Definition CameraState.h:4546
const CameraState::Temperature::General & get() const
Definition CameraState.h:4688
std::string toString() const
Get the value as string.
CameraState & set(const Network &value)
Set Network.
Definition CameraState.h:4472
const CameraState::Status & get() const
Definition CameraState.h:4666
const CameraState::InaccessibleReason & get() const
Definition CameraState.h:4608
CameraState & set(const Network::Hostname &value)
Set Network::Hostname.
Definition CameraState.h:4493
const CameraState::Available & get() const
Definition CameraState.h:4594
const CameraState::Network::Ethernet::LinkSpeed & get() const
Definition CameraState.h:4630
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:4652
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:4767
void save(const std::string &fileName) const
Save to the given file.
const CameraState::Network & get() const
Definition CameraState.h:4614
const CameraState::Temperature::PCB & get() const
Definition CameraState.h:4712
CameraState & set(const Temperature::PCB &value)
Set Temperature::PCB.
Definition CameraState.h:4587
const InaccessibleReason & inaccessibleReason() const
Get InaccessibleReason.
Definition CameraState.h:4441
const CameraState::Temperature::LED & get() const
Definition CameraState.h:4696
static constexpr size_t version
Definition CameraState.h:95
CameraState & set(const Temperature::General &value)
Set Temperature::General.
Definition CameraState.h:4566
friend std::ostream & operator<<(std::ostream &stream, const CameraState &value)
Operator to send the value as string to a stream.
Definition CameraState.h:4787
bool operator!=(const CameraState &other) const
Inequality operator.
CameraState & set(const Network::IPV4 &value)
Set Network::IPV4.
Definition CameraState.h:4500
CameraState & set(const Network::IPV4::Address &value)
Set Network::IPV4::Address.
Definition CameraState.h:4507
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:82
Status & status()
Get Status.
Definition CameraState.h:4527
const Available & isAvailable() const
Get Available.
Definition CameraState.h:4403
const Status & status() const
Get Status.
Definition CameraState.h:4521
const CameraState::Network::LocalInterfaces & get() const
Definition CameraState.h:4660
Connected & isConnected()
Get Connected.
Definition CameraState.h:4428
CameraState & set(const Temperature::Lens &value)
Set Temperature::Lens.
Definition CameraState.h:4580
CameraState & set(const Available &value)
Set Available.
Definition CameraState.h:4415
CameraState & set(const Temperature::DMD &value)
Set Temperature::DMD.
Definition CameraState.h:4559
static constexpr const char * path
The full path for this value.
Definition CameraState.h:85
bool operator==(const CameraState &other) const
Equality operator.
CameraState()
Default constructor.
const CameraState::Network::Hostname & get() const
Definition CameraState.h:4638
CameraState & set(const Status &value)
Set Status.
Definition CameraState.h:4533
CameraState & set(const InaccessibleReason &value)
Set InaccessibleReason.
Definition CameraState.h:4453
CameraState & set(const Connected &value)
Set Connected.
Definition CameraState.h:4434
Network & network()
Get Network.
Definition CameraState.h:4466
static constexpr const char * name
The name of this value.
Definition CameraState.h:88
CameraState(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraState.h:4293
const CameraState::Temperature & get() const
Definition CameraState.h:4672
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:4755
static CameraState fromSerialized(const std::string &value)
Construct a new CameraState instance from a previously serialized string.
std::tuple< CameraState::Available, CameraState::Connected, CameraState::InaccessibleReason, CameraState::Network, CameraState::Network::Ethernet, CameraState::Network::Ethernet::LinkSpeed, CameraState::Network::Hostname, CameraState::Network::IPV4, CameraState::Network::IPV4::Address, CameraState::Network::LocalInterfaces, CameraState::Status, CameraState::Temperature, CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition CameraState.h:4217
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:4336
const CameraState::Network::Ethernet & get() const
Definition CameraState.h:4622
InaccessibleReason & inaccessibleReason()
Get InaccessibleReason.
Definition CameraState.h:4447
CameraState & set(const Network::Ethernet &value)
Set Network::Ethernet.
Definition CameraState.h:4479
CameraState & set(const Temperature::LED &value)
Set Temperature::LED.
Definition CameraState.h:4573
const CameraState::Temperature::DMD & get() const
Definition CameraState.h:4680
const Network & network() const
Get Network.
Definition CameraState.h:4460
const Connected & isConnected() const
Get Connected.
Definition CameraState.h:4422
Available & isAvailable()
Get Available.
Definition CameraState.h:4409
CameraState & set(const Network::LocalInterfaces &value)
Set Network::LocalInterfaces.
Definition CameraState.h:4514
Class describing a range of values for a given type T.
Definition Range.h:75
NodeType
Definition NodeType.h:49
@ leafDataModelList
Definition NodeType.h:51
@ leafValue
Definition NodeType.h:52
@ group
Definition NodeType.h:50
Definition EnvironmentInfo.h:74
Get version information for the library.
Definition Version.h:58
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:85