Zao SDK for Jetson / libzao-endpoint API リファレンス 1.6.0.0 (2024-12-24)
Loading...
Searching...
No Matches
LineState.hpp
1#ifndef ZAO_ENDPOINT_MONITOR_LINE_STATE_HPP_
2#define ZAO_ENDPOINT_MONITOR_LINE_STATE_HPP_
3
4#include <vector>
5
6namespace zao {
7namespace endpoint {
8namespace monitor {
9
15 public:
23 LineStateEntry() noexcept {}
24
34 LineStateEntry(std::uint8_t number, bool is_active) noexcept {
35 SetNumber(number);
36 SetActive(is_active);
37 }
38
43 std::uint8_t GetNumber() const noexcept { return number_; }
44
52 void SetNumber(std::uint8_t number) noexcept { number_ = number; }
53
58 bool GetActive() const noexcept { return active_; }
59
67 void SetActive(bool active) noexcept { active_ = active; }
68
69 private:
74 std::uint8_t number_ = 0;
75
80 bool active_ = false;
81};
82
87class LineState {
88 public:
93 LineState() noexcept {}
94
100 void SetActiveCount(std::uint8_t active_count) noexcept {
101 active_count_ = active_count;
102 }
103
109 std::uint8_t GetActiveCount() const noexcept { return (active_count_); }
110
118 void SetLineState(const LineStateEntry& line_state) noexcept {
119 line_state_.push_back(line_state);
120 }
121
126 std::vector<LineStateEntry> GetLineState() const noexcept {
127 return line_state_;
128 }
129
135 std::uint8_t GetMaxCount() const noexcept {
136 return (static_cast<std::uint8_t>(line_state_.size()));
137 }
138
146 bool IsActive(int number) const noexcept {
147 for (const auto line_state : line_state_) {
148 if (line_state.GetNumber() == number) {
149 return line_state.GetActive();
150 }
151 }
152 return false;
153 }
154
155 private:
160 std::uint8_t active_count_ = 0;
161
166 std::vector<LineStateEntry> line_state_;
167};
168
169} // namespace monitor
170} // namespace endpoint
171} // namespace zao
172
173#endif // ZAO_ENDPOINT_MONITOR_LINE_STATE_HPP_
Line 状態を表すクラス.
Definition LineState.hpp:87
void SetLineState(const LineStateEntry &line_state) noexcept
LineStateEntry 構造体を動的配列に追加する.
Definition LineState.hpp:118
std::uint8_t GetActiveCount() const noexcept
Active Line 数を取得する.
Definition LineState.hpp:109
bool IsActive(int number) const noexcept
指定した回線がアクティブか否かを取得する.
Definition LineState.hpp:146
LineState() noexcept
LineState オブジェクトをデフォルト構築する.
Definition LineState.hpp:93
std::vector< LineStateEntry > GetLineState() const noexcept
LineStateEntry 構造体の動的配列を取得する.
Definition LineState.hpp:126
void SetActiveCount(std::uint8_t active_count) noexcept
Active Line 数を設定する.
Definition LineState.hpp:100
std::uint8_t GetMaxCount() const noexcept
最大 Line 数を取得する.
Definition LineState.hpp:135
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11
RASCOW2 Line ステータス情報のフォーマット
Definition LineState.hpp:14
std::uint8_t GetNumber() const noexcept
Line 番号を取得する.
Definition LineState.hpp:43
void SetActive(bool active) noexcept
Line の Active 状態を設定する.
Definition LineState.hpp:67
LineStateEntry(std::uint8_t number, bool is_active) noexcept
LineStateEntry オブジェクトを初期値付きで構築する.
Definition LineState.hpp:34
void SetNumber(std::uint8_t number) noexcept
Line 番号を設定する.
Definition LineState.hpp:52
LineStateEntry() noexcept
LineStateEntry オブジェクトをデフォルト構築する.
Definition LineState.hpp:23
bool GetActive() const noexcept
Active 状態を取得する.
Definition LineState.hpp:58