32 #pragma warning(disable : 4251) 46 static constexpr
bool isContainer{
true};
49 static constexpr
const char *path{
""};
52 static constexpr
const char *name{
"CameraState"};
55 void set(
const std::string &fullPath,
const std::string &value);
58 std::string getString(
const std::string &fullPath)
const;
69 static constexpr
bool isContainer{
false};
72 static constexpr
const char *path{
"Connected"};
75 static constexpr
const char *name{
"Connected"};
82 std::is_nothrow_move_constructible<ValueType>::value)
89 void setFromString(
const std::string &value) { m_value = (value ==
"yes"); }
92 std::string
toString()
const {
return m_value ?
"yes" :
"no"; }
95 explicit operator bool()
const {
return m_value; }
99 return m_value == other.m_value;
104 return m_value != other.m_value;
115 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
116 std::istreambuf_iterator<char>{}});
133 static constexpr
bool isContainer{
false};
136 static constexpr
const char *path{
"Available"};
139 static constexpr
const char *name{
"Available"};
146 std::is_nothrow_move_constructible<ValueType>::value)
153 void setFromString(
const std::string &value) { m_value = (value ==
"yes"); }
156 std::string
toString()
const {
return m_value ?
"yes" :
"no"; }
159 explicit operator bool()
const {
return m_value; }
163 return m_value == other.m_value;
168 return m_value != other.m_value;
179 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
180 std::istreambuf_iterator<char>{}});
197 static constexpr
bool isContainer{
false};
200 static constexpr
const char *path{
"Live"};
203 static constexpr
const char *name{
"Live"};
210 std::is_nothrow_move_constructible<ValueType>::value)
217 void setFromString(
const std::string &value) { m_value = (value ==
"yes"); }
220 std::string
toString()
const {
return m_value ?
"yes" :
"no"; }
223 explicit operator bool()
const {
return m_value; }
227 return m_value == other.m_value;
232 return m_value != other.m_value;
242 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
243 std::istreambuf_iterator<char>{}});
260 static constexpr
bool isContainer{
true};
263 static constexpr
const char *path{
"Temperature"};
266 static constexpr
const char *name{
"Temperature"};
269 void set(
const std::string &fullPath,
const std::string &value);
272 std::string getString(
const std::string &fullPath)
const;
281 static constexpr
bool isContainer{
false};
284 static constexpr
const char *path{
"Temperature/General"};
287 static constexpr
const char *name{
"General"};
294 std::is_nothrow_move_constructible<ValueType>::value)
302 return {std::numeric_limits<ValueType>::lowest(),
303 std::numeric_limits<ValueType>::max()};
308 m_value = std::stod(value);
312 std::string
toString()
const {
return std::to_string(m_value); }
316 return m_value == other.m_value;
321 return m_value != other.m_value;
326 return m_value < other.m_value;
331 return m_value > other.m_value;
342 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
343 std::istreambuf_iterator<char>{}});
358 static constexpr
bool isContainer{
false};
361 static constexpr
const char *path{
"Temperature/Lens"};
364 static constexpr
const char *name{
"Lens"};
371 std::is_nothrow_move_constructible<ValueType>::value)
379 return {std::numeric_limits<ValueType>::lowest(),
380 std::numeric_limits<ValueType>::max()};
385 m_value = std::stod(value);
389 std::string
toString()
const {
return std::to_string(m_value); }
393 return m_value == other.m_value;
398 return m_value != other.m_value;
403 return m_value < other.m_value;
408 return m_value > other.m_value;
418 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
419 std::istreambuf_iterator<char>{}});
434 static constexpr
bool isContainer{
false};
437 static constexpr
const char *path{
"Temperature/LED"};
440 static constexpr
const char *name{
"LED"};
447 std::is_nothrow_move_constructible<ValueType>::value)
455 return {std::numeric_limits<ValueType>::lowest(),
456 std::numeric_limits<ValueType>::max()};
461 m_value = std::stod(value);
465 std::string
toString()
const {
return std::to_string(m_value); }
469 return m_value == other.m_value;
474 return m_value != other.m_value;
478 bool operator<(
const LED &other)
const {
return m_value < other.m_value; }
481 bool operator>(
const LED &other)
const {
return m_value > other.m_value; }
490 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
491 std::istreambuf_iterator<char>{}});
506 static constexpr
bool isContainer{
false};
509 static constexpr
const char *path{
"Temperature/PCB"};
512 static constexpr
const char *name{
"PCB"};
519 std::is_nothrow_move_constructible<ValueType>::value)
527 return {std::numeric_limits<ValueType>::lowest(),
528 std::numeric_limits<ValueType>::max()};
533 m_value = std::stod(value);
537 std::string
toString()
const {
return std::to_string(m_value); }
541 return m_value == other.m_value;
546 return m_value != other.m_value;
550 bool operator<(
const PCB &other)
const {
return m_value < other.m_value; }
553 bool operator>(
const PCB &other)
const {
return m_value > other.m_value; }
562 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
563 std::istreambuf_iterator<char>{}});
578 static constexpr
bool isContainer{
false};
581 static constexpr
const char *path{
"Temperature/DMD"};
584 static constexpr
const char *name{
"DMD"};
591 std::is_nothrow_move_constructible<ValueType>::value)
599 return {std::numeric_limits<ValueType>::lowest(),
600 std::numeric_limits<ValueType>::max()};
605 m_value = std::stod(value);
609 std::string
toString()
const {
return std::to_string(m_value); }
613 return m_value == other.m_value;
618 return m_value != other.m_value;
622 bool operator<(
const DMD &other)
const {
return m_value < other.m_value; }
625 bool operator>(
const DMD &other)
const {
return m_value > other.m_value; }
634 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
635 std::istreambuf_iterator<char>{}});
650 if (value.value() < value.range().min() ||
651 value.value() > value.range().max()) {
652 throw std::out_of_range(
653 "Temperature: " + std::to_string(value.value()) +
654 ", is out of range: {" + std::to_string(value.range().min()) +
655 ", " + std::to_string(value.range().max()) +
"}");
671 if (value.value() < value.range().min() ||
672 value.value() > value.range().max()) {
673 throw std::out_of_range(
674 "Temperature: " + std::to_string(value.value()) +
675 ", is out of range: {" + std::to_string(value.range().min()) +
676 ", " + std::to_string(value.range().max()) +
"}");
692 if (value.value() < value.range().min() ||
693 value.value() > value.range().max()) {
694 throw std::out_of_range(
695 "Temperature: " + std::to_string(value.value()) +
696 ", is out of range: {" + std::to_string(value.range().min()) +
697 ", " + std::to_string(value.range().max()) +
"}");
713 if (value.value() < value.range().min() ||
714 value.value() > value.range().max()) {
715 throw std::out_of_range(
716 "Temperature: " + std::to_string(value.value()) +
717 ", is out of range: {" + std::to_string(value.range().min()) +
718 ", " + std::to_string(value.range().max()) +
"}");
734 if (value.value() < value.range().min() ||
735 value.value() > value.range().max()) {
736 throw std::out_of_range(
737 "Temperature: " + std::to_string(value.value()) +
738 ", is out of range: {" + std::to_string(value.range().min()) +
739 ", " + std::to_string(value.range().max()) +
"}");
750 template <
typename F>
void forEach(
const F &f)
const {
760 template <
typename F>
void forEach(
const F &f) {
798 void save(
const std::string &fileName)
const;
801 void setFromString(
const std::string &value);
805 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
806 std::istreambuf_iterator<char>{}});
811 void load(
const std::string &fileName);
866 m_temperature = value;
875 if (value.value() < value.range().min() ||
876 value.value() > value.range().max()) {
877 throw std::out_of_range(
"CameraState: " + std::to_string(value.value()) +
878 ", is out of range: {" +
879 std::to_string(value.range().min()) +
", " +
880 std::to_string(value.range().max()) +
"}");
883 m_temperature.set(value);
890 if (value.value() < value.range().min() ||
891 value.value() > value.range().max()) {
892 throw std::out_of_range(
"CameraState: " + std::to_string(value.value()) +
893 ", is out of range: {" +
894 std::to_string(value.range().min()) +
", " +
895 std::to_string(value.range().max()) +
"}");
898 m_temperature.set(value);
905 if (value.value() < value.range().min() ||
906 value.value() > value.range().max()) {
907 throw std::out_of_range(
"CameraState: " + std::to_string(value.value()) +
908 ", is out of range: {" +
909 std::to_string(value.range().min()) +
", " +
910 std::to_string(value.range().max()) +
"}");
913 m_temperature.set(value);
920 if (value.value() < value.range().min() ||
921 value.value() > value.range().max()) {
922 throw std::out_of_range(
"CameraState: " + std::to_string(value.value()) +
923 ", is out of range: {" +
924 std::to_string(value.range().min()) +
", " +
925 std::to_string(value.range().max()) +
"}");
928 m_temperature.set(value);
935 if (value.value() < value.range().min() ||
936 value.value() > value.range().max()) {
937 throw std::out_of_range(
"CameraState: " + std::to_string(value.value()) +
938 ", is out of range: {" +
939 std::to_string(value.range().min()) +
", " +
940 std::to_string(value.range().max()) +
"}");
943 m_temperature.set(value);
949 template <
typename F>
void forEach(
const F &f)
const {
958 template <
typename F>
void forEach(
const F &f) {
971 m_temperature.traverseValues(f);
980 m_temperature.traverseValues(f);
993 void save(
const std::string &fileName)
const;
996 void setFromString(
const std::string &value);
1000 value.
setFromString(std::string{std::istreambuf_iterator<char>{stream},
1001 std::istreambuf_iterator<char>{}});
1006 void load(
const std::string &fileName);
1017 #pragma warning(pop) const Lens & lens() const
Get Lens
Definition: CameraState.h:683
friend std::istream & operator>>(std::istream &stream, CameraState &value)
Operator to set the value from a stream
Definition: CameraState.h:999
bool operator!=(const LED &other) const
Comparison operator
Definition: CameraState.h:473
Range< ValueType > range() const
The range of valid values
Definition: CameraState.h:301
static const Connected no
Off/disabled.
Definition: CameraState.h:66
constexpr Available(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: CameraState.h:145
static const Connected yes
On/enabled.
Definition: CameraState.h:65
Flag if camera is available for use or not
Definition: CameraState.h:125
const ValueType & value() const
Get the value
Definition: CameraState.h:523
friend std::ostream & operator<<(std::ostream &stream, const PCB &value)
Operator to serialize the value to a stream
Definition: CameraState.h:556
constexpr Lens(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: CameraState.h:370
friend std::ostream & operator<<(std::ostream &stream, const Live &value)
Operator to serialize the value to a stream
Definition: CameraState.h:236
friend std::istream & operator>>(std::istream &stream, DMD &value)
Operator to set the value from a stream
Definition: CameraState.h:633
std::string toString() const
Get the value as string
Definition: CameraState.h:312
void setFromString(const std::string &value)
Set the value from string
Definition: CameraState.h:604
friend std::ostream & operator<<(std::ostream &stream, const Temperature &value)
Operator to send the value as string to a stream
Definition: CameraState.h:792
friend std::istream & operator>>(std::istream &stream, General &value)
Operator to set the value from a stream
Definition: CameraState.h:341
std::string toString() const
Get the value as string
friend std::istream & operator>>(std::istream &stream, PCB &value)
Operator to set the value from a stream
Definition: CameraState.h:561
double ValueType
The type of the underlying value
Definition: CameraState.h:575
bool operator<(const General &other) const
Comparison operator
Definition: CameraState.h:325
friend std::ostream & operator<<(std::ostream &stream, const Available &value)
Operator to serialize the value to a stream
Definition: CameraState.h:172
friend std::istream & operator>>(std::istream &stream, Lens &value)
Operator to set the value from a stream
Definition: CameraState.h:417
bool operator!=(const General &other) const
Comparison operator
Definition: CameraState.h:320
DMD temperature
Definition: CameraState.h:572
Class describing a range of values for a given type T The range boudaries for both minimum and maximu...
Definition: Range.h:24
std::string toString() const
Get the value as string
bool ValueType
The type of the underlying value
Definition: CameraState.h:128
const General & general() const
Get General
Definition: CameraState.h:662
friend std::ostream & operator<<(std::ostream &stream, const LED &value)
Operator to serialize the value to a stream
Definition: CameraState.h:484
bool operator<(const PCB &other) const
Comparison operator
Definition: CameraState.h:550
bool operator!=(const PCB &other) const
Comparison operator
Definition: CameraState.h:545
constexpr Connected(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: CameraState.h:81
friend std::ostream & operator<<(std::ostream &stream, const Connected &value)
Operator to serialize the value to a stream
Definition: CameraState.h:108
std::string toString() const
Get the value as string
Definition: CameraState.h:92
Flag if camera is initialized or not
Definition: CameraState.h:61
friend std::ostream & operator<<(std::ostream &stream, const Lens &value)
Operator to serialize the value to a stream
Definition: CameraState.h:412
const ValueType & value() const
Get the value
Definition: CameraState.h:595
void traverseValues(const F &f) const
Traverse the entire tree using the given function with the value of the member as parameter...
Definition: CameraState.h:770
static const Available yes
On/enabled.
Definition: CameraState.h:129
const ValueType & value() const
Get the value
Definition: CameraState.h:375
bool operator==(const PCB &other) const
Comparison operator
Definition: CameraState.h:540
bool operator<(const LED &other) const
Comparison operator
Definition: CameraState.h:478
double ValueType
The type of the underlying value
Definition: CameraState.h:355
const ValueType & value() const
Get the value
Definition: CameraState.h:150
const ValueType & value() const
Get the value
Definition: CameraState.h:214
void setFromString(const std::string &value)
Set the value from string
Definition: CameraState.h:307
void setFromString(const std::string &value)
Set the value from string
Definition: CameraState.h:384
static const Live yes
On/enabled.
Definition: CameraState.h:193
std::string toString() const
Get the value as string
Definition: CameraState.h:389
Range< ValueType > range() const
The range of valid values
Definition: CameraState.h:454
bool operator>(const General &other) const
Comparison operator
Definition: CameraState.h:330
friend std::ostream & operator<<(std::ostream &stream, const DMD &value)
Operator to serialize the value to a stream
Definition: CameraState.h:628
void traverseValues(const F &f)
Traverse all members using the given function with the value of the member as parameter
Definition: CameraState.h:976
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:958
const Live & live() const
Get Live
Definition: CameraState.h:857
void setFromString(const std::string &value)
Set from the given string
void setFromString(const std::string &value)
Set the value from string
Definition: CameraState.h:217
const LED & led() const
Get LED
Definition: CameraState.h:704
bool operator>(const DMD &other) const
Comparison operator
Definition: CameraState.h:625
double ValueType
The type of the underlying value
Definition: CameraState.h:503
General temperature
Definition: CameraState.h:275
bool operator!=(const DMD &other) const
Comparison operator
Definition: CameraState.h:617
double ValueType
The type of the underlying value
Definition: CameraState.h:431
Camera live status
Definition: CameraState.h:189
const PCB & pcb() const
Get PCB
Definition: CameraState.h:725
Definition: Application.h:19
friend std::istream & operator>>(std::istream &stream, Live &value)
Operator to set the value from a stream
Definition: CameraState.h:241
void traverseValues(const F &f) const
Traverse the entire tree using the given function with the value of the member as parameter...
Definition: CameraState.h:967
bool operator==(const DMD &other) const
Comparison operator
Definition: CameraState.h:612
bool operator==(const Lens &other) const
Comparison operator
Definition: CameraState.h:392
const Connected & isConnected() const
Get Connected
Definition: CameraState.h:831
void traverseValues(const F &f)
Traverse all members using the given function with the value of the member as parameter
Definition: CameraState.h:780
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:750
friend std::istream & operator>>(std::istream &stream, LED &value)
Operator to set the value from a stream
Definition: CameraState.h:489
Definitions for export of DLL interfaces
PCB temperature
Definition: CameraState.h:500
static const Live no
Off/disabled.
Definition: CameraState.h:194
Range< ValueType > range() const
The range of valid values
Definition: CameraState.h:526
Range< ValueType > range() const
The range of valid values
Definition: CameraState.h:378
bool operator>(const PCB &other) const
Comparison operator
Definition: CameraState.h:553
void setFromString(const std::string &value)
Set the value from string
Definition: CameraState.h:532
constexpr PCB(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: CameraState.h:518
Class describing a range of values
std::string toString() const
Get the value as string
Definition: CameraState.h:220
std::string toString() const
Get the value as string
Definition: CameraState.h:609
constexpr General(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: CameraState.h:293
const ValueType & value() const
Get the value
Definition: CameraState.h:298
ZIVID_COMMON std::string toString(const std::exception &exception)
Get string representation of the exception
Range< ValueType > range() const
The range of valid values
Definition: CameraState.h:598
const ValueType & value() const
Get the value
Definition: CameraState.h:86
friend std::istream & operator>>(std::istream &stream, Connected &value)
Operator to set the value from a stream
Definition: CameraState.h:114
friend std::istream & operator>>(std::istream &stream, Temperature &value)
Operator to set the value from a stream
Definition: CameraState.h:804
friend std::ostream & operator<<(std::ostream &stream, const General &value)
Operator to serialize the value to a stream
Definition: CameraState.h:335
std::string toString() const
Get the value as string
Definition: CameraState.h:537
bool operator>(const Lens &other) const
Comparison operator
Definition: CameraState.h:407
constexpr DMD(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: CameraState.h:590
Current temperature(s)
Definition: CameraState.h:252
bool operator==(const LED &other) const
Comparison operator
Definition: CameraState.h:468
bool ValueType
The type of the underlying value
Definition: CameraState.h:64
friend std::ostream & operator<<(std::ostream &stream, const CameraState &value)
Operator to send the value as string to a stream
Definition: CameraState.h:987
std::string toString() const
Get the value as string
Definition: CameraState.h:465
bool operator<(const Lens &other) const
Comparison operator
Definition: CameraState.h:402
const ValueType & value() const
Get the value
Definition: CameraState.h:451
bool operator==(const Connected &other) const
Comparison operator
Definition: CameraState.h:98
double ValueType
The type of the underlying value
Definition: CameraState.h:278
constexpr Live(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: CameraState.h:209
const Temperature & temperature() const
Get Temperature
Definition: CameraState.h:870
bool operator!=(const Lens &other) const
Comparison operator
Definition: CameraState.h:397
bool ValueType
The type of the underlying value
Definition: CameraState.h:192
const DMD & dmd() const
Get DMD
Definition: CameraState.h:746
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:949
bool operator==(const General &other) const
Comparison operator
Definition: CameraState.h:315
bool operator>(const LED &other) const
Comparison operator
Definition: CameraState.h:481
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:760
LED temperature
Definition: CameraState.h:428
bool operator<(const DMD &other) const
Comparison operator
Definition: CameraState.h:622
bool operator!=(const Connected &other) const
Comparison operator
Definition: CameraState.h:103
void setFromString(const std::string &value)
Set the value from string
Definition: CameraState.h:153
friend std::istream & operator>>(std::istream &stream, Available &value)
Operator to set the value from a stream
Definition: CameraState.h:178
Lens temperature
Definition: CameraState.h:352
constexpr LED(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: CameraState.h:446
void setFromString(const std::string &value)
Set from the given string
const Available & isAvailable() const
Get Available
Definition: CameraState.h:844
bool operator!=(const Available &other) const
Comparison operator
Definition: CameraState.h:167
bool operator==(const Live &other) const
Comparison operator
Definition: CameraState.h:226
Information about camera connection state, live mode, temperatures, etc.
Definition: CameraState.h:38
static const Available no
Off/disabled.
Definition: CameraState.h:130
void setFromString(const std::string &value)
Set the value from string
Definition: CameraState.h:460
bool operator==(const Available &other) const
Comparison operator
Definition: CameraState.h:162
void setFromString(const std::string &value)
Set the value from string
Definition: CameraState.h:89
std::string toString() const
Get the value as string
Definition: CameraState.h:156
bool operator!=(const Live &other) const
Comparison operator
Definition: CameraState.h:231