6#include <unordered_map>
8#ifndef MSGPACK_DEFINE_MAP
9#define MSGPACK_DEFINE_MAP(...)
27 int text_color = 0, bg_color = 0;
28 std::optional<double> min_ = std::nullopt, max_ = std::nullopt,
34 return type == other.
type && text == other.
text &&
40 min_ == other.
min_ && max_ == other.
max_ &&
44 return !(*
this == other);
48 MSGPACK_NVP(
"L", on_click_member),
49 MSGPACK_NVP(
"l", on_click_field),
50 MSGPACK_NVP(
"R", text_ref_member),
51 MSGPACK_NVP(
"r", text_ref_field),
52 MSGPACK_NVP(
"c", text_color), MSGPACK_NVP(
"b", bg_color),
53 MSGPACK_NVP(
"im", min_), MSGPACK_NVP(
"ix", max_),
54 MSGPACK_NVP(
"is", step_), MSGPACK_NVP(
"io", option_))
62 std::map<std::string, std::shared_ptr<message::ViewComponentData>>
70 std::map<std::string, std::shared_ptr<ViewComponentData>>
data_diff;
71 std::size_t length = 0;
74 const std::unordered_map<
int, std::shared_ptr<ViewComponentData>>
77 : field(field), data_diff(), length(length) {
78 for (
auto &&vc : data_diff) {
79 this->data_diff.emplace(std::to_string(vc.first), vc.second);
83 const std::map<std::string, std::shared_ptr<ViewComponentData>>
86 : field(field), data_diff(data_diff), length(length) {}
88 MSGPACK_NVP(
"l", length))
92 std::map<std::string, std::shared_ptr<ViewComponentData>>
data_diff;
93 std::optional<std::vector<SharedString>>
data_ids;
96 std::map<std::string, std::shared_ptr<ViewComponentData>> data_diff,
97 std::optional<std::vector<SharedString>> data_ids)
98 : field(field), data_diff(std::move(data_diff)),
99 data_ids(std::move(data_ids)) {}
101 MSGPACK_NVP(
"l", data_ids))
106 :
public MessageBase<MessageKind::view_old + MessageKind::res> {
107 unsigned int req_id = 0;
109 std::map<std::string, std::shared_ptr<ViewComponentData>>
data_diff;
110 std::size_t length = 0;
113 const std::map<std::string, std::shared_ptr<ViewComponentData>>
116 : req_id(req_id), sub_field(sub_field), data_diff(data_diff),
119 MSGPACK_NVP(
"d", data_diff), MSGPACK_NVP(
"l", length))
123 unsigned int req_id = 0;
125 std::map<std::string, std::shared_ptr<ViewComponentData>>
data_diff;
129 const std::map<std::string, std::shared_ptr<ViewComponentData>>
131 const std::optional<std::vector<SharedString>> &data_ids)
132 : req_id(req_id), sub_field(sub_field), data_diff(data_diff),
133 data_ids(data_ids) {}
135 MSGPACK_NVP(
"d", data_diff), MSGPACK_NVP(
"l", data_ids))
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
#define MSGPACK_DEFINE_MAP(...)
Definition canvas2d.h:10
型からkindを取得するためだけのベースクラス
Definition base.h:53
Res(unsigned int req_id, const SharedString &sub_field, const std::map< std::string, std::shared_ptr< ViewComponentData > > &data_diff, std::size_t length)
Definition view.h:112
std::map< std::string, std::shared_ptr< ViewComponentData > > data_diff
Definition view.h:109
SharedString sub_field
Definition view.h:108
Res(unsigned int req_id, const SharedString &sub_field, const std::map< std::string, std::shared_ptr< ViewComponentData > > &data_diff, const std::optional< std::vector< SharedString > > &data_ids)
Definition view.h:128
std::optional< std::vector< SharedString > > data_ids
Definition view.h:126
std::map< std::string, std::shared_ptr< ViewComponentData > > data_diff
Definition view.h:125
SharedString sub_field
Definition view.h:124
std::optional< SharedString > text_ref_member
Definition view.h:26
int text_color
Definition view.h:27
std::optional< SharedString > text_ref_field
Definition view.h:26
int bg_color
Definition view.h:27
std::optional< double > step_
Definition view.h:29
SharedString text
Definition view.h:24
std::optional< double > min_
Definition view.h:28
std::optional< SharedString > on_click_member
Definition view.h:25
ViewComponentData()=default
bool operator==(const ViewComponentData &other) const
Definition view.h:33
std::vector< ValAdaptor > option_
Definition view.h:30
bool operator!=(const ViewComponentData &other) const
Definition view.h:43
int type
Definition view.h:23
std::optional< double > max_
Definition view.h:28
std::optional< SharedString > on_click_field
Definition view.h:25
std::vector< SharedString > data_ids
Definition view.h:64
std::map< std::string, std::shared_ptr< message::ViewComponentData > > components
Definition view.h:63
ViewOld(const SharedString &field, const std::map< std::string, std::shared_ptr< ViewComponentData > > &data_diff, std::size_t length)
Definition view.h:82
ViewOld(const SharedString &field, const std::unordered_map< int, std::shared_ptr< ViewComponentData > > &data_diff, std::size_t length)
Definition view.h:73
std::map< std::string, std::shared_ptr< ViewComponentData > > data_diff
Definition view.h:70
SharedString field
Definition view.h:69
std::optional< std::vector< SharedString > > data_ids
Definition view.h:93
std::map< std::string, std::shared_ptr< ViewComponentData > > data_diff
Definition view.h:92
SharedString field
Definition view.h:91
View(const SharedString &field, std::map< std::string, std::shared_ptr< ViewComponentData > > data_diff, std::optional< std::vector< SharedString > > data_ids)
Definition view.h:95
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103