112# pragma warning(push)
113# pragma warning(disable : 4251)
127 static constexpr const char *path{
"" };
130 static constexpr const char *name{
"CameraState" };
133 static constexpr const char *description{
134 R
"description(Information about camera connection state, temperatures, etc.)description"
137 static constexpr size_t version{ 2 };
147 static constexpr std::array<uint8_t, 3> binaryId{
'c',
's',
't' };
159 static constexpr const char *path{
"Available" };
162 static constexpr const char *name{
"Available" };
165 static constexpr const char *description{
166 R
"description(Flag if camera is physically connected to the computer, but not connected in software. When the camera is in this state, you can call connect().)description"
177 return {
false,
true };
195 explicit operator bool()
const
203 return m_value == other.m_value;
209 return m_value != other.m_value;
219 void setFromString(
const std::string &value);
221 bool m_value{
false };
223 friend struct DataModel::Detail::Befriend<
Available>;
234 static constexpr const char *path{
"Connected" };
237 static constexpr const char *name{
"Connected" };
240 static constexpr const char *description{
241 R
"description(Flag if camera is connected in software)description"
252 return {
false,
true };
270 explicit operator bool()
const
278 return m_value == other.m_value;
284 return m_value != other.m_value;
294 void setFromString(
const std::string &value);
296 bool m_value{
false };
298 friend struct DataModel::Detail::Befriend<
Connected>;
309 static constexpr const char *path{
"Temperature" };
312 static constexpr const char *name{
"Temperature" };
315 static constexpr const char *description{ R
"description(Current temperature(s))description" };
325 static constexpr const char *path{
"Temperature/DMD" };
328 static constexpr const char *name{
"DMD" };
331 static constexpr const char *description{ R
"description(DMD temperature)description" };
339 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
346 explicit constexpr DMD(
double value)
359 return m_value == other.m_value;
365 return m_value != other.m_value;
371 return m_value < other.m_value;
377 return m_value > other.m_value;
387 void setFromString(
const std::string &value);
389 double m_value{ 0.0 };
391 friend struct DataModel::Detail::Befriend<
DMD>;
402 static constexpr const char *path{
"Temperature/General" };
405 static constexpr const char *name{
"General" };
408 static constexpr const char *description{ R
"description(General temperature)description" };
416 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
436 return m_value == other.m_value;
442 return m_value != other.m_value;
448 return m_value < other.m_value;
454 return m_value > other.m_value;
464 void setFromString(
const std::string &value);
466 double m_value{ 0.0 };
468 friend struct DataModel::Detail::Befriend<
General>;
479 static constexpr const char *path{
"Temperature/LED" };
482 static constexpr const char *name{
"LED" };
485 static constexpr const char *description{ R
"description(LED temperature)description" };
493 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
500 explicit constexpr LED(
double value)
513 return m_value == other.m_value;
519 return m_value != other.m_value;
525 return m_value < other.m_value;
531 return m_value > other.m_value;
541 void setFromString(
const std::string &value);
543 double m_value{ 0.0 };
545 friend struct DataModel::Detail::Befriend<
LED>;
556 static constexpr const char *path{
"Temperature/Lens" };
559 static constexpr const char *name{
"Lens" };
562 static constexpr const char *description{ R
"description(Lens temperature)description" };
570 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
577 explicit constexpr Lens(
double value)
590 return m_value == other.m_value;
596 return m_value != other.m_value;
602 return m_value < other.m_value;
608 return m_value > other.m_value;
618 void setFromString(
const std::string &value);
620 double m_value{ 0.0 };
622 friend struct DataModel::Detail::Befriend<
Lens>;
633 static constexpr const char *path{
"Temperature/PCB" };
636 static constexpr const char *name{
"PCB" };
639 static constexpr const char *description{ R
"description(PCB temperature)description" };
647 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
654 explicit constexpr PCB(
double value)
667 return m_value == other.m_value;
673 return m_value != other.m_value;
679 return m_value < other.m_value;
685 return m_value > other.m_value;
695 void setFromString(
const std::string &value);
697 double m_value{ 0.0 };
699 friend struct DataModel::Detail::Befriend<
PCB>;
730 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
731 typename std::enable_if<
732 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
736 template<typename... Args>
740 using namespace Zivid::Detail::TypeTraits;
743 AllArgsDecayedAreUnique<Args...>::value,
744 "Found duplicate types among the arguments passed to Temperature(...). "
745 "Types should be listed at most once.");
747 set(std::forward<Args>(args)...);
765 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
767 template<typename... Args>
771 using namespace Zivid::Detail::TypeTraits;
773 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
775 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
778 AllArgsDecayedAreUnique<Args...>::value,
779 "Found duplicate types among the arguments passed to set(...). "
780 "Types should be listed at most once.");
782 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
801 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
803 template<typename... Args>
807 using namespace Zivid::Detail::TypeTraits;
809 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
811 AllArgsAreDescendantNodes::value,
812 "All arguments passed to copyWith(...) must be descendant nodes.");
815 AllArgsDecayedAreUnique<Args...>::value,
816 "Found duplicate types among the arguments passed to copyWith(...). "
817 "Types should be listed at most once.");
820 copy.
set(std::forward<Args>(args)...);
921 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
929 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
937 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
945 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
953 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
959 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
965 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
971 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
977 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
983 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1001 template<
typename F>
1027 void setFromString(
const std::string &value);
1029 void setFromString(
const std::string &fullPath,
const std::string &value);
1031 std::string getString(
const std::string &fullPath)
const;
1039 friend struct DataModel::Detail::Befriend<
Temperature>;
1079 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1080 typename std::enable_if<
1081 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::value,
1084 template<typename... Args>
1088 using namespace Zivid::Detail::TypeTraits;
1091 AllArgsDecayedAreUnique<Args...>::value,
1092 "Found duplicate types among the arguments passed to CameraState(...). "
1093 "Types should be listed at most once.");
1095 set(std::forward<Args>(args)...);
1116 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1118 template<typename... Args>
1122 using namespace Zivid::Detail::TypeTraits;
1124 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1126 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
1129 AllArgsDecayedAreUnique<Args...>::value,
1130 "Found duplicate types among the arguments passed to set(...). "
1131 "Types should be listed at most once.");
1133 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1155 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1157 template<typename... Args>
1161 using namespace Zivid::Detail::TypeTraits;
1163 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1165 AllArgsAreDescendantNodes::value,
"All arguments passed to copyWith(...) must be descendant nodes.");
1168 AllArgsDecayedAreUnique<Args...>::value,
1169 "Found duplicate types among the arguments passed to copyWith(...). "
1170 "Types should be listed at most once.");
1173 copy.
set(std::forward<Args>(args)...);
1192 m_available = value;
1211 m_connected = value;
1218 return m_temperature;
1224 return m_temperature;
1230 m_temperature = value;
1237 m_temperature.
set(value);
1244 m_temperature.
set(value);
1251 m_temperature.
set(value);
1258 m_temperature.
set(value);
1265 m_temperature.
set(value);
1269 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Available>::value,
int>::type = 0>
1275 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Connected>::value,
int>::type = 0>
1281 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Temperature>::value,
int>::type = 0>
1284 return m_temperature;
1289 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
1297 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
1305 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
1313 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
1321 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
1327 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1333 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1339 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1342 return m_temperature;
1346 template<
typename F>
1355 template<
typename F>
1379 void save(
const std::string &fileName)
const;
1382 void load(
const std::string &fileName);
1385 void setFromString(
const std::string &value);
1387 void setFromString(
const std::string &fullPath,
const std::string &value);
1389 std::string getString(
const std::string &fullPath)
const;
1395 friend struct DataModel::Detail::Befriend<
CameraState>;
1400 struct CameraState::Version<2>
1409# pragma warning(pop)
1413# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1418 struct tuple_size<
Zivid::CameraState::Temperature> : integral_constant<size_t, 5>
1422 struct tuple_element<i,
Zivid::CameraState::Temperature>
1424 static_assert(i < tuple_size<Zivid::CameraState::Temperature>::value,
"Index must be less than 5");
1427 =
decltype(declval<Zivid::CameraState::Temperature>().get<i>());
1431 struct tuple_size<
Zivid::CameraState> : integral_constant<size_t, 3>
1435 struct tuple_element<i,
Zivid::CameraState>
1437 static_assert(i < tuple_size<Zivid::CameraState>::value,
"Index must be less than 3");
1440 =
decltype(declval<Zivid::CameraState>().get<i>());
1449#if defined(__has_include) && !defined(NO_DOC)
1450# if __has_include("Zivid/CameraStateInternal.h") && __has_include("Zivid/DataModelSerializationMetaData.h")
1451# include "Zivid/CameraStateInternal.h"
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Flag if camera is physically connected to the computer, but not connected in software....
Definition: CameraState.h:153
static std::set< bool > validValues()
All valid values of Available
Definition: CameraState.h:175
static const Available no
Off/disabled.
Definition: CameraState.h:172
bool operator==(const Available &other) const
Comparison operator
Definition: CameraState.h:201
std::string toString() const
Get the value as string
bool ValueType
The type of the underlying value
Definition: CameraState.h:170
static const Available yes
On/enabled.
Definition: CameraState.h:171
friend std::ostream & operator<<(std::ostream &stream, const Available &value)
Operator to serialize the value to a stream
Definition: CameraState.h:213
bool operator!=(const Available &other) const
Comparison operator
Definition: CameraState.h:207
constexpr Available(bool value)
Constructor
Definition: CameraState.h:184
bool value() const
Get the value
Available()=default
Default constructor
Flag if camera is connected in software
Definition: CameraState.h:228
Connected()=default
Default constructor
static const Connected yes
On/enabled.
Definition: CameraState.h:246
static const Connected no
Off/disabled.
Definition: CameraState.h:247
bool operator!=(const Connected &other) const
Comparison operator
Definition: CameraState.h:282
constexpr Connected(bool value)
Constructor
Definition: CameraState.h:259
bool value() const
Get the value
std::string toString() const
Get the value as string
friend std::ostream & operator<<(std::ostream &stream, const Connected &value)
Operator to serialize the value to a stream
Definition: CameraState.h:288
static std::set< bool > validValues()
All valid values of Connected
Definition: CameraState.h:250
bool operator==(const Connected &other) const
Comparison operator
Definition: CameraState.h:276
bool ValueType
The type of the underlying value
Definition: CameraState.h:245
DMD temperature
Definition: CameraState.h:319
bool operator>(const DMD &other) const
Comparison operator
Definition: CameraState.h:375
std::string toString() const
Get the value as string
double value() const
Get the value
bool operator!=(const DMD &other) const
Comparison operator
Definition: CameraState.h:363
bool operator<(const DMD &other) const
Comparison operator
Definition: CameraState.h:369
double ValueType
The type of the underlying value
Definition: CameraState.h:334
friend std::ostream & operator<<(std::ostream &stream, const DMD &value)
Operator to serialize the value to a stream
Definition: CameraState.h:381
constexpr DMD(double value)
Constructor
Definition: CameraState.h:346
bool operator==(const DMD &other) const
Comparison operator
Definition: CameraState.h:357
static constexpr Range< double > validRange()
The range of valid values for DMD
Definition: CameraState.h:337
DMD()=default
Default constructor
General temperature
Definition: CameraState.h:396
double ValueType
The type of the underlying value
Definition: CameraState.h:411
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:446
constexpr General(double value)
Constructor
Definition: CameraState.h:423
static constexpr Range< double > validRange()
The range of valid values for General
Definition: CameraState.h:414
bool operator==(const General &other) const
Comparison operator
Definition: CameraState.h:434
General()=default
Default constructor
bool operator!=(const General &other) const
Comparison operator
Definition: CameraState.h:440
bool operator>(const General &other) const
Comparison operator
Definition: CameraState.h:452
friend std::ostream & operator<<(std::ostream &stream, const General &value)
Operator to serialize the value to a stream
Definition: CameraState.h:458
LED temperature
Definition: CameraState.h:473
std::string toString() const
Get the value as string
bool operator<(const LED &other) const
Comparison operator
Definition: CameraState.h:523
double value() const
Get the value
LED()=default
Default constructor
constexpr LED(double value)
Constructor
Definition: CameraState.h:500
friend std::ostream & operator<<(std::ostream &stream, const LED &value)
Operator to serialize the value to a stream
Definition: CameraState.h:535
bool operator!=(const LED &other) const
Comparison operator
Definition: CameraState.h:517
bool operator==(const LED &other) const
Comparison operator
Definition: CameraState.h:511
bool operator>(const LED &other) const
Comparison operator
Definition: CameraState.h:529
static constexpr Range< double > validRange()
The range of valid values for LED
Definition: CameraState.h:491
double ValueType
The type of the underlying value
Definition: CameraState.h:488
Lens temperature
Definition: CameraState.h:550
double ValueType
The type of the underlying value
Definition: CameraState.h:565
bool operator==(const Lens &other) const
Comparison operator
Definition: CameraState.h:588
Lens()=default
Default constructor
double value() const
Get the value
bool operator>(const Lens &other) const
Comparison operator
Definition: CameraState.h:606
bool operator!=(const Lens &other) const
Comparison operator
Definition: CameraState.h:594
std::string toString() const
Get the value as string
constexpr Lens(double value)
Constructor
Definition: CameraState.h:577
static constexpr Range< double > validRange()
The range of valid values for Lens
Definition: CameraState.h:568
bool operator<(const Lens &other) const
Comparison operator
Definition: CameraState.h:600
friend std::ostream & operator<<(std::ostream &stream, const Lens &value)
Operator to serialize the value to a stream
Definition: CameraState.h:612
PCB temperature
Definition: CameraState.h:627
bool operator!=(const PCB &other) const
Comparison operator
Definition: CameraState.h:671
constexpr PCB(double value)
Constructor
Definition: CameraState.h:654
static constexpr Range< double > validRange()
The range of valid values for PCB
Definition: CameraState.h:645
PCB()=default
Default constructor
friend std::ostream & operator<<(std::ostream &stream, const PCB &value)
Operator to serialize the value to a stream
Definition: CameraState.h:689
bool operator==(const PCB &other) const
Comparison operator
Definition: CameraState.h:665
double value() const
Get the value
bool operator>(const PCB &other) const
Comparison operator
Definition: CameraState.h:683
double ValueType
The type of the underlying value
Definition: CameraState.h:642
std::string toString() const
Get the value as string
bool operator<(const PCB &other) const
Comparison operator
Definition: CameraState.h:677
Current temperature(s)
Definition: CameraState.h:303
DMD & dmd()
Get DMD
Definition: CameraState.h:831
Temperature & set(const General &value)
Set General
Definition: CameraState.h:856
const PCB & pcb() const
Get PCB
Definition: CameraState.h:901
const CameraState::Temperature::Lens & get() const
Definition: CameraState.h:946
Temperature & set(const Lens &value)
Set Lens
Definition: CameraState.h:894
const CameraState::Temperature::DMD & get() const
Definition: CameraState.h:922
const CameraState::Temperature::PCB & get() const
Definition: CameraState.h:954
const CameraState::Temperature::General & get() const
Definition: CameraState.h:930
Temperature & set(const PCB &value)
Set PCB
Definition: CameraState.h:913
const General & general() const
Get General
Definition: CameraState.h:844
bool operator!=(const Temperature &other) const
Inequality operator
const LED & led() const
Get LED
Definition: CameraState.h:863
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:991
Temperature(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraState.h:738
friend std::ostream & operator<<(std::ostream &stream, const Temperature &value)
Operator to send the value as string to a stream
Definition: CameraState.h:1021
std::tuple< CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition: CameraState.h:707
Temperature & set(const LED &value)
Set LED
Definition: CameraState.h:875
std::string toString() const
Get the value as string
LED & led()
Get LED
Definition: CameraState.h:869
bool operator==(const Temperature &other) const
Equality operator
const Lens & lens() const
Get Lens
Definition: CameraState.h:882
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:805
General & general()
Get General
Definition: CameraState.h:850
void set(Args &&...args)
Set multiple arguments
Definition: CameraState.h:769
const DMD & dmd() const
Get DMD
Definition: CameraState.h:825
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:1002
const CameraState::Temperature::LED & get() const
Definition: CameraState.h:938
Lens & lens()
Get Lens
Definition: CameraState.h:888
Temperature()
Default constructor
Temperature & set(const DMD &value)
Set DMD
Definition: CameraState.h:837
PCB & pcb()
Get PCB
Definition: CameraState.h:907
Information about camera connection state, temperatures, etc.
Definition: CameraState.h:121
const Temperature & temperature() const
Get Temperature
Definition: CameraState.h:1216
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:1159
const CameraState::Temperature::Lens & get() const
Definition: CameraState.h:1314
void load(const std::string &fileName)
Load from the given file
CameraState(const std::string &fileName)
Construct CameraState by loading from file
CameraState & set(const Temperature &value)
Set Temperature
Definition: CameraState.h:1228
const CameraState::Connected & get() const
Definition: CameraState.h:1276
Temperature & temperature()
Get Temperature
Definition: CameraState.h:1222
const CameraState::Temperature::General & get() const
Definition: CameraState.h:1298
std::string toString() const
Get the value as string
const CameraState::Available & get() const
Definition: CameraState.h:1270
std::tuple< CameraState::Available, CameraState::Connected, CameraState::Temperature, CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition: CameraState.h:1050
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:1356
void save(const std::string &fileName) const
Save to the given file
const CameraState::Temperature::PCB & get() const
Definition: CameraState.h:1322
CameraState & set(const Temperature::PCB &value)
Set Temperature::PCB
Definition: CameraState.h:1263
const CameraState::Temperature::LED & get() const
Definition: CameraState.h:1306
CameraState & set(const Temperature::General &value)
Set Temperature::General
Definition: CameraState.h:1242
friend std::ostream & operator<<(std::ostream &stream, const CameraState &value)
Operator to send the value as string to a stream
Definition: CameraState.h:1373
bool operator!=(const CameraState &other) const
Inequality operator
const Available & isAvailable() const
Get Available
Definition: CameraState.h:1178
Connected & isConnected()
Get Connected
Definition: CameraState.h:1203
CameraState & set(const Temperature::Lens &value)
Set Temperature::Lens
Definition: CameraState.h:1256
CameraState & set(const Available &value)
Set Available
Definition: CameraState.h:1190
CameraState & set(const Temperature::DMD &value)
Set Temperature::DMD
Definition: CameraState.h:1235
bool operator==(const CameraState &other) const
Equality operator
CameraState()
Default constructor
CameraState & set(const Connected &value)
Set Connected
Definition: CameraState.h:1209
CameraState(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraState.h:1086
const CameraState::Temperature & get() const
Definition: CameraState.h:1282
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:1347
void set(Args &&...args)
Set multiple arguments
Definition: CameraState.h:1120
CameraState & set(const Temperature::LED &value)
Set Temperature::LED
Definition: CameraState.h:1249
const CameraState::Temperature::DMD & get() const
Definition: CameraState.h:1290
const Connected & isConnected() const
Get Connected
Definition: CameraState.h:1197
Available & isAvailable()
Get Available
Definition: CameraState.h:1184
Class describing a range of values for a given type T
Definition: Range.h:102
NodeType
Definition: NodeType.h:100
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99