Zivid  1.0.1+3607.8a7510c4
Zivid API
CameraState.h
Go to the documentation of this file.
1 /*[
2  * This file is part of the Zivid 3D Camera API
3  *
4  * Copyright 2015-2018 (C) Zivid Labs. All rights reserved.
5  * Contact info@zividlabs.com or see http://www.zividlabs.com
6  *
7  * This code is proprietary and confidential.
8  * Unauthorized copying of this file, via any medium is strictly prohibited.
9 ]*/
10 
11 #pragma once
12 
16 
17 #include <chrono>
18 #include <ctime>
19 #include <iomanip>
20 #include <memory>
21 #include <ostream>
22 #include <sstream>
23 #include <string>
24 #include <utility>
25 #include <vector>
26 
27 #include "APIExport.h"
28 #include "Range.h"
29 
30 #ifdef _MSC_VER
31 #pragma warning(push)
32 #pragma warning(disable : 4251)
33 #endif
34 
35 namespace Zivid {
38 class ZIVID_COMMON CameraState {
39 public:
40  CameraState() = default;
41 
43  explicit CameraState(const std::string &fileName);
44 
46  static constexpr bool isContainer{true};
47 
49  static constexpr const char *path{""};
50 
52  static constexpr const char *name{"CameraState"};
53 
55  void set(const std::string &fullPath, const std::string &value);
56 
58  std::string getString(const std::string &fullPath) const;
59 
61  class ZIVID_COMMON Connected {
62  public:
64  using ValueType = bool;
65  static const Connected yes;
66  static const Connected no;
67 
69  static constexpr bool isContainer{false};
70 
72  static constexpr const char *path{"Connected"};
73 
75  static constexpr const char *name{"Connected"};
76 
78  Connected() = default;
79 
81  explicit constexpr Connected(ValueType value) noexcept(
82  std::is_nothrow_move_constructible<ValueType>::value)
83  : m_value{value} {}
84 
86  const ValueType &value() const { return m_value; }
87 
89  void setFromString(const std::string &value) { m_value = (value == "yes"); }
90 
92  std::string toString() const { return m_value ? "yes" : "no"; }
93 
95  explicit operator bool() const { return m_value; }
96 
98  bool operator==(const Connected &other) const {
99  return m_value == other.m_value;
100  }
101 
103  bool operator!=(const Connected &other) const {
104  return m_value != other.m_value;
105  }
106 
108  friend std::ostream &operator<<(std::ostream &stream,
109  const Connected &value) {
110  return stream << value.toString();
111  }
112 
114  friend std::istream &operator>>(std::istream &stream, Connected &value) {
115  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
116  std::istreambuf_iterator<char>{}});
117  return stream;
118  }
119 
120  private:
121  ValueType m_value{false};
122  };
123 
125  class ZIVID_COMMON Available {
126  public:
128  using ValueType = bool;
129  static const Available yes;
130  static const Available no;
131 
133  static constexpr bool isContainer{false};
134 
136  static constexpr const char *path{"Available"};
137 
139  static constexpr const char *name{"Available"};
140 
142  Available() = default;
143 
145  explicit constexpr Available(ValueType value) noexcept(
146  std::is_nothrow_move_constructible<ValueType>::value)
147  : m_value{value} {}
148 
150  const ValueType &value() const { return m_value; }
151 
153  void setFromString(const std::string &value) { m_value = (value == "yes"); }
154 
156  std::string toString() const { return m_value ? "yes" : "no"; }
157 
159  explicit operator bool() const { return m_value; }
160 
162  bool operator==(const Available &other) const {
163  return m_value == other.m_value;
164  }
165 
167  bool operator!=(const Available &other) const {
168  return m_value != other.m_value;
169  }
170 
172  friend std::ostream &operator<<(std::ostream &stream,
173  const Available &value) {
174  return stream << value.toString();
175  }
176 
178  friend std::istream &operator>>(std::istream &stream, Available &value) {
179  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
180  std::istreambuf_iterator<char>{}});
181  return stream;
182  }
183 
184  private:
185  ValueType m_value{false};
186  };
187 
189  class ZIVID_COMMON Live {
190  public:
192  using ValueType = bool;
193  static const Live yes;
194  static const Live no;
195 
197  static constexpr bool isContainer{false};
198 
200  static constexpr const char *path{"Live"};
201 
203  static constexpr const char *name{"Live"};
204 
206  Live() = default;
207 
209  explicit constexpr Live(ValueType value) noexcept(
210  std::is_nothrow_move_constructible<ValueType>::value)
211  : m_value{value} {}
212 
214  const ValueType &value() const { return m_value; }
215 
217  void setFromString(const std::string &value) { m_value = (value == "yes"); }
218 
220  std::string toString() const { return m_value ? "yes" : "no"; }
221 
223  explicit operator bool() const { return m_value; }
224 
226  bool operator==(const Live &other) const {
227  return m_value == other.m_value;
228  }
229 
231  bool operator!=(const Live &other) const {
232  return m_value != other.m_value;
233  }
234 
236  friend std::ostream &operator<<(std::ostream &stream, const Live &value) {
237  return stream << value.toString();
238  }
239 
241  friend std::istream &operator>>(std::istream &stream, Live &value) {
242  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
243  std::istreambuf_iterator<char>{}});
244  return stream;
245  }
246 
247  private:
248  ValueType m_value{false};
249  };
250 
252  class ZIVID_COMMON Temperature {
253  public:
254  Temperature() = default;
255 
257  explicit Temperature(const std::string &fileName);
258 
260  static constexpr bool isContainer{true};
261 
263  static constexpr const char *path{"Temperature"};
264 
266  static constexpr const char *name{"Temperature"};
267 
269  void set(const std::string &fullPath, const std::string &value);
270 
272  std::string getString(const std::string &fullPath) const;
273 
275  class ZIVID_COMMON General {
276  public:
278  using ValueType = double;
279 
281  static constexpr bool isContainer{false};
282 
284  static constexpr const char *path{"Temperature/General"};
285 
287  static constexpr const char *name{"General"};
288 
290  General() = default;
291 
293  explicit constexpr General(ValueType value) noexcept(
294  std::is_nothrow_move_constructible<ValueType>::value)
295  : m_value{value} {}
296 
298  const ValueType &value() const { return m_value; }
299 
302  return {std::numeric_limits<ValueType>::lowest(),
303  std::numeric_limits<ValueType>::max()};
304  }
305 
307  void setFromString(const std::string &value) {
308  m_value = std::stod(value);
309  }
310 
312  std::string toString() const { return std::to_string(m_value); }
313 
315  bool operator==(const General &other) const {
316  return m_value == other.m_value;
317  }
318 
320  bool operator!=(const General &other) const {
321  return m_value != other.m_value;
322  }
323 
325  bool operator<(const General &other) const {
326  return m_value < other.m_value;
327  }
328 
330  bool operator>(const General &other) const {
331  return m_value > other.m_value;
332  }
333 
335  friend std::ostream &operator<<(std::ostream &stream,
336  const General &value) {
337  return stream << value.toString();
338  }
339 
341  friend std::istream &operator>>(std::istream &stream, General &value) {
342  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
343  std::istreambuf_iterator<char>{}});
344  return stream;
345  }
346 
347  private:
348  ValueType m_value{0.0};
349  };
350 
352  class ZIVID_COMMON Lens {
353  public:
355  using ValueType = double;
356 
358  static constexpr bool isContainer{false};
359 
361  static constexpr const char *path{"Temperature/Lens"};
362 
364  static constexpr const char *name{"Lens"};
365 
367  Lens() = default;
368 
370  explicit constexpr Lens(ValueType value) noexcept(
371  std::is_nothrow_move_constructible<ValueType>::value)
372  : m_value{value} {}
373 
375  const ValueType &value() const { return m_value; }
376 
379  return {std::numeric_limits<ValueType>::lowest(),
380  std::numeric_limits<ValueType>::max()};
381  }
382 
384  void setFromString(const std::string &value) {
385  m_value = std::stod(value);
386  }
387 
389  std::string toString() const { return std::to_string(m_value); }
390 
392  bool operator==(const Lens &other) const {
393  return m_value == other.m_value;
394  }
395 
397  bool operator!=(const Lens &other) const {
398  return m_value != other.m_value;
399  }
400 
402  bool operator<(const Lens &other) const {
403  return m_value < other.m_value;
404  }
405 
407  bool operator>(const Lens &other) const {
408  return m_value > other.m_value;
409  }
410 
412  friend std::ostream &operator<<(std::ostream &stream, const Lens &value) {
413  return stream << value.toString();
414  }
415 
417  friend std::istream &operator>>(std::istream &stream, Lens &value) {
418  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
419  std::istreambuf_iterator<char>{}});
420  return stream;
421  }
422 
423  private:
424  ValueType m_value{0.0};
425  };
426 
428  class ZIVID_COMMON LED {
429  public:
431  using ValueType = double;
432 
434  static constexpr bool isContainer{false};
435 
437  static constexpr const char *path{"Temperature/LED"};
438 
440  static constexpr const char *name{"LED"};
441 
443  LED() = default;
444 
446  explicit constexpr LED(ValueType value) noexcept(
447  std::is_nothrow_move_constructible<ValueType>::value)
448  : m_value{value} {}
449 
451  const ValueType &value() const { return m_value; }
452 
455  return {std::numeric_limits<ValueType>::lowest(),
456  std::numeric_limits<ValueType>::max()};
457  }
458 
460  void setFromString(const std::string &value) {
461  m_value = std::stod(value);
462  }
463 
465  std::string toString() const { return std::to_string(m_value); }
466 
468  bool operator==(const LED &other) const {
469  return m_value == other.m_value;
470  }
471 
473  bool operator!=(const LED &other) const {
474  return m_value != other.m_value;
475  }
476 
478  bool operator<(const LED &other) const { return m_value < other.m_value; }
479 
481  bool operator>(const LED &other) const { return m_value > other.m_value; }
482 
484  friend std::ostream &operator<<(std::ostream &stream, const LED &value) {
485  return stream << value.toString();
486  }
487 
489  friend std::istream &operator>>(std::istream &stream, LED &value) {
490  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
491  std::istreambuf_iterator<char>{}});
492  return stream;
493  }
494 
495  private:
496  ValueType m_value{0.0};
497  };
498 
500  class ZIVID_COMMON PCB {
501  public:
503  using ValueType = double;
504 
506  static constexpr bool isContainer{false};
507 
509  static constexpr const char *path{"Temperature/PCB"};
510 
512  static constexpr const char *name{"PCB"};
513 
515  PCB() = default;
516 
518  explicit constexpr PCB(ValueType value) noexcept(
519  std::is_nothrow_move_constructible<ValueType>::value)
520  : m_value{value} {}
521 
523  const ValueType &value() const { return m_value; }
524 
527  return {std::numeric_limits<ValueType>::lowest(),
528  std::numeric_limits<ValueType>::max()};
529  }
530 
532  void setFromString(const std::string &value) {
533  m_value = std::stod(value);
534  }
535 
537  std::string toString() const { return std::to_string(m_value); }
538 
540  bool operator==(const PCB &other) const {
541  return m_value == other.m_value;
542  }
543 
545  bool operator!=(const PCB &other) const {
546  return m_value != other.m_value;
547  }
548 
550  bool operator<(const PCB &other) const { return m_value < other.m_value; }
551 
553  bool operator>(const PCB &other) const { return m_value > other.m_value; }
554 
556  friend std::ostream &operator<<(std::ostream &stream, const PCB &value) {
557  return stream << value.toString();
558  }
559 
561  friend std::istream &operator>>(std::istream &stream, PCB &value) {
562  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
563  std::istreambuf_iterator<char>{}});
564  return stream;
565  }
566 
567  private:
568  ValueType m_value{0.0};
569  };
570 
572  class ZIVID_COMMON DMD {
573  public:
575  using ValueType = double;
576 
578  static constexpr bool isContainer{false};
579 
581  static constexpr const char *path{"Temperature/DMD"};
582 
584  static constexpr const char *name{"DMD"};
585 
587  DMD() = default;
588 
590  explicit constexpr DMD(ValueType value) noexcept(
591  std::is_nothrow_move_constructible<ValueType>::value)
592  : m_value{value} {}
593 
595  const ValueType &value() const { return m_value; }
596 
599  return {std::numeric_limits<ValueType>::lowest(),
600  std::numeric_limits<ValueType>::max()};
601  }
602 
604  void setFromString(const std::string &value) {
605  m_value = std::stod(value);
606  }
607 
609  std::string toString() const { return std::to_string(m_value); }
610 
612  bool operator==(const DMD &other) const {
613  return m_value == other.m_value;
614  }
615 
617  bool operator!=(const DMD &other) const {
618  return m_value != other.m_value;
619  }
620 
622  bool operator<(const DMD &other) const { return m_value < other.m_value; }
623 
625  bool operator>(const DMD &other) const { return m_value > other.m_value; }
626 
628  friend std::ostream &operator<<(std::ostream &stream, const DMD &value) {
629  return stream << value.toString();
630  }
631 
633  friend std::istream &operator>>(std::istream &stream, DMD &value) {
634  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
635  std::istreambuf_iterator<char>{}});
636  return stream;
637  }
638 
639  private:
640  ValueType m_value{0.0};
641  };
642 
643  private:
644  General m_general{};
645 
646  public:
648  Temperature &set(const General &value) {
649 
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()) + "}");
656  }
657 
658  m_general = value;
659  return *this;
660  }
662  const General &general() const { return m_general; }
663 
664  private:
665  Lens m_lens{};
666 
667  public:
669  Temperature &set(const Lens &value) {
670 
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()) + "}");
677  }
678 
679  m_lens = value;
680  return *this;
681  }
683  const Lens &lens() const { return m_lens; }
684 
685  private:
686  LED m_led{};
687 
688  public:
690  Temperature &set(const LED &value) {
691 
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()) + "}");
698  }
699 
700  m_led = value;
701  return *this;
702  }
704  const LED &led() const { return m_led; }
705 
706  private:
707  PCB m_pcb{};
708 
709  public:
711  Temperature &set(const PCB &value) {
712 
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()) + "}");
719  }
720 
721  m_pcb = value;
722  return *this;
723  }
725  const PCB &pcb() const { return m_pcb; }
726 
727  private:
728  DMD m_dmd{};
729 
730  public:
732  Temperature &set(const DMD &value) {
733 
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()) + "}");
740  }
741 
742  m_dmd = value;
743  return *this;
744  }
746  const DMD &dmd() const { return m_dmd; }
747 
750  template <typename F> void forEach(const F &f) const {
751  f(m_general);
752  f(m_lens);
753  f(m_led);
754  f(m_pcb);
755  f(m_dmd);
756  }
757 
760  template <typename F> void forEach(const F &f) {
761  f(m_general);
762  f(m_lens);
763  f(m_led);
764  f(m_pcb);
765  f(m_dmd);
766  }
767 
770  template <typename F> void traverseValues(const F &f) const {
771  f(m_general);
772  f(m_lens);
773  f(m_led);
774  f(m_pcb);
775  f(m_dmd);
776  }
777 
780  template <typename F> void traverseValues(const F &f) {
781  f(m_general);
782  f(m_lens);
783  f(m_led);
784  f(m_pcb);
785  f(m_dmd);
786  }
787 
789  std::string toString() const;
790 
792  friend std::ostream &operator<<(std::ostream &stream,
793  const Temperature &value) {
794  return stream << value.toString();
795  }
796 
798  void save(const std::string &fileName) const;
799 
801  void setFromString(const std::string &value);
802 
804  friend std::istream &operator>>(std::istream &stream, Temperature &value) {
805  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
806  std::istreambuf_iterator<char>{}});
807  return stream;
808  }
809 
811  void load(const std::string &fileName);
812 
814  bool operator==(const Temperature &other) const;
815 
817  bool operator!=(const Temperature &other) const;
818  };
819 
820 private:
821  Connected m_connected{};
822 
823 public:
825  CameraState &set(const Connected &value) {
826 
827  m_connected = value;
828  return *this;
829  }
831  const Connected &isConnected() const { return m_connected; }
832 
833 private:
834  Available m_available{};
835 
836 public:
838  CameraState &set(const Available &value) {
839 
840  m_available = value;
841  return *this;
842  }
844  const Available &isAvailable() const { return m_available; }
845 
846 private:
847  Live m_live{};
848 
849 public:
851  CameraState &set(const Live &value) {
852 
853  m_live = value;
854  return *this;
855  }
857  const Live &live() const { return m_live; }
858 
859 private:
860  Temperature m_temperature{};
861 
862 public:
864  CameraState &set(const Temperature &value) {
865 
866  m_temperature = value;
867  return *this;
868  }
870  const Temperature &temperature() const { return m_temperature; }
871 
873  CameraState &set(const Temperature::General &value) {
874 
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()) + "}");
881  }
882 
883  m_temperature.set(value);
884  return *this;
885  }
886 
888  CameraState &set(const Temperature::Lens &value) {
889 
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()) + "}");
896  }
897 
898  m_temperature.set(value);
899  return *this;
900  }
901 
903  CameraState &set(const Temperature::LED &value) {
904 
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()) + "}");
911  }
912 
913  m_temperature.set(value);
914  return *this;
915  }
916 
918  CameraState &set(const Temperature::PCB &value) {
919 
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()) + "}");
926  }
927 
928  m_temperature.set(value);
929  return *this;
930  }
931 
933  CameraState &set(const Temperature::DMD &value) {
934 
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()) + "}");
941  }
942 
943  m_temperature.set(value);
944  return *this;
945  }
946 
949  template <typename F> void forEach(const F &f) const {
950  f(m_connected);
951  f(m_available);
952  f(m_live);
953  f(m_temperature);
954  }
955 
958  template <typename F> void forEach(const F &f) {
959  f(m_connected);
960  f(m_available);
961  f(m_live);
962  f(m_temperature);
963  }
964 
967  template <typename F> void traverseValues(const F &f) const {
968  f(m_connected);
969  f(m_available);
970  f(m_live);
971  m_temperature.traverseValues(f);
972  }
973 
976  template <typename F> void traverseValues(const F &f) {
977  f(m_connected);
978  f(m_available);
979  f(m_live);
980  m_temperature.traverseValues(f);
981  }
982 
984  std::string toString() const;
985 
987  friend std::ostream &operator<<(std::ostream &stream,
988  const CameraState &value) {
989  return stream << value.toString();
990  }
991 
993  void save(const std::string &fileName) const;
994 
996  void setFromString(const std::string &value);
997 
999  friend std::istream &operator>>(std::istream &stream, CameraState &value) {
1000  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
1001  std::istreambuf_iterator<char>{}});
1002  return stream;
1003  }
1004 
1006  void load(const std::string &fileName);
1007 
1009  bool operator==(const CameraState &other) const;
1010 
1012  bool operator!=(const CameraState &other) const;
1013 };
1014 } // namespace Zivid
1015 
1016 #ifdef _MSC_VER
1017 #pragma warning(pop)
1018 #endif
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