Zivid C++ API 2.17.1+7516d437-1
CameraState.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2025 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <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{ 8 };
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/IPV4" };
433
435 static constexpr const char *name{ "IPV4" };
436
438 static constexpr const char *description{
439 R"description(Current IPv4 protocol state of the computer's local network interface.)description"
440 };
441
444
445 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
447 {
448 public:
451
453 static constexpr const char *path{ "Network/LocalInterface/IPV4/Subnet" };
454
456 static constexpr const char *name{ "Subnet" };
457
459 static constexpr const char *description{
460 R"description(An IPv4 subnet that the local network interface is connected to.
461)description"
462 };
463
465
466 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
468 {
469 public:
472
474 static constexpr const char *path{ "Network/LocalInterface/IPV4/Subnet/Address" };
475
477 static constexpr const char *name{ "Address" };
478
480 static constexpr const char *description{
481 R"description(IP address of the computer's local network interface.)description"
482 };
483
485 using ValueType = std::string;
486
489 {
490 return { 0, std::numeric_limits<ValueType::size_type>::max() };
491 }
492
494 Address() = default;
495
497 explicit Address(std::string value)
498 : m_value{ std::move(value) }
499 {}
500
502 const std::string &value() const;
503
505 std::string toString() const;
506
508 bool operator==(const Address &other) const
509 {
510 return m_value == other.m_value;
511 }
512
514 bool operator!=(const Address &other) const
515 {
516 return m_value != other.m_value;
517 }
518
520 bool operator<(const Address &other) const
521 {
522 return m_value < other.m_value;
523 }
524
526 bool operator>(const Address &other) const
527 {
528 return m_value > other.m_value;
529 }
530
532 bool operator<=(const Address &other) const
533 {
534 return m_value <= other.m_value;
535 }
536
538 bool operator>=(const Address &other) const
539 {
540 return m_value >= other.m_value;
541 }
542
544 friend std::ostream &operator<<(std::ostream &stream, const Address &value)
545 {
546 return stream << value.toString();
547 }
548
549 private:
550 void setFromString(const std::string &value);
551
552 std::string m_value{};
553
554 friend struct DataModel::Detail::Befriend<Address>;
555 };
556
558
559 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
561 {
562 public:
565
567 static constexpr const char *path{ "Network/LocalInterface/IPV4/Subnet/Mask" };
568
570 static constexpr const char *name{ "Mask" };
571
573 static constexpr const char *description{
574 R"description(Subnet mask of the computer's local network interface.)description"
575 };
576
578 using ValueType = std::string;
579
582 {
583 return { 0, std::numeric_limits<ValueType::size_type>::max() };
584 }
585
587 Mask() = default;
588
590 explicit Mask(std::string value)
591 : m_value{ std::move(value) }
592 {}
593
595 const std::string &value() const;
596
598 std::string toString() const;
599
601 bool operator==(const Mask &other) const
602 {
603 return m_value == other.m_value;
604 }
605
607 bool operator!=(const Mask &other) const
608 {
609 return m_value != other.m_value;
610 }
611
613 bool operator<(const Mask &other) const
614 {
615 return m_value < other.m_value;
616 }
617
619 bool operator>(const Mask &other) const
620 {
621 return m_value > other.m_value;
622 }
623
625 bool operator<=(const Mask &other) const
626 {
627 return m_value <= other.m_value;
628 }
629
631 bool operator>=(const Mask &other) const
632 {
633 return m_value >= other.m_value;
634 }
635
637 friend std::ostream &operator<<(std::ostream &stream, const Mask &value)
638 {
639 return stream << value.toString();
640 }
641
642 private:
643 void setFromString(const std::string &value);
644
645 std::string m_value{};
646
647 friend struct DataModel::Detail::Befriend<Mask>;
648 };
649
650 using Descendants = std::tuple<
653
656
669#ifndef NO_DOC
670 template<
671 typename... Args,
672 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
673 typename std::enable_if<
674 Zivid::Detail::TypeTraits::
675 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
676 int>::type = 0>
677#else
678 template<typename... Args>
679#endif
680 explicit Subnet(Args &&...args)
681 {
682 using namespace Zivid::Detail::TypeTraits;
683
684 static_assert(
685 AllArgsDecayedAreUnique<Args...>::value,
686 "Found duplicate types among the arguments passed to Subnet(...). "
687 "Types should be listed at most once.");
688
689 set(std::forward<Args>(args)...);
690 }
691
703#ifndef NO_DOC
704 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
705#else
706 template<typename... Args>
707#endif
708 void set(Args &&...args)
709 {
710 using namespace Zivid::Detail::TypeTraits;
711
712 using AllArgsAreDescendantNodes =
713 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
714 static_assert(
715 AllArgsAreDescendantNodes::value,
716 "All arguments passed to set(...) must be descendant nodes.");
717
718 static_assert(
719 AllArgsDecayedAreUnique<Args...>::value,
720 "Found duplicate types among the arguments passed to set(...). "
721 "Types should be listed at most once.");
722
723 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
724 }
725
738#ifndef NO_DOC
739 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
740#else
741 template<typename... Args>
742#endif
743 Subnet copyWith(Args &&...args) const
744 {
745 using namespace Zivid::Detail::TypeTraits;
746
747 using AllArgsAreDescendantNodes =
748 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
749 static_assert(
750 AllArgsAreDescendantNodes::value,
751 "All arguments passed to copyWith(...) must be descendant nodes.");
752
753 static_assert(
754 AllArgsDecayedAreUnique<Args...>::value,
755 "Found duplicate types among the arguments passed to copyWith(...). "
756 "Types should be listed at most once.");
757
758 auto copy{ *this };
759 copy.set(std::forward<Args>(args)...);
760 return copy;
761 }
762
764 const Address &address() const
765 {
766 return m_address;
767 }
768
771 {
772 return m_address;
773 }
774
776 Subnet &set(const Address &value)
777 {
778 m_address = value;
779 return *this;
780 }
781
783 const Mask &mask() const
784 {
785 return m_mask;
786 }
787
790 {
791 return m_mask;
792 }
793
795 Subnet &set(const Mask &value)
796 {
797 m_mask = value;
798 return *this;
799 }
800
801 template<
802 typename T,
803 typename std::enable_if<
804 std::is_same<T, CameraState::Network::LocalInterface::IPV4::Subnet::Address>::value,
805 int>::type = 0>
807 {
808 return m_address;
809 }
810
811 template<
812 typename T,
813 typename std::enable_if<
814 std::is_same<T, CameraState::Network::LocalInterface::IPV4::Subnet::Mask>::value,
815 int>::type = 0>
817 {
818 return m_mask;
819 }
820
821 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
823 {
824 return m_address;
825 }
826
827 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
829 {
830 return m_mask;
831 }
832
834 template<typename F>
835 void forEach(const F &f) const
836 {
837 f(m_address);
838 f(m_mask);
839 }
840
842 template<typename F>
843 void forEach(const F &f)
844 {
845 f(m_address);
846 f(m_mask);
847 }
848
850 bool operator==(const Subnet &other) const;
851
853 bool operator!=(const Subnet &other) const;
854
856 std::string toString() const;
857
859 friend std::ostream &operator<<(std::ostream &stream, const Subnet &value)
860 {
861 return stream << value.toString();
862 }
863
864 private:
865 void setFromString(const std::string &value);
866
867 void setFromString(const std::string &fullPath, const std::string &value);
868
869 std::string getString(const std::string &fullPath) const;
870
871 Address m_address;
872 Mask m_mask;
873
874 friend struct DataModel::Detail::Befriend<Subnet>;
875 };
876
881
882 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
884 {
885 public:
888
890 static constexpr const char *path{ "Network/LocalInterface/IPV4/Subnets" };
891
893 static constexpr const char *name{ "Subnets" };
894
896 static constexpr const char *description{
897 R"description(List of IPv4 addresses and subnet masks that the interface is configured with. This list can
898contain multiple entries if the local network interface is configured with multiple IPv4
899addresses.
900)description"
901 };
902
904 using ValueType = std::vector<CameraState::Network::LocalInterface::IPV4::Subnet>;
905
908 {
909 return { 0, std::numeric_limits<ValueType::size_type>::max() };
910 }
911
913 Subnets() = default;
914
916 explicit Subnets(std::vector<CameraState::Network::LocalInterface::IPV4::Subnet> value)
917 : m_value{ std::move(value) }
918 {}
919
921 explicit Subnets(
922 std::initializer_list<CameraState::Network::LocalInterface::IPV4::Subnet> value)
923 : Subnets{ ValueType{ value } }
924 {}
925
927 const std::vector<CameraState::Network::LocalInterface::IPV4::Subnet> &value() const;
928
930 std::string toString() const;
931
933 std::size_t size() const noexcept;
934
936 bool isEmpty() const noexcept;
937
943 template<typename... Args>
944 void emplaceBack(Args &&...args)
945 {
946 m_value.emplace_back(std::forward<Args>(args)...);
947 }
948
955
962
969
976
978 template<typename F>
979 void forEach(const F &f)
980 {
981 for(auto &child : m_value)
982 {
983 f(child);
984 }
985 }
986
988 template<typename F>
989 void forEach(const F &f) const
990 {
991 for(const auto &child : m_value)
992 {
993 f(child);
994 }
995 }
996
998 using Iterator = std::vector<CameraState::Network::LocalInterface::IPV4::Subnet>::iterator;
999
1001 Iterator begin() noexcept;
1002
1004 Iterator end() noexcept;
1005
1008 std::vector<CameraState::Network::LocalInterface::IPV4::Subnet>::const_iterator;
1009
1011 ConstIterator begin() const noexcept;
1012
1014 ConstIterator end() const noexcept;
1015
1017 ConstIterator cbegin() const noexcept;
1018
1020 ConstIterator cend() const noexcept;
1021
1023 bool operator==(const Subnets &other) const
1024 {
1025 return m_value == other.m_value;
1026 }
1027
1029 bool operator!=(const Subnets &other) const
1030 {
1031 return m_value != other.m_value;
1032 }
1033
1035 friend std::ostream &operator<<(std::ostream &stream, const Subnets &value)
1036 {
1037 return stream << value.toString();
1038 }
1039
1040 private:
1041 void setFromString(const std::string &value);
1042
1043 std::vector<CameraState::Network::LocalInterface::IPV4::Subnet> m_value{};
1044
1045 friend struct DataModel::Detail::Befriend<Subnets>;
1046 };
1047
1048 using Descendants = std::tuple<CameraState::Network::LocalInterface::IPV4::Subnets>;
1049
1052
1064#ifndef NO_DOC
1065 template<
1066 typename... Args,
1067 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1068 typename std::enable_if<
1069 Zivid::Detail::TypeTraits::
1070 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1071 int>::type = 0>
1072#else
1073 template<typename... Args>
1074#endif
1075 explicit IPV4(Args &&...args)
1076 {
1077 using namespace Zivid::Detail::TypeTraits;
1078
1079 static_assert(
1080 AllArgsDecayedAreUnique<Args...>::value,
1081 "Found duplicate types among the arguments passed to IPV4(...). "
1082 "Types should be listed at most once.");
1083
1084 set(std::forward<Args>(args)...);
1085 }
1086
1097#ifndef NO_DOC
1098 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1099#else
1100 template<typename... Args>
1101#endif
1102 void set(Args &&...args)
1103 {
1104 using namespace Zivid::Detail::TypeTraits;
1105
1106 using AllArgsAreDescendantNodes =
1107 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1108 static_assert(
1109 AllArgsAreDescendantNodes::value,
1110 "All arguments passed to set(...) must be descendant nodes.");
1111
1112 static_assert(
1113 AllArgsDecayedAreUnique<Args...>::value,
1114 "Found duplicate types among the arguments passed to set(...). "
1115 "Types should be listed at most once.");
1116
1117 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1118 }
1119
1131#ifndef NO_DOC
1132 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1133#else
1134 template<typename... Args>
1135#endif
1136 IPV4 copyWith(Args &&...args) const
1137 {
1138 using namespace Zivid::Detail::TypeTraits;
1139
1140 using AllArgsAreDescendantNodes =
1141 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1142 static_assert(
1143 AllArgsAreDescendantNodes::value,
1144 "All arguments passed to copyWith(...) must be descendant nodes.");
1145
1146 static_assert(
1147 AllArgsDecayedAreUnique<Args...>::value,
1148 "Found duplicate types among the arguments passed to copyWith(...). "
1149 "Types should be listed at most once.");
1150
1151 auto copy{ *this };
1152 copy.set(std::forward<Args>(args)...);
1153 return copy;
1154 }
1155
1157 const Subnets &subnets() const
1158 {
1159 return m_subnets;
1160 }
1161
1164 {
1165 return m_subnets;
1166 }
1167
1169 IPV4 &set(const Subnets &value)
1170 {
1171 m_subnets = value;
1172 return *this;
1173 }
1174
1175 template<
1176 typename T,
1177 typename std::enable_if<
1178 std::is_same<T, CameraState::Network::LocalInterface::IPV4::Subnets>::value,
1179 int>::type = 0>
1181 {
1182 return m_subnets;
1183 }
1184
1185 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1187 {
1188 return m_subnets;
1189 }
1190
1192 template<typename F>
1193 void forEach(const F &f) const
1194 {
1195 f(m_subnets);
1196 }
1197
1199 template<typename F>
1200 void forEach(const F &f)
1201 {
1202 f(m_subnets);
1203 }
1204
1206 bool operator==(const IPV4 &other) const;
1207
1209 bool operator!=(const IPV4 &other) const;
1210
1212 std::string toString() const;
1213
1215 friend std::ostream &operator<<(std::ostream &stream, const IPV4 &value)
1216 {
1217 return stream << value.toString();
1218 }
1219
1220 private:
1221 void setFromString(const std::string &value);
1222
1223 void setFromString(const std::string &fullPath, const std::string &value);
1224
1225 std::string getString(const std::string &fullPath) const;
1226
1227 Subnets m_subnets;
1228
1229 friend struct DataModel::Detail::Befriend<IPV4>;
1230 };
1231
1233
1234 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1236 {
1237 public:
1240
1242 static constexpr const char *path{ "Network/LocalInterface/InterfaceName" };
1243
1245 static constexpr const char *name{ "InterfaceName" };
1246
1248 static constexpr const char *description{
1249 R"description(Name of the computer's local network interface.)description"
1250 };
1251
1253 using ValueType = std::string;
1254
1257 {
1258 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1259 }
1260
1262 InterfaceName() = default;
1263
1265 explicit InterfaceName(std::string value)
1266 : m_value{ std::move(value) }
1267 {}
1268
1270 const std::string &value() const;
1271
1273 std::string toString() const;
1274
1276 bool operator==(const InterfaceName &other) const
1277 {
1278 return m_value == other.m_value;
1279 }
1280
1282 bool operator!=(const InterfaceName &other) const
1283 {
1284 return m_value != other.m_value;
1285 }
1286
1288 bool operator<(const InterfaceName &other) const
1289 {
1290 return m_value < other.m_value;
1291 }
1292
1294 bool operator>(const InterfaceName &other) const
1295 {
1296 return m_value > other.m_value;
1297 }
1298
1300 bool operator<=(const InterfaceName &other) const
1301 {
1302 return m_value <= other.m_value;
1303 }
1304
1306 bool operator>=(const InterfaceName &other) const
1307 {
1308 return m_value >= other.m_value;
1309 }
1310
1312 friend std::ostream &operator<<(std::ostream &stream, const InterfaceName &value)
1313 {
1314 return stream << value.toString();
1315 }
1316
1317 private:
1318 void setFromString(const std::string &value);
1319
1320 std::string m_value{};
1321
1322 friend struct DataModel::Detail::Befriend<InterfaceName>;
1323 };
1324
1325 using Descendants = std::tuple<
1329
1332
1346#ifndef NO_DOC
1347 template<
1348 typename... Args,
1349 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1350 typename std::enable_if<
1351 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1352 value,
1353 int>::type = 0>
1354#else
1355 template<typename... Args>
1356#endif
1357 explicit LocalInterface(Args &&...args)
1358 {
1359 using namespace Zivid::Detail::TypeTraits;
1360
1361 static_assert(
1362 AllArgsDecayedAreUnique<Args...>::value,
1363 "Found duplicate types among the arguments passed to LocalInterface(...). "
1364 "Types should be listed at most once.");
1365
1366 set(std::forward<Args>(args)...);
1367 }
1368
1381#ifndef NO_DOC
1382 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1383#else
1384 template<typename... Args>
1385#endif
1386 void set(Args &&...args)
1387 {
1388 using namespace Zivid::Detail::TypeTraits;
1389
1390 using AllArgsAreDescendantNodes =
1391 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1392 static_assert(
1393 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1394
1395 static_assert(
1396 AllArgsDecayedAreUnique<Args...>::value,
1397 "Found duplicate types among the arguments passed to set(...). "
1398 "Types should be listed at most once.");
1399
1400 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1401 }
1402
1416#ifndef NO_DOC
1417 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1418#else
1419 template<typename... Args>
1420#endif
1421 LocalInterface copyWith(Args &&...args) const
1422 {
1423 using namespace Zivid::Detail::TypeTraits;
1424
1425 using AllArgsAreDescendantNodes =
1426 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1427 static_assert(
1428 AllArgsAreDescendantNodes::value,
1429 "All arguments passed to copyWith(...) must be descendant nodes.");
1430
1431 static_assert(
1432 AllArgsDecayedAreUnique<Args...>::value,
1433 "Found duplicate types among the arguments passed to copyWith(...). "
1434 "Types should be listed at most once.");
1435
1436 auto copy{ *this };
1437 copy.set(std::forward<Args>(args)...);
1438 return copy;
1439 }
1440
1442 const IPV4 &ipv4() const
1443 {
1444 return m_ipv4;
1445 }
1446
1449 {
1450 return m_ipv4;
1451 }
1452
1454 LocalInterface &set(const IPV4 &value)
1455 {
1456 m_ipv4 = value;
1457 return *this;
1458 }
1459
1462 {
1463 m_ipv4.set(value);
1464 return *this;
1465 }
1466
1469 {
1470 return m_interfaceName;
1471 }
1472
1475 {
1476 return m_interfaceName;
1477 }
1478
1481 {
1482 m_interfaceName = value;
1483 return *this;
1484 }
1485
1486 template<
1487 typename T,
1488 typename std::enable_if<std::is_same<T, CameraState::Network::LocalInterface::IPV4>::value, int>::
1489 type = 0>
1491 {
1492 return m_ipv4;
1493 }
1494
1495 template<
1496 typename T,
1497 typename std::enable_if<
1498 std::is_same<T, CameraState::Network::LocalInterface::IPV4::Subnets>::value,
1499 int>::type = 0>
1501 {
1503 }
1504
1505 template<
1506 typename T,
1507 typename std::enable_if<
1508 std::is_same<T, CameraState::Network::LocalInterface::InterfaceName>::value,
1509 int>::type = 0>
1511 {
1512 return m_interfaceName;
1513 }
1514
1515 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1517 {
1518 return m_ipv4;
1519 }
1520
1521 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1523 {
1524 return m_interfaceName;
1525 }
1526
1528 template<typename F>
1529 void forEach(const F &f) const
1530 {
1531 f(m_ipv4);
1532 f(m_interfaceName);
1533 }
1534
1536 template<typename F>
1537 void forEach(const F &f)
1538 {
1539 f(m_ipv4);
1540 f(m_interfaceName);
1541 }
1542
1544 bool operator==(const LocalInterface &other) const;
1545
1547 bool operator!=(const LocalInterface &other) const;
1548
1550 std::string toString() const;
1551
1553 friend std::ostream &operator<<(std::ostream &stream, const LocalInterface &value)
1554 {
1555 return stream << value.toString();
1556 }
1557
1558 private:
1559 void setFromString(const std::string &value);
1560
1561 void setFromString(const std::string &fullPath, const std::string &value);
1562
1563 std::string getString(const std::string &fullPath) const;
1564
1565 IPV4 m_ipv4;
1566 InterfaceName m_interfaceName;
1567
1568 friend struct DataModel::Detail::Befriend<LocalInterface>;
1569 };
1570
1572
1573 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1575 {
1576 public:
1579
1581 static constexpr const char *path{ "Network/Ethernet" };
1582
1584 static constexpr const char *name{ "Ethernet" };
1585
1587 static constexpr const char *description{ R"description(Current Ethernet state)description" };
1588
1590
1591 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1593 {
1594 public:
1597
1599 static constexpr const char *path{ "Network/Ethernet/LinkSpeed" };
1600
1602 static constexpr const char *name{ "LinkSpeed" };
1603
1605 static constexpr const char *description{
1606 R"description(The link speed between the camera and the network device it is connected to, not the transfer speed between the camera and the host computer. Suppose the camera is connected to a 10Gbps network switch that is connected to a 1Gbps network card on the host computer. This value will indicate speed of 10Gbps even if the end-to-end link speed is limited to 1Gbps. The value will be `unknown` if the link is down or if the camera cannot determine the link speed.)description"
1607 };
1608
1610 enum class ValueType
1611 {
1619 };
1620 static const LinkSpeed unknown;
1621 static const LinkSpeed link10Mbps;
1622 static const LinkSpeed link100Mbps;
1623 static const LinkSpeed link1Gbps;
1624 static const LinkSpeed link2_5Gbps;
1625 static const LinkSpeed link5Gbps;
1626 static const LinkSpeed link10Gbps;
1627
1629 static std::set<ValueType> validValues()
1630 {
1634 }
1635
1637 LinkSpeed() = default;
1638
1640 explicit constexpr LinkSpeed(ValueType value)
1641 : m_value{ verifyValue(value) }
1642 {}
1643
1646
1648 std::string toString() const;
1649
1651 friend std::ostream &operator<<(std::ostream &stream, const LinkSpeed::ValueType &value)
1652 {
1653 return stream << LinkSpeed{ value }.toString();
1654 }
1655
1657 bool operator==(const LinkSpeed &other) const
1658 {
1659 return m_value == other.m_value;
1660 }
1661
1663 bool operator!=(const LinkSpeed &other) const
1664 {
1665 return m_value != other.m_value;
1666 }
1667
1669 friend std::ostream &operator<<(std::ostream &stream, const LinkSpeed &value)
1670 {
1671 return stream << value.toString();
1672 }
1673
1674 private:
1675 void setFromString(const std::string &value);
1676
1677 constexpr ValueType static verifyValue(const ValueType &value)
1678 {
1679 return value == ValueType::unknown || value == ValueType::link10Mbps
1680 || value == ValueType::link100Mbps || value == ValueType::link1Gbps
1681 || value == ValueType::link2_5Gbps || value == ValueType::link5Gbps
1682 || value == ValueType::link10Gbps
1683 ? value
1684 : throw std::invalid_argument{
1685 "Invalid value: LinkSpeed{ "
1686 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
1687 + " }"
1688 };
1689 }
1690
1692
1693 friend struct DataModel::Detail::Befriend<LinkSpeed>;
1694 };
1695
1696 using Descendants = std::tuple<CameraState::Network::Ethernet::LinkSpeed>;
1697
1700
1712#ifndef NO_DOC
1713 template<
1714 typename... Args,
1715 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1716 typename std::enable_if<
1717 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1718 value,
1719 int>::type = 0>
1720#else
1721 template<typename... Args>
1722#endif
1723 explicit Ethernet(Args &&...args)
1724 {
1725 using namespace Zivid::Detail::TypeTraits;
1726
1727 static_assert(
1728 AllArgsDecayedAreUnique<Args...>::value,
1729 "Found duplicate types among the arguments passed to Ethernet(...). "
1730 "Types should be listed at most once.");
1731
1732 set(std::forward<Args>(args)...);
1733 }
1734
1745#ifndef NO_DOC
1746 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1747#else
1748 template<typename... Args>
1749#endif
1750 void set(Args &&...args)
1751 {
1752 using namespace Zivid::Detail::TypeTraits;
1753
1754 using AllArgsAreDescendantNodes =
1755 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1756 static_assert(
1757 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1758
1759 static_assert(
1760 AllArgsDecayedAreUnique<Args...>::value,
1761 "Found duplicate types among the arguments passed to set(...). "
1762 "Types should be listed at most once.");
1763
1764 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1765 }
1766
1778#ifndef NO_DOC
1779 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1780#else
1781 template<typename... Args>
1782#endif
1783 Ethernet copyWith(Args &&...args) const
1784 {
1785 using namespace Zivid::Detail::TypeTraits;
1786
1787 using AllArgsAreDescendantNodes =
1788 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1789 static_assert(
1790 AllArgsAreDescendantNodes::value,
1791 "All arguments passed to copyWith(...) must be descendant nodes.");
1792
1793 static_assert(
1794 AllArgsDecayedAreUnique<Args...>::value,
1795 "Found duplicate types among the arguments passed to copyWith(...). "
1796 "Types should be listed at most once.");
1797
1798 auto copy{ *this };
1799 copy.set(std::forward<Args>(args)...);
1800 return copy;
1801 }
1802
1804 const LinkSpeed &linkSpeed() const
1805 {
1806 return m_linkSpeed;
1807 }
1808
1811 {
1812 return m_linkSpeed;
1813 }
1814
1816 Ethernet &set(const LinkSpeed &value)
1817 {
1818 m_linkSpeed = value;
1819 return *this;
1820 }
1821
1822 template<
1823 typename T,
1824 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet::LinkSpeed>::value, int>::
1825 type = 0>
1827 {
1828 return m_linkSpeed;
1829 }
1830
1831 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1833 {
1834 return m_linkSpeed;
1835 }
1836
1838 template<typename F>
1839 void forEach(const F &f) const
1840 {
1841 f(m_linkSpeed);
1842 }
1843
1845 template<typename F>
1846 void forEach(const F &f)
1847 {
1848 f(m_linkSpeed);
1849 }
1850
1852 bool operator==(const Ethernet &other) const;
1853
1855 bool operator!=(const Ethernet &other) const;
1856
1858 std::string toString() const;
1859
1861 friend std::ostream &operator<<(std::ostream &stream, const Ethernet &value)
1862 {
1863 return stream << value.toString();
1864 }
1865
1866 private:
1867 void setFromString(const std::string &value);
1868
1869 void setFromString(const std::string &fullPath, const std::string &value);
1870
1871 std::string getString(const std::string &fullPath) const;
1872
1873 LinkSpeed m_linkSpeed;
1874
1875 friend struct DataModel::Detail::Befriend<Ethernet>;
1876 };
1877
1879
1880 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1882 {
1883 public:
1886
1888 static constexpr const char *path{ "Network/IPV4" };
1889
1891 static constexpr const char *name{ "IPV4" };
1892
1894 static constexpr const char *description{ R"description(Current IPv4 protocol state)description" };
1895
1897
1898 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1900 {
1901 public:
1904
1906 static constexpr const char *path{ "Network/IPV4/Address" };
1907
1909 static constexpr const char *name{ "Address" };
1910
1912 static constexpr const char *description{ R"description(Current IPv4 address)description" };
1913
1915 using ValueType = std::string;
1916
1919 {
1920 return { 0, std::numeric_limits<ValueType::size_type>::max() };
1921 }
1922
1924 Address() = default;
1925
1927 explicit Address(std::string value)
1928 : m_value{ std::move(value) }
1929 {}
1930
1932 const std::string &value() const;
1933
1935 std::string toString() const;
1936
1938 bool operator==(const Address &other) const
1939 {
1940 return m_value == other.m_value;
1941 }
1942
1944 bool operator!=(const Address &other) const
1945 {
1946 return m_value != other.m_value;
1947 }
1948
1950 bool operator<(const Address &other) const
1951 {
1952 return m_value < other.m_value;
1953 }
1954
1956 bool operator>(const Address &other) const
1957 {
1958 return m_value > other.m_value;
1959 }
1960
1962 bool operator<=(const Address &other) const
1963 {
1964 return m_value <= other.m_value;
1965 }
1966
1968 bool operator>=(const Address &other) const
1969 {
1970 return m_value >= other.m_value;
1971 }
1972
1974 friend std::ostream &operator<<(std::ostream &stream, const Address &value)
1975 {
1976 return stream << value.toString();
1977 }
1978
1979 private:
1980 void setFromString(const std::string &value);
1981
1982 std::string m_value{};
1983
1984 friend struct DataModel::Detail::Befriend<Address>;
1985 };
1986
1987 using Descendants = std::tuple<CameraState::Network::IPV4::Address>;
1988
1991
2003#ifndef NO_DOC
2004 template<
2005 typename... Args,
2006 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2007 typename std::enable_if<
2008 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2009 value,
2010 int>::type = 0>
2011#else
2012 template<typename... Args>
2013#endif
2014 explicit IPV4(Args &&...args)
2015 {
2016 using namespace Zivid::Detail::TypeTraits;
2017
2018 static_assert(
2019 AllArgsDecayedAreUnique<Args...>::value,
2020 "Found duplicate types among the arguments passed to IPV4(...). "
2021 "Types should be listed at most once.");
2022
2023 set(std::forward<Args>(args)...);
2024 }
2025
2036#ifndef NO_DOC
2037 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2038#else
2039 template<typename... Args>
2040#endif
2041 void set(Args &&...args)
2042 {
2043 using namespace Zivid::Detail::TypeTraits;
2044
2045 using AllArgsAreDescendantNodes =
2046 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2047 static_assert(
2048 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2049
2050 static_assert(
2051 AllArgsDecayedAreUnique<Args...>::value,
2052 "Found duplicate types among the arguments passed to set(...). "
2053 "Types should be listed at most once.");
2054
2055 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2056 }
2057
2069#ifndef NO_DOC
2070 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2071#else
2072 template<typename... Args>
2073#endif
2074 IPV4 copyWith(Args &&...args) const
2075 {
2076 using namespace Zivid::Detail::TypeTraits;
2077
2078 using AllArgsAreDescendantNodes =
2079 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2080 static_assert(
2081 AllArgsAreDescendantNodes::value,
2082 "All arguments passed to copyWith(...) must be descendant nodes.");
2083
2084 static_assert(
2085 AllArgsDecayedAreUnique<Args...>::value,
2086 "Found duplicate types among the arguments passed to copyWith(...). "
2087 "Types should be listed at most once.");
2088
2089 auto copy{ *this };
2090 copy.set(std::forward<Args>(args)...);
2091 return copy;
2092 }
2093
2095 const Address &address() const
2096 {
2097 return m_address;
2098 }
2099
2102 {
2103 return m_address;
2104 }
2105
2107 IPV4 &set(const Address &value)
2108 {
2109 m_address = value;
2110 return *this;
2111 }
2112
2113 template<
2114 typename T,
2115 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value, int>::type = 0>
2117 {
2118 return m_address;
2119 }
2120
2121 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2123 {
2124 return m_address;
2125 }
2126
2128 template<typename F>
2129 void forEach(const F &f) const
2130 {
2131 f(m_address);
2132 }
2133
2135 template<typename F>
2136 void forEach(const F &f)
2137 {
2138 f(m_address);
2139 }
2140
2142 bool operator==(const IPV4 &other) const;
2143
2145 bool operator!=(const IPV4 &other) const;
2146
2148 std::string toString() const;
2149
2151 friend std::ostream &operator<<(std::ostream &stream, const IPV4 &value)
2152 {
2153 return stream << value.toString();
2154 }
2155
2156 private:
2157 void setFromString(const std::string &value);
2158
2159 void setFromString(const std::string &fullPath, const std::string &value);
2160
2161 std::string getString(const std::string &fullPath) const;
2162
2163 Address m_address;
2164
2165 friend struct DataModel::Detail::Befriend<IPV4>;
2166 };
2167
2175
2176 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2178 {
2179 public:
2182
2184 static constexpr const char *path{ "Network/LocalInterfaces" };
2185
2187 static constexpr const char *name{ "LocalInterfaces" };
2188
2190 static constexpr const char *description{
2191 R"description(List of the computer's local network interfaces that discovered the camera. In the most common scenario
2192with the camera connected to the computer with an Ethernet cable, this list will contain only the
2193network interface for that Ethernet port. In more complex network scenarios it can be the case that the
2194camera is discovered by multiple interfaces, and in that case this list will contain multiple network
2195interfaces. However, when `CameraState::Status` is `connected`, only the one network interface that has
2196the active TCP/IP connection to the camera will be listed.
2197)description"
2198 };
2199
2201 using ValueType = std::vector<CameraState::Network::LocalInterface>;
2202
2205 {
2206 return { 0, std::numeric_limits<ValueType::size_type>::max() };
2207 }
2208
2210 LocalInterfaces() = default;
2211
2213 explicit LocalInterfaces(std::vector<CameraState::Network::LocalInterface> value)
2214 : m_value{ std::move(value) }
2215 {}
2216
2218 explicit LocalInterfaces(std::initializer_list<CameraState::Network::LocalInterface> value)
2220 {}
2221
2223 const std::vector<CameraState::Network::LocalInterface> &value() const;
2224
2226 std::string toString() const;
2227
2229 std::size_t size() const noexcept;
2230
2232 bool isEmpty() const noexcept;
2233
2239 template<typename... Args>
2240 void emplaceBack(Args &&...args)
2241 {
2242 m_value.emplace_back(std::forward<Args>(args)...);
2243 }
2244
2251
2257 const CameraState::Network::LocalInterface &at(std::size_t pos) const;
2258
2265
2272
2274 template<typename F>
2275 void forEach(const F &f)
2276 {
2277 for(auto &child : m_value)
2278 {
2279 f(child);
2280 }
2281 }
2282
2284 template<typename F>
2285 void forEach(const F &f) const
2286 {
2287 for(const auto &child : m_value)
2288 {
2289 f(child);
2290 }
2291 }
2292
2294 using Iterator = std::vector<CameraState::Network::LocalInterface>::iterator;
2295
2297 Iterator begin() noexcept;
2298
2300 Iterator end() noexcept;
2301
2303 using ConstIterator = std::vector<CameraState::Network::LocalInterface>::const_iterator;
2304
2306 ConstIterator begin() const noexcept;
2307
2309 ConstIterator end() const noexcept;
2310
2312 ConstIterator cbegin() const noexcept;
2313
2315 ConstIterator cend() const noexcept;
2316
2318 bool operator==(const LocalInterfaces &other) const
2319 {
2320 return m_value == other.m_value;
2321 }
2322
2324 bool operator!=(const LocalInterfaces &other) const
2325 {
2326 return m_value != other.m_value;
2327 }
2328
2330 friend std::ostream &operator<<(std::ostream &stream, const LocalInterfaces &value)
2331 {
2332 return stream << value.toString();
2333 }
2334
2335 private:
2336 void setFromString(const std::string &value);
2337
2338 std::vector<CameraState::Network::LocalInterface> m_value{};
2339
2340 friend struct DataModel::Detail::Befriend<LocalInterfaces>;
2341 };
2342
2343 using Descendants = std::tuple<
2349
2352
2368#ifndef NO_DOC
2369 template<
2370 typename... Args,
2371 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2372 typename std::enable_if<
2373 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2374 value,
2375 int>::type = 0>
2376#else
2377 template<typename... Args>
2378#endif
2379 explicit Network(Args &&...args)
2380 {
2381 using namespace Zivid::Detail::TypeTraits;
2382
2383 static_assert(
2384 AllArgsDecayedAreUnique<Args...>::value,
2385 "Found duplicate types among the arguments passed to Network(...). "
2386 "Types should be listed at most once.");
2387
2388 set(std::forward<Args>(args)...);
2389 }
2390
2405#ifndef NO_DOC
2406 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2407#else
2408 template<typename... Args>
2409#endif
2410 void set(Args &&...args)
2411 {
2412 using namespace Zivid::Detail::TypeTraits;
2413
2414 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2415 static_assert(
2416 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2417
2418 static_assert(
2419 AllArgsDecayedAreUnique<Args...>::value,
2420 "Found duplicate types among the arguments passed to set(...). "
2421 "Types should be listed at most once.");
2422
2423 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2424 }
2425
2441#ifndef NO_DOC
2442 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2443#else
2444 template<typename... Args>
2445#endif
2446 Network copyWith(Args &&...args) const
2447 {
2448 using namespace Zivid::Detail::TypeTraits;
2449
2450 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2451 static_assert(
2452 AllArgsAreDescendantNodes::value,
2453 "All arguments passed to copyWith(...) must be descendant nodes.");
2454
2455 static_assert(
2456 AllArgsDecayedAreUnique<Args...>::value,
2457 "Found duplicate types among the arguments passed to copyWith(...). "
2458 "Types should be listed at most once.");
2459
2460 auto copy{ *this };
2461 copy.set(std::forward<Args>(args)...);
2462 return copy;
2463 }
2464
2466 const Ethernet &ethernet() const
2467 {
2468 return m_ethernet;
2469 }
2470
2473 {
2474 return m_ethernet;
2475 }
2476
2478 Network &set(const Ethernet &value)
2479 {
2480 m_ethernet = value;
2481 return *this;
2482 }
2483
2486 {
2487 m_ethernet.set(value);
2488 return *this;
2489 }
2490
2492 const IPV4 &ipv4() const
2493 {
2494 return m_ipv4;
2495 }
2496
2499 {
2500 return m_ipv4;
2501 }
2502
2504 Network &set(const IPV4 &value)
2505 {
2506 m_ipv4 = value;
2507 return *this;
2508 }
2509
2512 {
2513 m_ipv4.set(value);
2514 return *this;
2515 }
2516
2519 {
2520 return m_localInterfaces;
2521 }
2522
2525 {
2526 return m_localInterfaces;
2527 }
2528
2531 {
2532 m_localInterfaces = value;
2533 return *this;
2534 }
2535
2536 template<
2537 typename T,
2538 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet>::value, int>::type = 0>
2540 {
2541 return m_ethernet;
2542 }
2543
2544 template<
2545 typename T,
2546 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet::LinkSpeed>::value, int>::type =
2547 0>
2549 {
2550 return m_ethernet.get<CameraState::Network::Ethernet::LinkSpeed>();
2551 }
2552
2553 template<
2554 typename T,
2555 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4>::value, int>::type = 0>
2557 {
2558 return m_ipv4;
2559 }
2560
2561 template<
2562 typename T,
2563 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value, int>::type = 0>
2565 {
2566 return m_ipv4.get<CameraState::Network::IPV4::Address>();
2567 }
2568
2569 template<
2570 typename T,
2571 typename std::enable_if<std::is_same<T, CameraState::Network::LocalInterfaces>::value, int>::type = 0>
2573 {
2574 return m_localInterfaces;
2575 }
2576
2577 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2579 {
2580 return m_ethernet;
2581 }
2582
2583 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2585 {
2586 return m_ipv4;
2587 }
2588
2589 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2591 {
2592 return m_localInterfaces;
2593 }
2594
2596 template<typename F>
2597 void forEach(const F &f) const
2598 {
2599 f(m_ethernet);
2600 f(m_ipv4);
2601 f(m_localInterfaces);
2602 }
2603
2605 template<typename F>
2606 void forEach(const F &f)
2607 {
2608 f(m_ethernet);
2609 f(m_ipv4);
2610 f(m_localInterfaces);
2611 }
2612
2614 bool operator==(const Network &other) const;
2615
2617 bool operator!=(const Network &other) const;
2618
2620 std::string toString() const;
2621
2623 friend std::ostream &operator<<(std::ostream &stream, const Network &value)
2624 {
2625 return stream << value.toString();
2626 }
2627
2628 private:
2629 void setFromString(const std::string &value);
2630
2631 void setFromString(const std::string &fullPath, const std::string &value);
2632
2633 std::string getString(const std::string &fullPath) const;
2634
2635 Ethernet m_ethernet;
2636 IPV4 m_ipv4;
2637 LocalInterfaces m_localInterfaces;
2638
2639 friend struct DataModel::Detail::Befriend<Network>;
2640 };
2641
2676
2677 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2679 {
2680 public:
2683
2685 static constexpr const char *path{ "Status" };
2686
2688 static constexpr const char *name{ "Status" };
2689
2691 static constexpr const char *description{
2692 R"description(This enum describes the current status of this camera. The enum can have the following values:
2693
2694* `inaccessible`: The camera was discovered, but the SDK is not able to connect to this camera. This can
2695 be because the IP settings of the camera and the PC are not compatible, or because there are several
2696 cameras with the same IP connected to your PC. The `InaccessibleReason` enum will give you more
2697 details about why this camera is not accessible. The network configuration of the camera can be changed
2698 using the ZividNetworkCameraConfigurator CLI tool. See the knowledge base for more information.
2699
2700* `busy`: The camera is currently in use by another process. This can be a different process on the same
2701 PC, or on a different PC if the camera is shared on a network.
2702
2703* `applyingNetworkConfiguration`: The camera network configuration is being changed by the current process.
2704
2705* `firmwareUpdateRequired`: The camera is accessible, but requires a firmware update before you can connect
2706 to it.
2707
2708* `updatingFirmware`: The camera firmware is currently being updated in the current process.
2709
2710* `available`: The camera is available for use by the current process. This means that you can invoke
2711 camera.connect() on this camera.
2712
2713* `connecting`: The camera is currently connecting in the current process.
2714
2715* `connected`: The camera is connected in the current process. This means camera.connect() has successfully
2716 completed and you can capture using this camera.
2717
2718* `disconnecting`: The camera is currently disconnecting in the current process. When disconnection has
2719 completed, the camera will normally go back to the `available` state.
2720
2721* `disappeared`: The camera was found earlier, but it can no longer be found. The connection between the
2722 PC and the camera may be disrupted, or the camera may have lost power. When in `disappeared` state, the
2723 camera will not be returned from `Application::cameras()`. The camera will go back to one of the other
2724 states if the camera is later found again.
2725)description"
2726 };
2727
2729 enum class ValueType
2730 {
2741 };
2742 static const Status inaccessible;
2743 static const Status busy;
2747 static const Status available;
2748 static const Status connecting;
2749 static const Status connected;
2750 static const Status disconnecting;
2751 static const Status disappeared;
2752
2754 static std::set<ValueType> validValues()
2755 {
2756 return { ValueType::inaccessible,
2766 }
2767
2769 Status() = default;
2770
2772 explicit constexpr Status(ValueType value)
2773 : m_value{ verifyValue(value) }
2774 {}
2775
2778
2780 std::string toString() const;
2781
2783 friend std::ostream &operator<<(std::ostream &stream, const Status::ValueType &value)
2784 {
2785 return stream << Status{ value }.toString();
2786 }
2787
2789 bool operator==(const Status &other) const
2790 {
2791 return m_value == other.m_value;
2792 }
2793
2795 bool operator!=(const Status &other) const
2796 {
2797 return m_value != other.m_value;
2798 }
2799
2801 friend std::ostream &operator<<(std::ostream &stream, const Status &value)
2802 {
2803 return stream << value.toString();
2804 }
2805
2806 private:
2807 void setFromString(const std::string &value);
2808
2809 constexpr ValueType static verifyValue(const ValueType &value)
2810 {
2811 return value == ValueType::inaccessible || value == ValueType::busy
2812 || value == ValueType::applyingNetworkConfiguration
2813 || value == ValueType::firmwareUpdateRequired || value == ValueType::updatingFirmware
2814 || value == ValueType::available || value == ValueType::connecting
2815 || value == ValueType::connected || value == ValueType::disconnecting
2816 || value == ValueType::disappeared
2817 ? value
2818 : throw std::invalid_argument{
2819 "Invalid value: Status{ "
2820 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
2821 };
2822 }
2823
2825
2826 friend struct DataModel::Detail::Befriend<Status>;
2827 };
2828
2830
2831 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2833 {
2834 public:
2837
2839 static constexpr const char *path{ "Temperature" };
2840
2842 static constexpr const char *name{ "Temperature" };
2843
2845 static constexpr const char *description{ R"description(Current temperature(s))description" };
2846
2848
2849 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2851 {
2852 public:
2855
2857 static constexpr const char *path{ "Temperature/DMD" };
2858
2860 static constexpr const char *name{ "DMD" };
2861
2863 static constexpr const char *description{ R"description(DMD temperature)description" };
2864
2866 using ValueType = double;
2867
2869 static constexpr Range<double> validRange()
2870 {
2871 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
2872 }
2873
2875 DMD() = default;
2876
2878 explicit constexpr DMD(double value)
2879 : m_value{ value }
2880 {}
2881
2883 double value() const;
2884
2886 std::string toString() const;
2887
2889 bool operator==(const DMD &other) const
2890 {
2891 return m_value == other.m_value;
2892 }
2893
2895 bool operator!=(const DMD &other) const
2896 {
2897 return m_value != other.m_value;
2898 }
2899
2901 bool operator<(const DMD &other) const
2902 {
2903 return m_value < other.m_value;
2904 }
2905
2907 bool operator>(const DMD &other) const
2908 {
2909 return m_value > other.m_value;
2910 }
2911
2913 bool operator<=(const DMD &other) const
2914 {
2915 return m_value <= other.m_value;
2916 }
2917
2919 bool operator>=(const DMD &other) const
2920 {
2921 return m_value >= other.m_value;
2922 }
2923
2925 friend std::ostream &operator<<(std::ostream &stream, const DMD &value)
2926 {
2927 return stream << value.toString();
2928 }
2929
2930 private:
2931 void setFromString(const std::string &value);
2932
2933 double m_value{ 0.0 };
2934
2935 friend struct DataModel::Detail::Befriend<DMD>;
2936 };
2937
2939
2940 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2942 {
2943 public:
2946
2948 static constexpr const char *path{ "Temperature/General" };
2949
2951 static constexpr const char *name{ "General" };
2952
2954 static constexpr const char *description{ R"description(General temperature)description" };
2955
2957 using ValueType = double;
2958
2960 static constexpr Range<double> validRange()
2961 {
2962 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
2963 }
2964
2966 General() = default;
2967
2969 explicit constexpr General(double value)
2970 : m_value{ value }
2971 {}
2972
2974 double value() const;
2975
2977 std::string toString() const;
2978
2980 bool operator==(const General &other) const
2981 {
2982 return m_value == other.m_value;
2983 }
2984
2986 bool operator!=(const General &other) const
2987 {
2988 return m_value != other.m_value;
2989 }
2990
2992 bool operator<(const General &other) const
2993 {
2994 return m_value < other.m_value;
2995 }
2996
2998 bool operator>(const General &other) const
2999 {
3000 return m_value > other.m_value;
3001 }
3002
3004 bool operator<=(const General &other) const
3005 {
3006 return m_value <= other.m_value;
3007 }
3008
3010 bool operator>=(const General &other) const
3011 {
3012 return m_value >= other.m_value;
3013 }
3014
3016 friend std::ostream &operator<<(std::ostream &stream, const General &value)
3017 {
3018 return stream << value.toString();
3019 }
3020
3021 private:
3022 void setFromString(const std::string &value);
3023
3024 double m_value{ 0.0 };
3025
3026 friend struct DataModel::Detail::Befriend<General>;
3027 };
3028
3030
3031 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3033 {
3034 public:
3037
3039 static constexpr const char *path{ "Temperature/LED" };
3040
3042 static constexpr const char *name{ "LED" };
3043
3045 static constexpr const char *description{ R"description(LED temperature)description" };
3046
3048 using ValueType = double;
3049
3051 static constexpr Range<double> validRange()
3052 {
3053 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
3054 }
3055
3057 LED() = default;
3058
3060 explicit constexpr LED(double value)
3061 : m_value{ value }
3062 {}
3063
3065 double value() const;
3066
3068 std::string toString() const;
3069
3071 bool operator==(const LED &other) const
3072 {
3073 return m_value == other.m_value;
3074 }
3075
3077 bool operator!=(const LED &other) const
3078 {
3079 return m_value != other.m_value;
3080 }
3081
3083 bool operator<(const LED &other) const
3084 {
3085 return m_value < other.m_value;
3086 }
3087
3089 bool operator>(const LED &other) const
3090 {
3091 return m_value > other.m_value;
3092 }
3093
3095 bool operator<=(const LED &other) const
3096 {
3097 return m_value <= other.m_value;
3098 }
3099
3101 bool operator>=(const LED &other) const
3102 {
3103 return m_value >= other.m_value;
3104 }
3105
3107 friend std::ostream &operator<<(std::ostream &stream, const LED &value)
3108 {
3109 return stream << value.toString();
3110 }
3111
3112 private:
3113 void setFromString(const std::string &value);
3114
3115 double m_value{ 0.0 };
3116
3117 friend struct DataModel::Detail::Befriend<LED>;
3118 };
3119
3121
3122 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3124 {
3125 public:
3128
3130 static constexpr const char *path{ "Temperature/Lens" };
3131
3133 static constexpr const char *name{ "Lens" };
3134
3136 static constexpr const char *description{ R"description(Lens temperature)description" };
3137
3139 using ValueType = double;
3140
3142 static constexpr Range<double> validRange()
3143 {
3144 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
3145 }
3146
3148 Lens() = default;
3149
3151 explicit constexpr Lens(double value)
3152 : m_value{ value }
3153 {}
3154
3156 double value() const;
3157
3159 std::string toString() const;
3160
3162 bool operator==(const Lens &other) const
3163 {
3164 return m_value == other.m_value;
3165 }
3166
3168 bool operator!=(const Lens &other) const
3169 {
3170 return m_value != other.m_value;
3171 }
3172
3174 bool operator<(const Lens &other) const
3175 {
3176 return m_value < other.m_value;
3177 }
3178
3180 bool operator>(const Lens &other) const
3181 {
3182 return m_value > other.m_value;
3183 }
3184
3186 bool operator<=(const Lens &other) const
3187 {
3188 return m_value <= other.m_value;
3189 }
3190
3192 bool operator>=(const Lens &other) const
3193 {
3194 return m_value >= other.m_value;
3195 }
3196
3198 friend std::ostream &operator<<(std::ostream &stream, const Lens &value)
3199 {
3200 return stream << value.toString();
3201 }
3202
3203 private:
3204 void setFromString(const std::string &value);
3205
3206 double m_value{ 0.0 };
3207
3208 friend struct DataModel::Detail::Befriend<Lens>;
3209 };
3210
3212
3213 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3215 {
3216 public:
3219
3221 static constexpr const char *path{ "Temperature/PCB" };
3222
3224 static constexpr const char *name{ "PCB" };
3225
3227 static constexpr const char *description{ R"description(PCB temperature)description" };
3228
3230 using ValueType = double;
3231
3233 static constexpr Range<double> validRange()
3234 {
3235 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
3236 }
3237
3239 PCB() = default;
3240
3242 explicit constexpr PCB(double value)
3243 : m_value{ value }
3244 {}
3245
3247 double value() const;
3248
3250 std::string toString() const;
3251
3253 bool operator==(const PCB &other) const
3254 {
3255 return m_value == other.m_value;
3256 }
3257
3259 bool operator!=(const PCB &other) const
3260 {
3261 return m_value != other.m_value;
3262 }
3263
3265 bool operator<(const PCB &other) const
3266 {
3267 return m_value < other.m_value;
3268 }
3269
3271 bool operator>(const PCB &other) const
3272 {
3273 return m_value > other.m_value;
3274 }
3275
3277 bool operator<=(const PCB &other) const
3278 {
3279 return m_value <= other.m_value;
3280 }
3281
3283 bool operator>=(const PCB &other) const
3284 {
3285 return m_value >= other.m_value;
3286 }
3287
3289 friend std::ostream &operator<<(std::ostream &stream, const PCB &value)
3290 {
3291 return stream << value.toString();
3292 }
3293
3294 private:
3295 void setFromString(const std::string &value);
3296
3297 double m_value{ 0.0 };
3298
3299 friend struct DataModel::Detail::Befriend<PCB>;
3300 };
3301
3302 using Descendants = std::tuple<
3308
3311
3327#ifndef NO_DOC
3328 template<
3329 typename... Args,
3330 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3331 typename std::enable_if<
3332 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
3333 value,
3334 int>::type = 0>
3335#else
3336 template<typename... Args>
3337#endif
3338 explicit Temperature(Args &&...args)
3339 {
3340 using namespace Zivid::Detail::TypeTraits;
3341
3342 static_assert(
3343 AllArgsDecayedAreUnique<Args...>::value,
3344 "Found duplicate types among the arguments passed to Temperature(...). "
3345 "Types should be listed at most once.");
3346
3347 set(std::forward<Args>(args)...);
3348 }
3349
3364#ifndef NO_DOC
3365 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3366#else
3367 template<typename... Args>
3368#endif
3369 void set(Args &&...args)
3370 {
3371 using namespace Zivid::Detail::TypeTraits;
3372
3373 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3374 static_assert(
3375 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3376
3377 static_assert(
3378 AllArgsDecayedAreUnique<Args...>::value,
3379 "Found duplicate types among the arguments passed to set(...). "
3380 "Types should be listed at most once.");
3381
3382 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
3383 }
3384
3400#ifndef NO_DOC
3401 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
3402#else
3403 template<typename... Args>
3404#endif
3405 Temperature copyWith(Args &&...args) const
3406 {
3407 using namespace Zivid::Detail::TypeTraits;
3408
3409 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3410 static_assert(
3411 AllArgsAreDescendantNodes::value,
3412 "All arguments passed to copyWith(...) must be descendant nodes.");
3413
3414 static_assert(
3415 AllArgsDecayedAreUnique<Args...>::value,
3416 "Found duplicate types among the arguments passed to copyWith(...). "
3417 "Types should be listed at most once.");
3418
3419 auto copy{ *this };
3420 copy.set(std::forward<Args>(args)...);
3421 return copy;
3422 }
3423
3425 const DMD &dmd() const
3426 {
3427 return m_dmd;
3428 }
3429
3432 {
3433 return m_dmd;
3434 }
3435
3437 Temperature &set(const DMD &value)
3438 {
3439 m_dmd = value;
3440 return *this;
3441 }
3442
3444 const General &general() const
3445 {
3446 return m_general;
3447 }
3448
3451 {
3452 return m_general;
3453 }
3454
3456 Temperature &set(const General &value)
3457 {
3458 m_general = value;
3459 return *this;
3460 }
3461
3463 const LED &led() const
3464 {
3465 return m_led;
3466 }
3467
3470 {
3471 return m_led;
3472 }
3473
3475 Temperature &set(const LED &value)
3476 {
3477 m_led = value;
3478 return *this;
3479 }
3480
3482 const Lens &lens() const
3483 {
3484 return m_lens;
3485 }
3486
3489 {
3490 return m_lens;
3491 }
3492
3494 Temperature &set(const Lens &value)
3495 {
3496 m_lens = value;
3497 return *this;
3498 }
3499
3501 const PCB &pcb() const
3502 {
3503 return m_pcb;
3504 }
3505
3508 {
3509 return m_pcb;
3510 }
3511
3513 Temperature &set(const PCB &value)
3514 {
3515 m_pcb = value;
3516 return *this;
3517 }
3518
3519 template<
3520 typename T,
3521 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value, int>::type = 0>
3523 {
3524 return m_dmd;
3525 }
3526
3527 template<
3528 typename T,
3529 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value, int>::type = 0>
3531 {
3532 return m_general;
3533 }
3534
3535 template<
3536 typename T,
3537 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value, int>::type = 0>
3539 {
3540 return m_led;
3541 }
3542
3543 template<
3544 typename T,
3545 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value, int>::type = 0>
3547 {
3548 return m_lens;
3549 }
3550
3551 template<
3552 typename T,
3553 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value, int>::type = 0>
3555 {
3556 return m_pcb;
3557 }
3558
3559 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3561 {
3562 return m_dmd;
3563 }
3564
3565 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3567 {
3568 return m_general;
3569 }
3570
3571 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3573 {
3574 return m_led;
3575 }
3576
3577 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
3579 {
3580 return m_lens;
3581 }
3582
3583 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
3585 {
3586 return m_pcb;
3587 }
3588
3590 template<typename F>
3591 void forEach(const F &f) const
3592 {
3593 f(m_dmd);
3594 f(m_general);
3595 f(m_led);
3596 f(m_lens);
3597 f(m_pcb);
3598 }
3599
3601 template<typename F>
3602 void forEach(const F &f)
3603 {
3604 f(m_dmd);
3605 f(m_general);
3606 f(m_led);
3607 f(m_lens);
3608 f(m_pcb);
3609 }
3610
3612 bool operator==(const Temperature &other) const;
3613
3615 bool operator!=(const Temperature &other) const;
3616
3618 std::string toString() const;
3619
3621 friend std::ostream &operator<<(std::ostream &stream, const Temperature &value)
3622 {
3623 return stream << value.toString();
3624 }
3625
3626 private:
3627 void setFromString(const std::string &value);
3628
3629 void setFromString(const std::string &fullPath, const std::string &value);
3630
3631 std::string getString(const std::string &fullPath) const;
3632
3633 DMD m_dmd;
3634 General m_general;
3635 LED m_led;
3636 Lens m_lens;
3637 PCB m_pcb;
3638
3639 friend struct DataModel::Detail::Befriend<Temperature>;
3640 };
3641
3642 using Descendants = std::tuple<
3659
3662
3664 explicit CameraState(const std::string &fileName);
3665
3671 [[nodiscard]] static CameraState fromSerialized(const std::string &value);
3672
3678 std::string serialize() const;
3679
3706#ifndef NO_DOC
3707 template<
3708 typename... Args,
3709 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3710 typename std::enable_if<
3711 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
3712 int>::type = 0>
3713#else
3714 template<typename... Args>
3715#endif
3716 explicit CameraState(Args &&...args)
3717 {
3718 using namespace Zivid::Detail::TypeTraits;
3719
3720 static_assert(
3721 AllArgsDecayedAreUnique<Args...>::value,
3722 "Found duplicate types among the arguments passed to CameraState(...). "
3723 "Types should be listed at most once.");
3724
3725 set(std::forward<Args>(args)...);
3726 }
3727
3753#ifndef NO_DOC
3754 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3755#else
3756 template<typename... Args>
3757#endif
3758 void set(Args &&...args)
3759 {
3760 using namespace Zivid::Detail::TypeTraits;
3761
3762 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3763 static_assert(
3764 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3765
3766 static_assert(
3767 AllArgsDecayedAreUnique<Args...>::value,
3768 "Found duplicate types among the arguments passed to set(...). "
3769 "Types should be listed at most once.");
3770
3771 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
3772 }
3773
3800#ifndef NO_DOC
3801 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
3802#else
3803 template<typename... Args>
3804#endif
3805 CameraState copyWith(Args &&...args) const
3806 {
3807 using namespace Zivid::Detail::TypeTraits;
3808
3809 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3810 static_assert(
3811 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
3812
3813 static_assert(
3814 AllArgsDecayedAreUnique<Args...>::value,
3815 "Found duplicate types among the arguments passed to copyWith(...). "
3816 "Types should be listed at most once.");
3817
3818 auto copy{ *this };
3819 copy.set(std::forward<Args>(args)...);
3820 return copy;
3821 }
3822
3824 const Available &isAvailable() const
3825 {
3826 return m_available;
3827 }
3828
3831 {
3832 return m_available;
3833 }
3834
3837 {
3838 m_available = value;
3839 return *this;
3840 }
3841
3843 const Connected &isConnected() const
3844 {
3845 return m_connected;
3846 }
3847
3850 {
3851 return m_connected;
3852 }
3853
3856 {
3857 m_connected = value;
3858 return *this;
3859 }
3860
3863 {
3864 return m_inaccessibleReason;
3865 }
3866
3869 {
3870 return m_inaccessibleReason;
3871 }
3872
3875 {
3876 m_inaccessibleReason = value;
3877 return *this;
3878 }
3879
3881 const Network &network() const
3882 {
3883 return m_network;
3884 }
3885
3888 {
3889 return m_network;
3890 }
3891
3893 CameraState &set(const Network &value)
3894 {
3895 m_network = value;
3896 return *this;
3897 }
3898
3901 {
3902 m_network.set(value);
3903 return *this;
3904 }
3905
3908 {
3909 m_network.set(value);
3910 return *this;
3911 }
3912
3915 {
3916 m_network.set(value);
3917 return *this;
3918 }
3919
3922 {
3923 m_network.set(value);
3924 return *this;
3925 }
3926
3929 {
3930 m_network.set(value);
3931 return *this;
3932 }
3933
3935 const Status &status() const
3936 {
3937 return m_status;
3938 }
3939
3942 {
3943 return m_status;
3944 }
3945
3947 CameraState &set(const Status &value)
3948 {
3949 m_status = value;
3950 return *this;
3951 }
3952
3955 {
3956 return m_temperature;
3957 }
3958
3961 {
3962 return m_temperature;
3963 }
3964
3967 {
3968 m_temperature = value;
3969 return *this;
3970 }
3971
3974 {
3975 m_temperature.set(value);
3976 return *this;
3977 }
3978
3981 {
3982 m_temperature.set(value);
3983 return *this;
3984 }
3985
3988 {
3989 m_temperature.set(value);
3990 return *this;
3991 }
3992
3995 {
3996 m_temperature.set(value);
3997 return *this;
3998 }
3999
4002 {
4003 m_temperature.set(value);
4004 return *this;
4005 }
4006
4007 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Available>::value, int>::type = 0>
4009 {
4010 return m_available;
4011 }
4012
4013 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Connected>::value, int>::type = 0>
4015 {
4016 return m_connected;
4017 }
4018
4019 template<
4020 typename T,
4021 typename std::enable_if<std::is_same<T, CameraState::InaccessibleReason>::value, int>::type = 0>
4023 {
4024 return m_inaccessibleReason;
4025 }
4026
4027 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Network>::value, int>::type = 0>
4029 {
4030 return m_network;
4031 }
4032
4033 template<
4034 typename T,
4035 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet>::value, int>::type = 0>
4037 {
4038 return m_network.get<CameraState::Network::Ethernet>();
4039 }
4040
4041 template<
4042 typename T,
4043 typename std::enable_if<std::is_same<T, CameraState::Network::Ethernet::LinkSpeed>::value, int>::type = 0>
4045 {
4046 return m_network.get<CameraState::Network::Ethernet::LinkSpeed>();
4047 }
4048
4049 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Network::IPV4>::value, int>::type = 0>
4051 {
4052 return m_network.get<CameraState::Network::IPV4>();
4053 }
4054
4055 template<
4056 typename T,
4057 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value, int>::type = 0>
4059 {
4060 return m_network.get<CameraState::Network::IPV4::Address>();
4061 }
4062
4063 template<
4064 typename T,
4065 typename std::enable_if<std::is_same<T, CameraState::Network::LocalInterfaces>::value, int>::type = 0>
4067 {
4068 return m_network.get<CameraState::Network::LocalInterfaces>();
4069 }
4070
4071 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Status>::value, int>::type = 0>
4073 {
4074 return m_status;
4075 }
4076
4077 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Temperature>::value, int>::type = 0>
4079 {
4080 return m_temperature;
4081 }
4082
4083 template<
4084 typename T,
4085 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value, int>::type = 0>
4087 {
4088 return m_temperature.get<CameraState::Temperature::DMD>();
4089 }
4090
4091 template<
4092 typename T,
4093 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value, int>::type = 0>
4095 {
4096 return m_temperature.get<CameraState::Temperature::General>();
4097 }
4098
4099 template<
4100 typename T,
4101 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value, int>::type = 0>
4103 {
4104 return m_temperature.get<CameraState::Temperature::LED>();
4105 }
4106
4107 template<
4108 typename T,
4109 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value, int>::type = 0>
4111 {
4112 return m_temperature.get<CameraState::Temperature::Lens>();
4113 }
4114
4115 template<
4116 typename T,
4117 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value, int>::type = 0>
4119 {
4120 return m_temperature.get<CameraState::Temperature::PCB>();
4121 }
4122
4123 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
4125 {
4126 return m_available;
4127 }
4128
4129 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
4131 {
4132 return m_connected;
4133 }
4134
4135 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
4137 {
4138 return m_inaccessibleReason;
4139 }
4140
4141 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
4143 {
4144 return m_network;
4145 }
4146
4147 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
4149 {
4150 return m_status;
4151 }
4152
4153 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
4155 {
4156 return m_temperature;
4157 }
4158
4160 template<typename F>
4161 void forEach(const F &f) const
4162 {
4163 f(m_available);
4164 f(m_connected);
4165 f(m_inaccessibleReason);
4166 f(m_network);
4167 f(m_status);
4168 f(m_temperature);
4169 }
4170
4172 template<typename F>
4173 void forEach(const F &f)
4174 {
4175 f(m_available);
4176 f(m_connected);
4177 f(m_inaccessibleReason);
4178 f(m_network);
4179 f(m_status);
4180 f(m_temperature);
4181 }
4182
4184 bool operator==(const CameraState &other) const;
4185
4187 bool operator!=(const CameraState &other) const;
4188
4190 std::string toString() const;
4191
4193 friend std::ostream &operator<<(std::ostream &stream, const CameraState &value)
4194 {
4195 return stream << value.toString();
4196 }
4197
4199 void save(const std::string &fileName) const;
4200
4202 void load(const std::string &fileName);
4203
4204 private:
4205 void setFromString(const std::string &value);
4206
4207 void setFromString(const std::string &fullPath, const std::string &value);
4208
4209 std::string getString(const std::string &fullPath) const;
4210
4211 Available m_available;
4212 Connected m_connected;
4213 InaccessibleReason m_inaccessibleReason;
4214 Network m_network;
4215 Status m_status;
4216 Temperature m_temperature;
4217
4218 friend struct DataModel::Detail::Befriend<CameraState>;
4219 };
4220
4221#ifndef NO_DOC
4222 template<>
4223 struct CameraState::Version<8>
4224 {
4225 using Type = CameraState;
4226 };
4227#endif
4228
4229} // namespace Zivid
4230
4231#ifndef NO_DOC
4233namespace Zivid::Detail
4234{
4235
4236 ZIVID_CORE_EXPORT void save(const Zivid::CameraState &dataModel, std::ostream &ostream);
4237 ZIVID_CORE_EXPORT void load(Zivid::CameraState &dataModel, std::istream &istream);
4238
4239 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::CameraState &source);
4240 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(Zivid::CameraState &dest, const std::vector<uint8_t> &data);
4241
4242} // namespace Zivid::Detail
4243#endif
4244
4245#ifdef _MSC_VER
4246# pragma warning(pop)
4247#endif
4248
4249#ifndef NO_DOC
4250# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
4251namespace std // NOLINT
4252{
4253
4254 template<>
4255 struct tuple_size<Zivid::CameraState::Network> : integral_constant<size_t, 3>
4256 {};
4257
4258 template<size_t i>
4259 struct tuple_element<i, Zivid::CameraState::Network>
4260 {
4261 static_assert(i < tuple_size<Zivid::CameraState::Network>::value, "Index must be less than 3");
4262
4263 using type // NOLINT
4264 = decltype(declval<Zivid::CameraState::Network>().get<i>());
4265 };
4266
4267 template<>
4268 struct tuple_size<Zivid::CameraState::Network::Ethernet> : integral_constant<size_t, 1>
4269 {};
4270
4271 template<size_t i>
4272 struct tuple_element<i, Zivid::CameraState::Network::Ethernet>
4273 {
4274 static_assert(i < tuple_size<Zivid::CameraState::Network::Ethernet>::value, "Index must be less than 1");
4275
4276 using type // NOLINT
4277 = decltype(declval<Zivid::CameraState::Network::Ethernet>().get<i>());
4278 };
4279
4280 template<>
4281 struct tuple_size<Zivid::CameraState::Network::IPV4> : integral_constant<size_t, 1>
4282 {};
4283
4284 template<size_t i>
4285 struct tuple_element<i, Zivid::CameraState::Network::IPV4>
4286 {
4287 static_assert(i < tuple_size<Zivid::CameraState::Network::IPV4>::value, "Index must be less than 1");
4288
4289 using type // NOLINT
4290 = decltype(declval<Zivid::CameraState::Network::IPV4>().get<i>());
4291 };
4292
4293 template<>
4294 struct tuple_size<Zivid::CameraState::Temperature> : integral_constant<size_t, 5>
4295 {};
4296
4297 template<size_t i>
4298 struct tuple_element<i, Zivid::CameraState::Temperature>
4299 {
4300 static_assert(i < tuple_size<Zivid::CameraState::Temperature>::value, "Index must be less than 5");
4301
4302 using type // NOLINT
4303 = decltype(declval<Zivid::CameraState::Temperature>().get<i>());
4304 };
4305
4306 template<>
4307 struct tuple_size<Zivid::CameraState> : integral_constant<size_t, 6>
4308 {};
4309
4310 template<size_t i>
4311 struct tuple_element<i, Zivid::CameraState>
4312 {
4313 static_assert(i < tuple_size<Zivid::CameraState>::value, "Index must be less than 6");
4314
4315 using type // NOLINT
4316 = decltype(declval<Zivid::CameraState>().get<i>());
4317 };
4318
4319} // namespace std
4320# endif
4321#endif
4322
4323// If we have access to the DataModel library, automatically include internal DataModel
4324// header. This header is necessary for serialization and deserialization.
4325#if defined(__has_include) && !defined(NO_DOC)
4326# if __has_include("Zivid/CameraStateInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
4327# include "Zivid/CameraStateInternal.h"
4328# endif
4329#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 between the camera and the network device it is connected to, not the transfer speed b...
Definition CameraState.h:1593
static const LinkSpeed link2_5Gbps
link2_5Gbps
Definition CameraState.h:1624
std::string toString() const
Get the value as string.
static const LinkSpeed unknown
unknown
Definition CameraState.h:1620
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:1596
bool operator!=(const LinkSpeed &other) const
Comparison operator.
Definition CameraState.h:1663
static constexpr const char * name
The name of this value.
Definition CameraState.h:1602
static const LinkSpeed link100Mbps
link100Mbps
Definition CameraState.h:1622
static constexpr const char * path
The full path for this value.
Definition CameraState.h:1599
friend std::ostream & operator<<(std::ostream &stream, const LinkSpeed::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:1651
static const LinkSpeed link5Gbps
link5Gbps
Definition CameraState.h:1625
static constexpr const char * description
The description for this value.
Definition CameraState.h:1605
static const LinkSpeed link10Gbps
link10Gbps
Definition CameraState.h:1626
ValueType value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const LinkSpeed &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1669
constexpr LinkSpeed(ValueType value)
Constructor.
Definition CameraState.h:1640
static const LinkSpeed link10Mbps
link10Mbps
Definition CameraState.h:1621
static std::set< ValueType > validValues()
All valid values of LinkSpeed.
Definition CameraState.h:1629
static const LinkSpeed link1Gbps
link1Gbps
Definition CameraState.h:1623
ValueType
The type of the underlying value.
Definition CameraState.h:1611
bool operator==(const LinkSpeed &other) const
Comparison operator.
Definition CameraState.h:1657
Current Ethernet state.
Definition CameraState.h:1575
friend std::ostream & operator<<(std::ostream &stream, const Ethernet &value)
Operator to send the value as string to a stream.
Definition CameraState.h:1861
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:1578
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1846
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:1783
static constexpr const char * name
The name of this value.
Definition CameraState.h:1584
const CameraState::Network::Ethernet::LinkSpeed & get() const
Definition CameraState.h:1826
std::tuple< CameraState::Network::Ethernet::LinkSpeed > Descendants
Definition CameraState.h:1696
LinkSpeed & linkSpeed()
Get LinkSpeed.
Definition CameraState.h:1810
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:1839
static constexpr const char * description
The description for this value.
Definition CameraState.h:1587
static constexpr const char * path
The full path for this value.
Definition CameraState.h:1581
Ethernet & set(const LinkSpeed &value)
Set LinkSpeed.
Definition CameraState.h:1816
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:1750
const LinkSpeed & linkSpeed() const
Get LinkSpeed.
Definition CameraState.h:1804
Current IPv4 address.
Definition CameraState.h:1900
Address()=default
Default constructor.
bool operator<(const Address &other) const
Comparison operator.
Definition CameraState.h:1950
static constexpr const char * description
The description for this value.
Definition CameraState.h:1912
bool operator==(const Address &other) const
Comparison operator.
Definition CameraState.h:1938
bool operator<=(const Address &other) const
Comparison operator.
Definition CameraState.h:1962
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Address.
Definition CameraState.h:1918
bool operator>(const Address &other) const
Comparison operator.
Definition CameraState.h:1956
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:1903
bool operator!=(const Address &other) const
Comparison operator.
Definition CameraState.h:1944
const std::string & value() const
Get the value.
static constexpr const char * name
The name of this value.
Definition CameraState.h:1909
friend std::ostream & operator<<(std::ostream &stream, const Address &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1974
static constexpr const char * path
The full path for this value.
Definition CameraState.h:1906
bool operator>=(const Address &other) const
Comparison operator.
Definition CameraState.h:1968
Address(std::string value)
Constructor.
Definition CameraState.h:1927
std::string toString() const
Get the value as string.
std::string ValueType
The type of the underlying value.
Definition CameraState.h:1915
Current IPv4 protocol state.
Definition CameraState.h:1882
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:1885
IPV4()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:2041
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:2129
static constexpr const char * description
The description for this value.
Definition CameraState.h:1894
const Address & address() const
Get Address.
Definition CameraState.h:2095
static constexpr const char * path
The full path for this value.
Definition CameraState.h:1888
friend std::ostream & operator<<(std::ostream &stream, const IPV4 &value)
Operator to send the value as string to a stream.
Definition CameraState.h:2151
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:2074
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:2116
static constexpr const char * name
The name of this value.
Definition CameraState.h:1891
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:2136
IPV4 & set(const Address &value)
Set Address.
Definition CameraState.h:2107
std::string toString() const
Get the value as string.
std::tuple< CameraState::Network::IPV4::Address > Descendants
Definition CameraState.h:1987
Address & address()
Get Address.
Definition CameraState.h:2101
bool operator!=(const IPV4 &other) const
Inequality operator.
IP address of the computer's local network interface.
Definition CameraState.h:468
bool operator>=(const Address &other) const
Comparison operator.
Definition CameraState.h:538
bool operator<(const Address &other) const
Comparison operator.
Definition CameraState.h:520
bool operator<=(const Address &other) const
Comparison operator.
Definition CameraState.h:532
static constexpr const char * name
The name of this value.
Definition CameraState.h:477
std::string ValueType
The type of the underlying value.
Definition CameraState.h:485
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Address.
Definition CameraState.h:488
std::string toString() const
Get the value as string.
static constexpr const char * path
The full path for this value.
Definition CameraState.h:474
friend std::ostream & operator<<(std::ostream &stream, const Address &value)
Operator to serialize the value to a stream.
Definition CameraState.h:544
Address(std::string value)
Constructor.
Definition CameraState.h:497
bool operator!=(const Address &other) const
Comparison operator.
Definition CameraState.h:514
static constexpr const char * description
The description for this value.
Definition CameraState.h:480
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:471
bool operator>(const Address &other) const
Comparison operator.
Definition CameraState.h:526
bool operator==(const Address &other) const
Comparison operator.
Definition CameraState.h:508
Subnet mask of the computer's local network interface.
Definition CameraState.h:561
bool operator!=(const Mask &other) const
Comparison operator.
Definition CameraState.h:607
bool operator>=(const Mask &other) const
Comparison operator.
Definition CameraState.h:631
Mask(std::string value)
Constructor.
Definition CameraState.h:590
static constexpr const char * description
The description for this value.
Definition CameraState.h:573
friend std::ostream & operator<<(std::ostream &stream, const Mask &value)
Operator to serialize the value to a stream.
Definition CameraState.h:637
bool operator==(const Mask &other) const
Comparison operator.
Definition CameraState.h:601
bool operator>(const Mask &other) const
Comparison operator.
Definition CameraState.h:619
static constexpr const char * name
The name of this value.
Definition CameraState.h:570
bool operator<(const Mask &other) const
Comparison operator.
Definition CameraState.h:613
bool operator<=(const Mask &other) const
Comparison operator.
Definition CameraState.h:625
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:564
std::string toString() const
Get the value as string.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Mask.
Definition CameraState.h:581
std::string ValueType
The type of the underlying value.
Definition CameraState.h:578
static constexpr const char * path
The full path for this value.
Definition CameraState.h:567
const std::string & value() const
Get the value.
An IPv4 subnet that the local network interface is connected to.
Definition CameraState.h:447
std::string toString() const
Get the value as string.
static constexpr const char * path
The full path for this value.
Definition CameraState.h:453
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:743
const Mask & mask() const
Get Mask.
Definition CameraState.h:783
static constexpr const char * name
The name of this value.
Definition CameraState.h:456
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:708
const CameraState::Network::LocalInterface::IPV4::Subnet::Address & get() const
Definition CameraState.h:806
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:450
bool operator!=(const Subnet &other) const
Inequality operator.
Mask & mask()
Get Mask.
Definition CameraState.h:789
std::tuple< CameraState::Network::LocalInterface::IPV4::Subnet::Address, CameraState::Network::LocalInterface::IPV4::Subnet::Mask > Descendants
Definition CameraState.h:650
bool operator==(const Subnet &other) const
Equality operator.
static constexpr const char * description
The description for this value.
Definition CameraState.h:459
friend std::ostream & operator<<(std::ostream &stream, const Subnet &value)
Operator to send the value as string to a stream.
Definition CameraState.h:859
const CameraState::Network::LocalInterface::IPV4::Subnet::Mask & get() const
Definition CameraState.h:816
const Address & address() const
Get Address.
Definition CameraState.h:764
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:843
Subnet & set(const Address &value)
Set Address.
Definition CameraState.h:776
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:835
Subnet & set(const Mask &value)
Set Mask.
Definition CameraState.h:795
Address & address()
Get Address.
Definition CameraState.h:770
List of IPv4 addresses and subnet masks that the interface is configured with. This list can contain ...
Definition CameraState.h:884
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:896
void emplaceBack(Args &&...args)
Appends a new element to the end of the list.
Definition CameraState.h:944
bool operator!=(const Subnets &other) const
Comparison operator.
Definition CameraState.h:1029
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:904
Subnets(std::vector< CameraState::Network::LocalInterface::IPV4::Subnet > value)
Constructor.
Definition CameraState.h:916
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:921
void forEach(const F &f)
Run the given function on each element in the list.
Definition CameraState.h:979
friend std::ostream & operator<<(std::ostream &stream, const Subnets &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1035
std::vector< CameraState::Network::LocalInterface::IPV4::Subnet >::const_iterator ConstIterator
Constant iterator type for Subnets.
Definition CameraState.h:1007
static constexpr const char * name
The name of this value.
Definition CameraState.h:893
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:887
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:890
std::vector< CameraState::Network::LocalInterface::IPV4::Subnet >::iterator Iterator
Iterator type for Subnets.
Definition CameraState.h:998
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Subnets.
Definition CameraState.h:907
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:989
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:426
static constexpr const char * path
The full path for this value.
Definition CameraState.h:432
const Subnets & subnets() const
Get Subnets.
Definition CameraState.h:1157
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:1136
const CameraState::Network::LocalInterface::IPV4::Subnets & get() const
Definition CameraState.h:1180
std::tuple< CameraState::Network::LocalInterface::IPV4::Subnets > Descendants
Definition CameraState.h:1048
friend std::ostream & operator<<(std::ostream &stream, const IPV4 &value)
Operator to send the value as string to a stream.
Definition CameraState.h:1215
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:429
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:1193
bool operator!=(const IPV4 &other) const
Inequality operator.
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1102
static constexpr const char * description
The description for this value.
Definition CameraState.h:438
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:1200
IPV4 & set(const Subnets &value)
Set Subnets.
Definition CameraState.h:1169
Subnets & subnets()
Get Subnets.
Definition CameraState.h:1163
static constexpr const char * name
The name of this value.
Definition CameraState.h:435
Name of the computer's local network interface.
Definition CameraState.h:1236
bool operator==(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1276
std::string ValueType
The type of the underlying value.
Definition CameraState.h:1253
const std::string & value() const
Get the value.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for InterfaceName.
Definition CameraState.h:1256
InterfaceName(std::string value)
Constructor.
Definition CameraState.h:1265
bool operator<=(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1300
friend std::ostream & operator<<(std::ostream &stream, const InterfaceName &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1312
bool operator>(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1294
bool operator<(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1288
static constexpr const char * path
The full path for this value.
Definition CameraState.h:1242
std::string toString() const
Get the value as string.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:1239
bool operator!=(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1282
bool operator>=(const InterfaceName &other) const
Comparison operator.
Definition CameraState.h:1306
static constexpr const char * name
The name of this value.
Definition CameraState.h:1245
static constexpr const char * description
The description for this value.
Definition CameraState.h:1248
Current state of the computer's local network interface.
Definition CameraState.h:405
const CameraState::Network::LocalInterface::IPV4::Subnets & get() const
Definition CameraState.h:1500
static constexpr const char * path
The full path for this value.
Definition CameraState.h:411
bool operator!=(const LocalInterface &other) const
Inequality operator.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:408
std::tuple< CameraState::Network::LocalInterface::IPV4, CameraState::Network::LocalInterface::IPV4::Subnets, CameraState::Network::LocalInterface::InterfaceName > Descendants
Definition CameraState.h:1325
InterfaceName & interfaceName()
Get InterfaceName.
Definition CameraState.h:1474
bool operator==(const LocalInterface &other) const
Equality operator.
LocalInterface & set(const IPV4::Subnets &value)
Set IPV4::Subnets.
Definition CameraState.h:1461
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1537
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:1421
std::string toString() const
Get the value as string.
const InterfaceName & interfaceName() const
Get InterfaceName.
Definition CameraState.h:1468
const IPV4 & ipv4() const
Get IPV4.
Definition CameraState.h:1442
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:1529
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1386
friend std::ostream & operator<<(std::ostream &stream, const LocalInterface &value)
Operator to send the value as string to a stream.
Definition CameraState.h:1553
const CameraState::Network::LocalInterface::IPV4 & get() const
Definition CameraState.h:1490
static constexpr const char * description
The description for this value.
Definition CameraState.h:417
LocalInterface & set(const InterfaceName &value)
Set InterfaceName.
Definition CameraState.h:1480
static constexpr const char * name
The name of this value.
Definition CameraState.h:414
IPV4 & ipv4()
Get IPV4.
Definition CameraState.h:1448
const CameraState::Network::LocalInterface::InterfaceName & get() const
Definition CameraState.h:1510
LocalInterface & set(const IPV4 &value)
Set IPV4.
Definition CameraState.h:1454
List of the computer's local network interfaces that discovered the camera. In the most common scenar...
Definition CameraState.h:2178
std::vector< CameraState::Network::LocalInterface >::iterator Iterator
Iterator type for LocalInterfaces.
Definition CameraState.h:2294
bool operator!=(const LocalInterfaces &other) const
Comparison operator.
Definition CameraState.h:2324
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:2190
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2181
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:2201
LocalInterfaces(std::initializer_list< CameraState::Network::LocalInterface > value)
Constructor.
Definition CameraState.h:2218
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:2240
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for LocalInterfaces.
Definition CameraState.h:2204
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:2213
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:2285
std::vector< CameraState::Network::LocalInterface >::const_iterator ConstIterator
Constant iterator type for LocalInterfaces.
Definition CameraState.h:2303
static constexpr const char * name
The name of this value.
Definition CameraState.h:2187
void forEach(const F &f)
Run the given function on each element in the list.
Definition CameraState.h:2275
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2184
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:2330
Current network state.
Definition CameraState.h:386
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:2410
const LocalInterfaces & localInterfaces() const
Get LocalInterfaces.
Definition CameraState.h:2518
Network & set(const Ethernet::LinkSpeed &value)
Set Ethernet::LinkSpeed.
Definition CameraState.h:2485
std::tuple< CameraState::Network::Ethernet, CameraState::Network::Ethernet::LinkSpeed, CameraState::Network::IPV4, CameraState::Network::IPV4::Address, CameraState::Network::LocalInterfaces > Descendants
Definition CameraState.h:2343
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:2623
Network & set(const Ethernet &value)
Set Ethernet.
Definition CameraState.h:2478
const Ethernet & ethernet() const
Get Ethernet.
Definition CameraState.h:2466
const CameraState::Network::Ethernet & get() const
Definition CameraState.h:2539
const CameraState::Network::LocalInterfaces & get() const
Definition CameraState.h:2572
const CameraState::Network::Ethernet::LinkSpeed & get() const
Definition CameraState.h:2548
Ethernet & ethernet()
Get Ethernet.
Definition CameraState.h:2472
bool operator==(const Network &other) const
Equality operator.
LocalInterfaces & localInterfaces()
Get LocalInterfaces.
Definition CameraState.h:2524
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:2504
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:2446
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:2564
Network & set(const LocalInterfaces &value)
Set LocalInterfaces.
Definition CameraState.h:2530
const CameraState::Network::IPV4 & get() const
Definition CameraState.h:2556
Network & set(const IPV4::Address &value)
Set IPV4::Address.
Definition CameraState.h:2511
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:2606
IPV4 & ipv4()
Get IPV4.
Definition CameraState.h:2498
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:2597
const IPV4 & ipv4() const
Get IPV4.
Definition CameraState.h:2492
This enum describes the current status of this camera. The enum can have the following values:
Definition CameraState.h:2679
constexpr Status(ValueType value)
Constructor.
Definition CameraState.h:2772
static std::set< ValueType > validValues()
All valid values of Status.
Definition CameraState.h:2754
static const Status connected
connected
Definition CameraState.h:2749
static const Status disconnecting
disconnecting
Definition CameraState.h:2750
static const Status inaccessible
inaccessible
Definition CameraState.h:2742
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition CameraState.h:2730
@ connected
Definition CameraState.h:2738
@ disconnecting
Definition CameraState.h:2739
@ firmwareUpdateRequired
Definition CameraState.h:2734
@ updatingFirmware
Definition CameraState.h:2735
@ inaccessible
Definition CameraState.h:2731
@ busy
Definition CameraState.h:2732
@ connecting
Definition CameraState.h:2737
@ disappeared
Definition CameraState.h:2740
@ available
Definition CameraState.h:2736
@ applyingNetworkConfiguration
Definition CameraState.h:2733
static const Status applyingNetworkConfiguration
applyingNetworkConfiguration
Definition CameraState.h:2744
friend std::ostream & operator<<(std::ostream &stream, const Status &value)
Operator to serialize the value to a stream.
Definition CameraState.h:2801
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2682
static const Status firmwareUpdateRequired
firmwareUpdateRequired
Definition CameraState.h:2745
ValueType value() const
Get the value.
bool operator!=(const Status &other) const
Comparison operator.
Definition CameraState.h:2795
static const Status connecting
connecting
Definition CameraState.h:2748
bool operator==(const Status &other) const
Comparison operator.
Definition CameraState.h:2789
static const Status busy
busy
Definition CameraState.h:2743
Status()=default
Default constructor.
static const Status available
available
Definition CameraState.h:2747
static const Status updatingFirmware
updatingFirmware
Definition CameraState.h:2746
static constexpr const char * description
The description for this value.
Definition CameraState.h:2691
static const Status disappeared
disappeared
Definition CameraState.h:2751
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2685
static constexpr const char * name
The name of this value.
Definition CameraState.h:2688
friend std::ostream & operator<<(std::ostream &stream, const Status::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:2783
DMD temperature.
Definition CameraState.h:2851
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2854
bool operator>(const DMD &other) const
Comparison operator.
Definition CameraState.h:2907
std::string toString() const
Get the value as string.
static constexpr const char * description
The description for this value.
Definition CameraState.h:2863
double value() const
Get the value.
bool operator!=(const DMD &other) const
Comparison operator.
Definition CameraState.h:2895
bool operator<(const DMD &other) const
Comparison operator.
Definition CameraState.h:2901
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2857
bool operator>=(const DMD &other) const
Comparison operator.
Definition CameraState.h:2919
double ValueType
The type of the underlying value.
Definition CameraState.h:2866
bool operator<=(const DMD &other) const
Comparison operator.
Definition CameraState.h:2913
friend std::ostream & operator<<(std::ostream &stream, const DMD &value)
Operator to serialize the value to a stream.
Definition CameraState.h:2925
constexpr DMD(double value)
Constructor.
Definition CameraState.h:2878
bool operator==(const DMD &other) const
Comparison operator.
Definition CameraState.h:2889
static constexpr const char * name
The name of this value.
Definition CameraState.h:2860
static constexpr Range< double > validRange()
The range of valid values for DMD.
Definition CameraState.h:2869
DMD()=default
Default constructor.
General temperature.
Definition CameraState.h:2942
double ValueType
The type of the underlying value.
Definition CameraState.h:2957
static constexpr const char * name
The name of this value.
Definition CameraState.h:2951
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2945
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:2992
constexpr General(double value)
Constructor.
Definition CameraState.h:2969
static constexpr Range< double > validRange()
The range of valid values for General.
Definition CameraState.h:2960
bool operator==(const General &other) const
Comparison operator.
Definition CameraState.h:2980
General()=default
Default constructor.
bool operator<=(const General &other) const
Comparison operator.
Definition CameraState.h:3004
bool operator!=(const General &other) const
Comparison operator.
Definition CameraState.h:2986
bool operator>(const General &other) const
Comparison operator.
Definition CameraState.h:2998
static constexpr const char * description
The description for this value.
Definition CameraState.h:2954
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2948
friend std::ostream & operator<<(std::ostream &stream, const General &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3016
bool operator>=(const General &other) const
Comparison operator.
Definition CameraState.h:3010
LED temperature.
Definition CameraState.h:3033
bool operator<=(const LED &other) const
Comparison operator.
Definition CameraState.h:3095
std::string toString() const
Get the value as string.
bool operator<(const LED &other) const
Comparison operator.
Definition CameraState.h:3083
double value() const
Get the value.
LED()=default
Default constructor.
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3039
constexpr LED(double value)
Constructor.
Definition CameraState.h:3060
friend std::ostream & operator<<(std::ostream &stream, const LED &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3107
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3036
static constexpr const char * name
The name of this value.
Definition CameraState.h:3042
bool operator!=(const LED &other) const
Comparison operator.
Definition CameraState.h:3077
bool operator==(const LED &other) const
Comparison operator.
Definition CameraState.h:3071
bool operator>=(const LED &other) const
Comparison operator.
Definition CameraState.h:3101
bool operator>(const LED &other) const
Comparison operator.
Definition CameraState.h:3089
static constexpr const char * description
The description for this value.
Definition CameraState.h:3045
static constexpr Range< double > validRange()
The range of valid values for LED.
Definition CameraState.h:3051
double ValueType
The type of the underlying value.
Definition CameraState.h:3048
Lens temperature.
Definition CameraState.h:3124
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3127
double ValueType
The type of the underlying value.
Definition CameraState.h:3139
static constexpr const char * name
The name of this value.
Definition CameraState.h:3133
bool operator==(const Lens &other) const
Comparison operator.
Definition CameraState.h:3162
Lens()=default
Default constructor.
bool operator<=(const Lens &other) const
Comparison operator.
Definition CameraState.h:3186
double value() const
Get the value.
bool operator>(const Lens &other) const
Comparison operator.
Definition CameraState.h:3180
bool operator!=(const Lens &other) const
Comparison operator.
Definition CameraState.h:3168
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3130
bool operator>=(const Lens &other) const
Comparison operator.
Definition CameraState.h:3192
static constexpr const char * description
The description for this value.
Definition CameraState.h:3136
std::string toString() const
Get the value as string.
constexpr Lens(double value)
Constructor.
Definition CameraState.h:3151
static constexpr Range< double > validRange()
The range of valid values for Lens.
Definition CameraState.h:3142
bool operator<(const Lens &other) const
Comparison operator.
Definition CameraState.h:3174
friend std::ostream & operator<<(std::ostream &stream, const Lens &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3198
PCB temperature.
Definition CameraState.h:3215
bool operator!=(const PCB &other) const
Comparison operator.
Definition CameraState.h:3259
constexpr PCB(double value)
Constructor.
Definition CameraState.h:3242
static constexpr Range< double > validRange()
The range of valid values for PCB.
Definition CameraState.h:3233
bool operator>=(const PCB &other) const
Comparison operator.
Definition CameraState.h:3283
PCB()=default
Default constructor.
bool operator<=(const PCB &other) const
Comparison operator.
Definition CameraState.h:3277
friend std::ostream & operator<<(std::ostream &stream, const PCB &value)
Operator to serialize the value to a stream.
Definition CameraState.h:3289
static constexpr const char * name
The name of this value.
Definition CameraState.h:3224
bool operator==(const PCB &other) const
Comparison operator.
Definition CameraState.h:3253
static constexpr const char * description
The description for this value.
Definition CameraState.h:3227
static constexpr const char * path
The full path for this value.
Definition CameraState.h:3221
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:3218
double value() const
Get the value.
bool operator>(const PCB &other) const
Comparison operator.
Definition CameraState.h:3271
double ValueType
The type of the underlying value.
Definition CameraState.h:3230
std::string toString() const
Get the value as string.
bool operator<(const PCB &other) const
Comparison operator.
Definition CameraState.h:3265
Current temperature(s)
Definition CameraState.h:2833
DMD & dmd()
Get DMD.
Definition CameraState.h:3431
Temperature & set(const General &value)
Set General.
Definition CameraState.h:3456
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:2836
const PCB & pcb() const
Get PCB.
Definition CameraState.h:3501
const CameraState::Temperature::Lens & get() const
Definition CameraState.h:3546
static constexpr const char * name
The name of this value.
Definition CameraState.h:2842
Temperature & set(const Lens &value)
Set Lens.
Definition CameraState.h:3494
const CameraState::Temperature::DMD & get() const
Definition CameraState.h:3522
static constexpr const char * path
The full path for this value.
Definition CameraState.h:2839
const CameraState::Temperature::PCB & get() const
Definition CameraState.h:3554
const CameraState::Temperature::General & get() const
Definition CameraState.h:3530
Temperature & set(const PCB &value)
Set PCB.
Definition CameraState.h:3513
const General & general() const
Get General.
Definition CameraState.h:3444
bool operator!=(const Temperature &other) const
Inequality operator.
const LED & led() const
Get LED.
Definition CameraState.h:3463
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:3591
friend std::ostream & operator<<(std::ostream &stream, const Temperature &value)
Operator to send the value as string to a stream.
Definition CameraState.h:3621
Temperature & set(const LED &value)
Set LED.
Definition CameraState.h:3475
std::string toString() const
Get the value as string.
LED & led()
Get LED.
Definition CameraState.h:3469
bool operator==(const Temperature &other) const
Equality operator.
const Lens & lens() const
Get Lens.
Definition CameraState.h:3482
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:3405
General & general()
Get General.
Definition CameraState.h:3450
std::tuple< CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition CameraState.h:3302
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:3369
const DMD & dmd() const
Get DMD.
Definition CameraState.h:3425
static constexpr const char * description
The description for this value.
Definition CameraState.h:2845
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:3602
const CameraState::Temperature::LED & get() const
Definition CameraState.h:3538
Lens & lens()
Get Lens.
Definition CameraState.h:3488
Temperature()
Default constructor.
Temperature & set(const DMD &value)
Set DMD.
Definition CameraState.h:3437
PCB & pcb()
Get PCB.
Definition CameraState.h:3507
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:3907
const Temperature & temperature() const
Get Temperature.
Definition CameraState.h:3954
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:3805
const CameraState::Network::IPV4 & get() const
Definition CameraState.h:4050
const CameraState::Temperature::Lens & get() const
Definition CameraState.h:4110
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:3966
static constexpr const char * description
The description for this value.
Definition CameraState.h:91
const CameraState::Connected & get() const
Definition CameraState.h:4014
Temperature & temperature()
Get Temperature.
Definition CameraState.h:3960
const CameraState::Temperature::General & get() const
Definition CameraState.h:4094
std::string toString() const
Get the value as string.
CameraState & set(const Network &value)
Set Network.
Definition CameraState.h:3893
const CameraState::Status & get() const
Definition CameraState.h:4072
const CameraState::InaccessibleReason & get() const
Definition CameraState.h:4022
const CameraState::Available & get() const
Definition CameraState.h:4008
const CameraState::Network::Ethernet::LinkSpeed & get() const
Definition CameraState.h:4044
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:4058
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:4173
void save(const std::string &fileName) const
Save to the given file.
const CameraState::Network & get() const
Definition CameraState.h:4028
const CameraState::Temperature::PCB & get() const
Definition CameraState.h:4118
CameraState & set(const Temperature::PCB &value)
Set Temperature::PCB.
Definition CameraState.h:4001
const InaccessibleReason & inaccessibleReason() const
Get InaccessibleReason.
Definition CameraState.h:3862
const CameraState::Temperature::LED & get() const
Definition CameraState.h:4102
std::tuple< CameraState::Available, CameraState::Connected, CameraState::InaccessibleReason, CameraState::Network, CameraState::Network::Ethernet, CameraState::Network::Ethernet::LinkSpeed, 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:3642
static constexpr size_t version
Definition CameraState.h:95
CameraState & set(const Temperature::General &value)
Set Temperature::General.
Definition CameraState.h:3980
friend std::ostream & operator<<(std::ostream &stream, const CameraState &value)
Operator to send the value as string to a stream.
Definition CameraState.h:4193
bool operator!=(const CameraState &other) const
Inequality operator.
CameraState & set(const Network::IPV4 &value)
Set Network::IPV4.
Definition CameraState.h:3914
CameraState & set(const Network::IPV4::Address &value)
Set Network::IPV4::Address.
Definition CameraState.h:3921
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraState.h:82
Status & status()
Get Status.
Definition CameraState.h:3941
const Available & isAvailable() const
Get Available.
Definition CameraState.h:3824
const Status & status() const
Get Status.
Definition CameraState.h:3935
const CameraState::Network::LocalInterfaces & get() const
Definition CameraState.h:4066
Connected & isConnected()
Get Connected.
Definition CameraState.h:3849
CameraState & set(const Temperature::Lens &value)
Set Temperature::Lens.
Definition CameraState.h:3994
CameraState & set(const Available &value)
Set Available.
Definition CameraState.h:3836
CameraState & set(const Temperature::DMD &value)
Set Temperature::DMD.
Definition CameraState.h:3973
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.
CameraState & set(const Status &value)
Set Status.
Definition CameraState.h:3947
CameraState & set(const InaccessibleReason &value)
Set InaccessibleReason.
Definition CameraState.h:3874
CameraState & set(const Connected &value)
Set Connected.
Definition CameraState.h:3855
Network & network()
Get Network.
Definition CameraState.h:3887
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:3716
const CameraState::Temperature & get() const
Definition CameraState.h:4078
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:4161
static CameraState fromSerialized(const std::string &value)
Construct a new CameraState instance from a previously serialized string.
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:3758
const CameraState::Network::Ethernet & get() const
Definition CameraState.h:4036
InaccessibleReason & inaccessibleReason()
Get InaccessibleReason.
Definition CameraState.h:3868
CameraState & set(const Network::Ethernet &value)
Set Network::Ethernet.
Definition CameraState.h:3900
CameraState & set(const Temperature::LED &value)
Set Temperature::LED.
Definition CameraState.h:3987
const CameraState::Temperature::DMD & get() const
Definition CameraState.h:4086
const Network & network() const
Get Network.
Definition CameraState.h:3881
const Connected & isConnected() const
Get Connected.
Definition CameraState.h:3843
Available & isAvailable()
Get Available.
Definition CameraState.h:3830
CameraState & set(const Network::LocalInterfaces &value)
Set Network::LocalInterfaces.
Definition CameraState.h:3928
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:84