WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
|
#include <webcface/server/member_data.h>
Public Member Functions | |
bool | connected () const |
void | imageConvertThreadMain (const SharedString &member, const SharedString &field) |
cdの画像を変換しthisに送信 | |
bool | hasReq (const SharedString &member) |
MemberData ()=delete | |
MemberData (const MemberData &)=delete | |
MemberData & | operator= (const MemberData &)=delete |
MemberData (ServerStorage *store, const wsConnPtr &con, std::string_view remote_addr, const spdlog::sink_ptr &sink, spdlog::level::level_enum level) | |
~MemberData () | |
void | onConnect () |
void | onRecv (const std::string &msg) |
void | onClose () |
void | sendPing () |
void | send () |
void | send (const std::string &msg) |
template<typename T > | |
void | pack (const T &data) |
Public Attributes | |
spdlog::sink_ptr | sink |
std::shared_ptr< spdlog::logger > | logger |
spdlog::level::level_enum | logger_level |
ServerStorage * | store |
wsConnPtr | con |
ws接続のポインタ、切断後(onClose後)nullptrになる | |
std::string | remote_addr |
bool | sync_init = false |
初回のsync() が終わったか | |
SharedString | name |
unsigned int | member_id |
message::SyncInit | init_data |
StrMap1< std::shared_ptr< std::vector< double > > > | value |
最新の値 | |
StrMap1< std::shared_ptr< ValAdaptor > > | text |
StrMap1< std::shared_ptr< message::FuncInfo > > | func |
StrMap1< message::ViewData > | view |
StrMap1< message::Canvas3DData > | canvas3d |
StrMap1< message::Canvas2DData > | canvas2d |
StrMap1< message::ImageFrame > | image |
std::condition_variable | image_cv |
std::mutex | image_m |
StrMap1< int > | image_changed |
StrMap2< int > | image_req_changed |
StrMap2< message::ImageReq > | image_req_info |
std::chrono::system_clock::time_point | last_sync_time |
StrMap2< unsigned int > | value_req |
リクエストしているmember,nameのペア | |
StrMap2< unsigned int > | text_req |
StrMap2< unsigned int > | view_req |
StrMap2< unsigned int > | image_req |
StrMap2< unsigned int > | view_old_req |
StrMap2< unsigned int > | robot_model_req |
StrMap2< unsigned int > | canvas3d_req |
StrMap2< unsigned int > | canvas3d_old_req |
StrMap2< unsigned int > | canvas2d_req |
StrMap2< unsigned int > | canvas2d_old_req |
StrMap2< unsigned int > | log_req |
StrMap2< std::optional< std::thread > > | image_convert_thread |
StrMap1< std::vector< std::shared_ptr< message::RobotLink > > > | robot_model |
StrSet1 | log_req_default |
古いLogリクエスト ("default"のログを古いメッセージ形式で返す) | |
StrMap1< std::shared_ptr< std::deque< message::LogLine > > > | log |
ログ全履歴 | |
std::unordered_map< unsigned int, std::unordered_map< std::size_t, int > > | pending_calls |
まだ完了していない自分へのcall呼び出しのリスト | |
std::atomic< bool > | closing = false |
std::chrono::system_clock::time_point | last_send_ping |
std::optional< std::chrono::milliseconds > | last_ping_duration |
bool | ping_status_req = false |
std::stringstream | send_buffer |
int | send_len = 0 |
Static Public Attributes | |
static unsigned int | last_member_id = 0 |
static constexpr std::chrono::milliseconds | ping_interval {5000} |
|
delete |
|
delete |
|
inlineexplicit |
|
inline |
|
inline |
bool hasReq | ( | const SharedString & | member | ) |
void imageConvertThreadMain | ( | const SharedString & | member, |
const SharedString & | field | ||
) |
cdの画像を変換しthisに送信
cd.image[field]が更新されるかリクエストが更新されたときに変換を行う。
void onClose | ( | ) |
void onConnect | ( | ) |
void onRecv | ( | const std::string & | msg | ) |
|
delete |
|
inline |
void send | ( | ) |
void send | ( | const std::string & | msg | ) |
void sendPing | ( | ) |
StrMap1<message::Canvas2DData> canvas2d |
StrMap2<unsigned int> canvas2d_old_req |
StrMap2<unsigned int> canvas2d_req |
StrMap1<message::Canvas3DData> canvas3d |
StrMap2<unsigned int> canvas3d_old_req |
StrMap2<unsigned int> canvas3d_req |
std::atomic<bool> closing = false |
wsConnPtr con |
ws接続のポインタ、切断後(onClose後)nullptrになる
StrMap1<std::shared_ptr<message::FuncInfo> > func |
StrMap1<message::ImageFrame> image |
StrMap1<int> image_changed |
自分の画像が変化したことをスレッドに知らせる リクエストされてるメンバーのcvを起こしに行く
StrMap2<std::optional<std::thread> > image_convert_thread |
std::condition_variable image_cv |
画像が変化したことを知らせるcv リクエストする側のcvに対して、リクエストする側も画像送信側もnotifyする
closingのときnotify、全メンバーの中でこれをリクエストしてるやつをすべてnotify
std::mutex image_m |
StrMap2<unsigned int> image_req |
StrMap2<int> image_req_changed |
リクエストが変化したことをスレッドに知らせる
StrMap2<message::ImageReq> image_req_info |
画像をそれぞれのリクエストに合わせて変換するスレッド (リクエスト側がもつ)
message::SyncInit init_data |
|
inlinestatic |
std::optional<std::chrono::milliseconds> last_ping_duration |
std::chrono::system_clock::time_point last_send_ping |
std::chrono::system_clock::time_point last_sync_time |
StrMap1<std::shared_ptr<std::deque<message::LogLine> > > log |
ログ全履歴
StrMap2<unsigned int> log_req |
StrSet1 log_req_default |
古いLogリクエスト ("default"のログを古いメッセージ形式で返す)
std::shared_ptr<spdlog::logger> logger |
spdlog::level::level_enum logger_level |
unsigned int member_id |
SharedString name |
std::unordered_map<unsigned int, std::unordered_map<std::size_t, int> > pending_calls |
まだ完了していない自分へのcall呼び出しのリスト
[caller_member_id][caller_id]
呼び出し開始で2, response返したら1, result返したら0
切断時にそれぞれにresponseを返す必要がある。
|
staticconstexpr |
bool ping_status_req = false |
std::string remote_addr |
StrMap1<std::vector<std::shared_ptr<message::RobotLink> > > robot_model |
StrMap2<unsigned int> robot_model_req |
std::stringstream send_buffer |
int send_len = 0 |
spdlog::sink_ptr sink |
ServerStorage* store |
bool sync_init = false |
初回のsync() が終わったか
falseならentryの通知などはしない
StrMap1<std::shared_ptr<ValAdaptor> > text |
StrMap2<unsigned int> text_req |
StrMap1<std::shared_ptr<std::vector<double> > > value |
最新の値
entry非表示のものも含む。
StrMap2<unsigned int> value_req |
リクエストしているmember,nameのペア
StrMap1<message::ViewData> view |
StrMap2<unsigned int> view_old_req |
StrMap2<unsigned int> view_req |