Classes | |
| struct | PendingAsk |
Public Member Functions | |
| Impl (std::string uri) | |
| ~Impl () | |
| void | start () |
| void | stop () |
| bool | is_connected () const noexcept |
| int | connect_once () const |
| void | reconnect_loop () |
| bool | write_frame (const std::string &payload) |
| bool | read_exact (int fd, std::uint8_t *buf, std::size_t n) |
| void | read_until_eof () |
| void | dispatch_incoming (const json &j) |
| bool | send_hello () |
| void | flush_queued_alerts () |
| bool | send_or_queue_alert (const json &j) |
Public Attributes | |
| std::string | socket_path_ |
| std::atomic_bool | running_ {false} |
| std::atomic_int | fd_ {-1} |
| std::atomic_bool | handshake_done_ {false} |
| std::thread | reader_thread_ |
| std::mutex | write_mutex_ |
| std::atomic_uint64_t | next_id_ {1} |
| std::mutex | pending_mutex_ |
| std::unordered_map< std::uint64_t, std::shared_ptr< PendingAsk > > | pending_asks_ |
| std::mutex | handler_mutex_ |
| std::function< void(const NotificationEvent &)> | notif_handler_ |
| std::mutex | alerts_mutex_ |
| std::deque< std::string > | queued_alerts_ |
Definition at line 97 of file UIClient.cpp.
|
inlineexplicit |
Definition at line 99 of file UIClient.cpp.
References socket_path_.
|
inline |
|
inline |
Definition at line 171 of file UIClient.cpp.
References socket_path_.
Referenced by reconnect_loop().
|
inline |
Definition at line 287 of file UIClient.cpp.
References bsc::ui::NotificationEvent::data, handler_mutex_, bsc::ui::NotificationEvent::id, bsc::logging::Logger::instance(), bsc::proto::msg::kAskRuleReply, bsc::proto::msg::kNotification, bsc::proto::msg::kPong, notif_handler_, pending_asks_, pending_mutex_, bsc::ui::NotificationEvent::rules, bsc::ui::NotificationEvent::type, and bsc::logging::Logger::warning().
Referenced by read_until_eof().
|
inline |
Definition at line 341 of file UIClient.cpp.
References alerts_mutex_, queued_alerts_, and write_frame().
Referenced by reconnect_loop().
|
inlinenoexcept |
Definition at line 164 of file UIClient.cpp.
References fd_, and handshake_done_.
Referenced by send_or_queue_alert().
|
inline |
Definition at line 247 of file UIClient.cpp.
Referenced by read_until_eof().
|
inline |
Definition at line 262 of file UIClient.cpp.
References dispatch_incoming(), fd_, bsc::proto::frame_peek_length(), bsc::logging::Logger::instance(), bsc::proto::kMaxFrameSize, read_exact(), and running_.
Referenced by reconnect_loop().
|
inline |
Definition at line 185 of file UIClient.cpp.
References connect_once(), fd_, flush_queued_alerts(), handshake_done_, bsc::logging::Logger::instance(), read_until_eof(), running_, send_hello(), and socket_path_.
Referenced by start().
|
inline |
Definition at line 332 of file UIClient.cpp.
References bsc::proto::msg::kHello, next_id_, and write_frame().
Referenced by reconnect_loop().
|
inline |
Definition at line 358 of file UIClient.cpp.
References alerts_mutex_, is_connected(), queued_alerts_, and write_frame().
|
inline |
Definition at line 138 of file UIClient.cpp.
References reader_thread_, reconnect_loop(), and running_.
|
inline |
Definition at line 143 of file UIClient.cpp.
References fd_, pending_asks_, pending_mutex_, reader_thread_, and running_.
Referenced by ~Impl().
|
inline |
Definition at line 228 of file UIClient.cpp.
References fd_, bsc::proto::frame_encode(), and write_mutex_.
Referenced by flush_queued_alerts(), send_hello(), and send_or_queue_alert().
| std::mutex bsc::ui::UIClient::Impl::alerts_mutex_ |
Definition at line 133 of file UIClient.cpp.
Referenced by flush_queued_alerts(), and send_or_queue_alert().
| std::atomic_int bsc::ui::UIClient::Impl::fd_ {-1} |
Definition at line 108 of file UIClient.cpp.
Referenced by is_connected(), read_until_eof(), reconnect_loop(), stop(), and write_frame().
| std::mutex bsc::ui::UIClient::Impl::handler_mutex_ |
Definition at line 129 of file UIClient.cpp.
Referenced by dispatch_incoming().
| std::atomic_bool bsc::ui::UIClient::Impl::handshake_done_ {false} |
Definition at line 109 of file UIClient.cpp.
Referenced by is_connected(), and reconnect_loop().
| std::atomic_uint64_t bsc::ui::UIClient::Impl::next_id_ {1} |
Definition at line 116 of file UIClient.cpp.
Referenced by send_hello().
| std::function<void(const NotificationEvent&)> bsc::ui::UIClient::Impl::notif_handler_ |
Definition at line 130 of file UIClient.cpp.
Referenced by dispatch_incoming().
| std::unordered_map<std::uint64_t, std::shared_ptr<PendingAsk> > bsc::ui::UIClient::Impl::pending_asks_ |
Definition at line 126 of file UIClient.cpp.
Referenced by dispatch_incoming(), and stop().
| std::mutex bsc::ui::UIClient::Impl::pending_mutex_ |
Definition at line 125 of file UIClient.cpp.
Referenced by dispatch_incoming(), and stop().
| std::deque<std::string> bsc::ui::UIClient::Impl::queued_alerts_ |
Definition at line 134 of file UIClient.cpp.
Referenced by flush_queued_alerts(), and send_or_queue_alert().
| std::thread bsc::ui::UIClient::Impl::reader_thread_ |
Definition at line 110 of file UIClient.cpp.
| std::atomic_bool bsc::ui::UIClient::Impl::running_ {false} |
Definition at line 107 of file UIClient.cpp.
Referenced by read_until_eof(), reconnect_loop(), start(), and stop().
| std::string bsc::ui::UIClient::Impl::socket_path_ |
Definition at line 104 of file UIClient.cpp.
Referenced by connect_once(), Impl(), and reconnect_loop().
| std::mutex bsc::ui::UIClient::Impl::write_mutex_ |
Definition at line 113 of file UIClient.cpp.
Referenced by write_frame().