4#include <unordered_map>
9#include <condition_variable>
11#include <spdlog/common.h>
12#include <spdlog/logger.h>
28std::pair<unsigned int, SharedString>
findReqField(StrMap2<unsigned int> &req,
29 const SharedString &member,
30 const SharedString &field);
34 std::shared_ptr<spdlog::logger>
logger;
52 bool sync_init =
false;
125 std::unordered_map<unsigned int, std::unordered_map<std::size_t, int>>
128 inline static unsigned int last_member_id = 0;
134 std::string_view remote_addr,
135 const spdlog::sink_ptr &sink,
136 spdlog::level::level_enum level)
137 : sink(sink), logger_level(level), store(store), con(con),
138 remote_addr(remote_addr) {
139 this->member_id = ++last_member_id;
140 logger = std::make_shared<spdlog::logger>(
141 std::to_string(member_id) +
"_(unknown client)", this->sink);
142 logger->set_level(this->logger_level);
147 void onRecv(
const std::string &msg);
149 std::atomic<bool> closing =
false;
152 static constexpr std::chrono::milliseconds ping_interval{5000};
155 bool ping_status_req =
false;
160 void send(
const std::string &msg);
162 template <
typename T>
164 message::pack(send_buffer, send_len, data);
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
void * wsConnPtr
Definition server.h:21
std::pair< unsigned int, SharedString > findReqField(StrMap2< unsigned int > &req, const SharedString &member, const SharedString &field)
Definition member_data.cc:122
std::map< SharedString, T > StrMap1
Definition encoding.h:110
StrMap1< StrMap1< T > > StrMap2
Definition encoding.h:112
std::set< SharedString > StrSet1
Definition encoding.h:113
client初期化(client->server->client)
Definition sync.h:30
Definition member_data.h:32
std::mutex image_m
Definition member_data.h:81
StrMap1< message::ImageFrame > image
Definition member_data.h:70
spdlog::sink_ptr sink
Definition member_data.h:33
StrMap2< message::ImageReq > image_req_info
Definition member_data.h:95
StrMap1< int > image_changed
Definition member_data.h:86
SharedString name
Definition member_data.h:54
std::stringstream send_buffer
Definition member_data.h:157
std::optional< std::chrono::milliseconds > last_ping_duration
Definition member_data.h:154
StrMap1< message::Canvas2DData > canvas2d
Definition member_data.h:68
std::chrono::system_clock::time_point last_sync_time
Definition member_data.h:97
MemberData(ServerStorage *store, const wsConnPtr &con, std::string_view remote_addr, const spdlog::sink_ptr &sink, spdlog::level::level_enum level)
Definition member_data.h:133
StrMap2< unsigned int > image_req
Definition member_data.h:99
StrMap1< std::vector< std::shared_ptr< message::RobotLink > > > robot_model
Definition member_data.h:108
StrMap1< message::ViewData > view
Definition member_data.h:66
void pack(const T &data)
Definition member_data.h:163
std::unordered_map< unsigned int, std::unordered_map< std::size_t, int > > pending_calls
まだ完了していない自分へのcall呼び出しのリスト
Definition member_data.h:126
std::condition_variable image_cv
Definition member_data.h:80
StrMap1< std::shared_ptr< message::FuncInfo > > func
Definition member_data.h:65
std::chrono::system_clock::time_point last_send_ping
Definition member_data.h:153
StrMap1< std::shared_ptr< ValAdaptor > > text
Definition member_data.h:64
StrMap1< std::shared_ptr< std::deque< message::LogLine > > > log
ログ全履歴
Definition member_data.h:114
StrMap1< std::shared_ptr< std::vector< double > > > value
最新の値
Definition member_data.h:63
wsConnPtr con
ws接続のポインタ、切断後(onClose後)nullptrになる
Definition member_data.h:42
StrMap2< unsigned int > canvas3d_old_req
Definition member_data.h:100
message::SyncInit init_data
Definition member_data.h:56
~MemberData()
Definition member_data.h:144
bool connected() const
Definition member_data.h:44
StrMap2< unsigned int > canvas2d_old_req
Definition member_data.h:101
MemberData(const MemberData &)=delete
StrMap1< message::Canvas3DData > canvas3d
Definition member_data.h:67
StrSet1 log_req_default
古いLogリクエスト ("default"のログを古いメッセージ形式で返す)
Definition member_data.h:112
std::shared_ptr< spdlog::logger > logger
Definition member_data.h:34
spdlog::level::level_enum logger_level
Definition member_data.h:35
StrMap2< int > image_req_changed
Definition member_data.h:90
ServerStorage * store
Definition member_data.h:37
MemberData & operator=(const MemberData &)=delete
StrMap2< std::optional< std::thread > > image_convert_thread
Definition member_data.h:105
unsigned int member_id
Definition member_data.h:55
std::string remote_addr
Definition member_data.h:43
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103