WebCFace 2.9.0
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> {
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;
24 Res() = default;
25 Res(unsigned int req_id, const SharedString &sub_field,
26 const 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}
34
36WEBCFACE_MESSAGE_FMT(webcface::message::Res<webcface::message::Text>)
37WEBCFACE_MESSAGE_FMT(webcface::message::Entry<webcface::message::Text>)
38WEBCFACE_MESSAGE_FMT(webcface::message::Req<webcface::message::Text>)
#define MSGPACK_DEFINE_MAP(...)
Definition base.h:18
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:159
数値、文字列などの値を相互変換するクラス
Definition val_adaptor.h:87
#define WEBCFACE_MESSAGE_FMT(Type)
Definition fmt.h:21
Definition arg.h:14
型からkindを取得するためだけのベースクラス
Definition base.h:68
ValAdaptor data
Definition text.h:23
SharedString sub_field
Definition text.h:22
Res(unsigned int req_id, const SharedString &sub_field, const ValAdaptor &data)
Definition text.h:25
Definition base.h:73
Definition text.h:13
ValAdaptor data
Definition text.h:15
SharedString field
Definition text.h:14
#define WEBCFACE_NS_END
Definition webcface-config.h:118
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:117