WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
value.h
Go to the documentation of this file.
1#pragma once
2#include "./base.h"
4#include <vector>
5
6#ifndef MSGPACK_DEFINE_MAP
7#define MSGPACK_DEFINE_MAP(...)
8#endif
9
11namespace message {
12
13struct Value : public MessageBase<MessageKind::value> {
15 std::shared_ptr<std::vector<double>> data;
16 MSGPACK_DEFINE_MAP(MSGPACK_NVP("f", field), MSGPACK_NVP("d", data))
17};
25template <>
26struct Res<Value> : public MessageBase<MessageKind::value + MessageKind::res> {
27 unsigned int req_id = 0;
29 std::shared_ptr<std::vector<double>> data;
30 Res() = default;
31 Res(unsigned int req_id, const SharedString &sub_field,
32 const std::shared_ptr<std::vector<double>> &data)
33 : req_id(req_id), sub_field(sub_field), data(data) {}
34 MSGPACK_DEFINE_MAP(MSGPACK_NVP("i", req_id), MSGPACK_NVP("f", sub_field),
35 MSGPACK_NVP("d", data))
36};
37
38}
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::shared_ptr< std::vector< double > > &data)
Definition value.h:31
SharedString sub_field
Definition value.h:28
std::shared_ptr< std::vector< double > > data
Definition value.h:29
Definition base.h:58
Definition value.h:13
SharedString field
Definition value.h:14
std::shared_ptr< std::vector< double > > data
Definition value.h:15
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103