WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
data_store1.h
Go to the documentation of this file.
1#pragma once
2#include <mutex>
3#include <optional>
5#include "webcface/field.h"
6
8namespace internal {
9template <typename T>
11 StrMap1<T> data_recv;
12 StrMap1<bool> req;
13 StrMap1<bool> req_send;
20 StrSet1 entry;
21
22 public:
24 std::recursive_mutex mtx;
25
26 explicit SyncDataStore1(const SharedString &name);
27
29
32 bool addReq(const SharedString &member);
33
35
38 bool clearReq(const SharedString &member);
39
40 bool isSelf(const SharedString &member) const;
41
42 void setRecv(const SharedString &member, const T &data);
43
47 void clearEntry(const SharedString &from);
51 void setEntry(const SharedString &from);
52
56 bool getEntry(const SharedString &from);
57 bool getEntry(const FieldBase &base);
58
59 std::optional<T> getRecv(const SharedString &member);
61 StrMap1<bool> transferReq();
62};
63
64#if WEBCFACE_SYSTEM_DLLEXPORT
65extern template class SyncDataStore1<std::string>; // test用
67#endif
68
69} // namespace internal
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
Definition data_store1.h:10
std::recursive_mutex mtx
Definition data_store1.h:24
SharedString self_member_name
Definition data_store1.h:23
std::map< SharedString, T > StrMap1
Definition encoding.h:110
std::set< SharedString > StrSet1
Definition encoding.h:113
メンバ名とデータ名を持つクラス
Definition field.h:37
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103