WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
text.h
Go to the documentation of this file.
1#pragma once
2#include "./base.h"
5
6#ifndef MSGPACK_DEFINE_MAP
7#define MSGPACK_DEFINE_MAP(...)
8#endif
9
11namespace message {
12
13struct Text : public MessageBase<MessageKind::text> {
15 std::shared_ptr<ValAdaptor> data;
16 MSGPACK_DEFINE_MAP(MSGPACK_NVP("f", field), MSGPACK_NVP("d", data))
17};
18
19template <>
20struct Res<Text> : public MessageBase<MessageKind::text + MessageKind::res> {
21 unsigned int req_id = 0;
23 std::shared_ptr<ValAdaptor> data;
24 Res() = default;
25 Res(unsigned int req_id, const SharedString &sub_field,
26 const std::shared_ptr<ValAdaptor> &data)
27 : req_id(req_id), sub_field(sub_field), data(data) {}
28 MSGPACK_DEFINE_MAP(MSGPACK_NVP("i", req_id), MSGPACK_NVP("f", sub_field),
29 MSGPACK_NVP("d", data))
30};
31
32}
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
#define MSGPACK_DEFINE_MAP(...)
Definition canvas2d.h:10
型からkindを取得するためだけのベースクラス
Definition base.h:53
SharedString sub_field
Definition text.h:22
std::shared_ptr< ValAdaptor > data
Definition text.h:23
Res(unsigned int req_id, const SharedString &sub_field, const std::shared_ptr< ValAdaptor > &data)
Definition text.h:25
Definition base.h:58
Definition text.h:13
SharedString field
Definition text.h:14
std::shared_ptr< ValAdaptor > data
Definition text.h:15
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103