async_mqtt 9.0.1
Loading...
Searching...
No Matches
property.hpp
1// Copyright Takatoshi Kondo 2018
2//
3// Distributed under the Boost Software License, Version 1.0.
4// (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7#if !defined(ASYNC_MQTT_PACKET_PROPERTY_HPP)
8#define ASYNC_MQTT_PACKET_PROPERTY_HPP
9
10#include <string>
11#include <vector>
12#include <memory>
13#include <algorithm>
14#include <numeric>
15#include <iosfwd>
16#include <iomanip>
17
18#include <boost/asio/buffer.hpp>
19#include <boost/numeric/conversion/cast.hpp>
20#include <boost/container/static_vector.hpp>
21#include <boost/operators.hpp>
22
23#include <async_mqtt/util/json_like_out.hpp>
24
25#include <async_mqtt/packet/qos.hpp>
26#include <async_mqtt/packet/detail/base_property.hpp>
27
38namespace async_mqtt {
39
40namespace as = boost::asio;
41
42// forward declarations
43class property_variant;
44enum class property_location;
45property_variant make_property_variant(buffer& buf, property_location loc, error_code& ec);
46
56enum class payload_format {
57 binary,
58 string
59};
60
70using session_expiry_interval_type = std::uint32_t;
71
81using topic_alias_type = std::uint16_t;
82
92using receive_maximum_type = std::uint16_t;
93
103static constexpr session_expiry_interval_type session_never_expire = 0xffffffffUL;
104
114static constexpr topic_alias_type topic_alias_max = 0xffff;
115
125static constexpr receive_maximum_type receive_maximum_max = 0xffff;
126
136static constexpr std::uint32_t packet_size_no_limit =
137 1 + // fixed header
138 4 + // remaining length
139 128 * 128 * 128 * 128; // maximum value of remainin length
140
141namespace property {
142
155class payload_format_indicator : public detail::n_bytes_property<1> {
156public:
162
168
169 static constexpr detail::ostream_format const of_ = detail::ostream_format::binary_string;
170
171private:
172
173 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
174
175 // private constructor for internal use
176 template <typename It, typename End>
177 explicit payload_format_indicator(It b, End e, error_code& ec);
178};
179
180
193class message_expiry_interval : public detail::n_bytes_property<4> {
194public:
199 explicit message_expiry_interval(std::uint32_t val);
200
205 std::uint32_t val() const;
206
207private:
208 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
209
210 // private constructor for internal use
211 template <typename It, typename End>
212 explicit message_expiry_interval(It b, End e);
213};
214
227class content_type : public detail::string_property {
228public:
233 explicit content_type(std::string val);
234
235#if defined(GENERATING_DOCUMENTATION)
236
241 std::vector<as::const_buffer> const_buffer_sequence() const;
242
248
253 std::size_t size() const;
254
259 static constexpr std::size_t num_of_const_buffer_sequence();
260
265 constexpr std::string val() const;
266
271 constexpr buffer const& val_as_buffer() const;
272
279 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
280
287 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
288
289#endif // defined(GENERATING_DOCUMENTATION)
290
291private:
292 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
293
294 // private constructor for internal use
295 template <
296 typename Buffer,
297 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
298 >
299 explicit content_type(Buffer&& val, error_code& ec);
300};
301
314class response_topic : public detail::string_property {
315public:
320 explicit response_topic(std::string val);
321
322#if defined(GENERATING_DOCUMENTATION)
323
328 std::vector<as::const_buffer> const_buffer_sequence() const;
329
335
340 std::size_t size() const;
341
346 static constexpr std::size_t num_of_const_buffer_sequence();
347
352 constexpr std::string val() const;
353
358 constexpr buffer const& val_as_buffer() const;
359
366 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
367
374 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
375
376#endif // defined(GENERATING_DOCUMENTATION)
377
378private:
379 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
380
381 // private constructor for internal use
382 template <
383 typename Buffer,
384 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
385 >
386 explicit response_topic(Buffer&& val, error_code& ec);
387};
388
401class correlation_data : public detail::binary_property {
402public:
407 explicit correlation_data(std::string val);
408
409#if defined(GENERATING_DOCUMENTATION)
410
415 std::vector<as::const_buffer> const_buffer_sequence() const;
416
422
427 std::size_t size() const;
428
433 static constexpr std::size_t num_of_const_buffer_sequence();
434
439 constexpr std::string val() const;
440
445 constexpr buffer const& val_as_buffer() const;
446
453 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
454
461 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
462
463#endif // defined(GENERATING_DOCUMENTATION)
464
465private:
466 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
467
468 // private constructor for internal use
469 template <
470 typename Buffer,
471 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
472 >
473 explicit correlation_data(Buffer&& val, error_code& ec);
474};
475
488class subscription_identifier : public detail::variable_property {
489public:
494 explicit subscription_identifier(std::uint32_t val);
495
496private:
497 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
498
499 explicit subscription_identifier(std::uint32_t val, error_code& ec);
500};
501
514class session_expiry_interval : public detail::n_bytes_property<4> {
515public:
521
526 std::uint32_t val() const;
527
528private:
529 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
530
531 // private constructor for internal use
532 template <typename It>
533 explicit session_expiry_interval(It b, It e);
534};
535
548class assigned_client_identifier : public detail::string_property {
549public:
554 explicit assigned_client_identifier(std::string val);
555
556#if defined(GENERATING_DOCUMENTATION)
557
562 std::vector<as::const_buffer> const_buffer_sequence() const;
563
569
574 std::size_t size() const;
575
580 static constexpr std::size_t num_of_const_buffer_sequence();
581
586 constexpr std::string val() const;
587
592 constexpr buffer const& val_as_buffer() const;
593
600 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
601
608 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
609
610#endif // defined(GENERATING_DOCUMENTATION)
611
612private:
613 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
614
615 // private constructor for internal use
616 template <
617 typename Buffer,
618 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
619 >
620 explicit assigned_client_identifier(Buffer&& val, error_code& ec);
621};
622
635class server_keep_alive : public detail::n_bytes_property<2> {
636public:
641 explicit server_keep_alive(std::uint16_t val);
642
647 std::uint16_t val() const;
648
649private:
650 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
651
652 // private constructor for internal use
653 template <typename It, typename End>
654 explicit server_keep_alive(It b, End e);
655};
656
669class authentication_method : public detail::string_property {
670public:
675 explicit authentication_method(std::string val);
676
677#if defined(GENERATING_DOCUMENTATION)
678
683 std::vector<as::const_buffer> const_buffer_sequence() const;
684
690
695 std::size_t size() const;
696
701 static constexpr std::size_t num_of_const_buffer_sequence();
702
707 constexpr std::string val() const;
708
713 constexpr buffer const& val_as_buffer() const;
714
721 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
722
729 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
730
731#endif // defined(GENERATING_DOCUMENTATION)
732
733private:
734 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
735
736 // private constructor for internal use
737 template <
738 typename Buffer,
739 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
740 >
741 explicit authentication_method(Buffer&& val, error_code& ec);
742};
743
756class authentication_data : public detail::binary_property {
757public:
762 explicit authentication_data(std::string val);
763
764#if defined(GENERATING_DOCUMENTATION)
765
770 std::vector<as::const_buffer> const_buffer_sequence() const;
771
777
782 std::size_t size() const;
783
788 static constexpr std::size_t num_of_const_buffer_sequence();
789
794 constexpr std::string val() const;
795
800 constexpr buffer const& val_as_buffer() const;
801
808 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
809
816 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
817
818#endif // defined(GENERATING_DOCUMENTATION)
819
820private:
821 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
822
823 // private constructor for internal use
824 template <
825 typename Buffer,
826 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
827 >
828 explicit authentication_data(Buffer&& val, error_code& ec);
829};
830
843class request_problem_information : public detail::n_bytes_property<1> {
844public:
849 explicit request_problem_information(bool value);
850
855 bool val() const;
856
857private:
858 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
859
860 // private constructor for internal use
861 template <typename It, typename End>
862 explicit request_problem_information(It b, End e);
863};
864
877class will_delay_interval : public detail::n_bytes_property<4> {
878public:
883 explicit will_delay_interval(std::uint32_t val);
884
889 std::uint32_t val() const;
890
891private:
892 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
893
894 // private constructor for internal use
895 template <typename It, typename End>
896 explicit will_delay_interval(It b, End e);
897};
898
911class request_response_information : public detail::n_bytes_property<1> {
912public:
917 explicit request_response_information(bool value);
918
923 bool val() const;
924
925private:
926 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
927
928 // private constructor for internal use
929 template <typename It, typename End>
930 explicit request_response_information(It b, End e);
931};
932
945class response_information : public detail::string_property {
946public:
951 explicit response_information(std::string val);
952
953#if defined(GENERATING_DOCUMENTATION)
954
959 std::vector<as::const_buffer> const_buffer_sequence() const;
960
966
971 std::size_t size() const;
972
977 static constexpr std::size_t num_of_const_buffer_sequence();
978
983 constexpr std::string val() const;
984
989 constexpr buffer const& val_as_buffer() const;
990
997 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
998
1005 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
1006
1007#endif // defined(GENERATING_DOCUMENTATION)
1008
1009private:
1010 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1011
1012 // private constructor for internal use
1013 template <
1014 typename Buffer,
1015 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
1016 >
1017 explicit response_information(Buffer&& val, error_code& ec);
1018};
1019
1032class server_reference : public detail::string_property {
1033public:
1038 explicit server_reference(std::string val);
1039
1040#if defined(GENERATING_DOCUMENTATION)
1041
1046 std::vector<as::const_buffer> const_buffer_sequence() const;
1047
1053
1058 std::size_t size() const;
1059
1064 static constexpr std::size_t num_of_const_buffer_sequence();
1065
1070 constexpr std::string val() const;
1071
1076 constexpr buffer const& val_as_buffer() const;
1077
1084 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
1085
1092 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
1093
1094#endif // defined(GENERATING_DOCUMENTATION)
1095
1096private:
1097 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1098
1099 // private constructor for internal use
1100 template <
1101 typename Buffer,
1102 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
1103 >
1104 explicit server_reference(Buffer&& val, error_code& ec);
1105};
1106
1119class reason_string : public detail::string_property {
1120public:
1125 explicit reason_string(std::string val);
1126
1127#if defined(GENERATING_DOCUMENTATION)
1128
1133 std::vector<as::const_buffer> const_buffer_sequence() const;
1134
1140
1145 std::size_t size() const;
1146
1151 static constexpr std::size_t num_of_const_buffer_sequence();
1152
1157 constexpr std::string val() const;
1158
1163 constexpr buffer const& val_as_buffer() const;
1164
1171 friend bool operator<(binary_property const& lhs, binary_property const& rhs);
1172
1179 friend bool operator==(binary_property const& lhs, binary_property const& rhs);
1180
1181#endif // defined(GENERATING_DOCUMENTATION)
1182
1183private:
1184 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1185
1186 // private constructor for internal use
1187 template <
1188 typename Buffer,
1189 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
1190 >
1191 explicit reason_string(Buffer&& val, error_code& ec);
1192};
1193
1206class receive_maximum : public detail::n_bytes_property<2> {
1207public:
1212 explicit receive_maximum(std::uint16_t val);
1213
1218 std::uint16_t val() const;
1219
1220private:
1221 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1222
1223 // private constructor for internal use
1224 template <typename It, typename End>
1225 explicit receive_maximum(It b, End e, error_code& ec);
1226};
1227
1228
1241class topic_alias_maximum : public detail::n_bytes_property<2> {
1242public:
1247 explicit topic_alias_maximum(std::uint16_t val);
1248
1253 std::uint16_t val() const;
1254
1255private:
1256 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1257
1258 // private constructor for internal use
1259 template <typename It, typename End>
1260 explicit topic_alias_maximum(It b, End e);
1261};
1262
1263
1276class topic_alias : public detail::n_bytes_property<2> {
1277public:
1282 explicit topic_alias(std::uint16_t val);
1283
1288 std::uint16_t val() const;
1289
1290private:
1291 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1292
1293 // private constructor for internal use
1294 template <typename It, typename End>
1295 explicit topic_alias(It b, End e);
1296};
1297
1310class maximum_qos : public detail::n_bytes_property<1> {
1311public:
1316 explicit maximum_qos(qos value);
1317
1322 qos val() const;
1323
1324 static constexpr const detail::ostream_format of_ = detail::ostream_format::int_cast;
1325
1326private:
1327 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1328
1329 // private constructor for internal use
1330 template <typename It, typename End>
1331 explicit maximum_qos(It b, End e, error_code& ec);
1332};
1333
1346class retain_available : public detail::n_bytes_property<1> {
1347public:
1352 explicit retain_available(bool value);
1353
1358 bool val() const;
1359
1360private:
1361 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1362
1363 // private constructor for internal use
1364 template <typename It, typename End>
1365 explicit retain_available(It b, End e);
1366};
1367
1368
1381class user_property : private boost::totally_ordered<user_property> {
1382public:
1388 explicit user_property(std::string key, std::string val);
1389
1394 std::vector<as::const_buffer> const_buffer_sequence() const;
1395
1401
1406 std::size_t size() const;
1407
1412 static constexpr std::size_t num_of_const_buffer_sequence();
1413
1418 std::string key() const;
1419
1424 std::string val() const;
1425
1430 constexpr buffer const& key_as_buffer() const;
1431
1436 constexpr buffer const& val_as_buffer() const;
1437
1438 friend bool operator<(user_property const& lhs, user_property const& rhs) {
1439 return std::tie(lhs.id_, lhs.key_.buf, lhs.val_.buf) < std::tie(rhs.id_, rhs.key_.buf, rhs.val_.buf);
1440 }
1441
1442 friend bool operator==(user_property const& lhs, user_property const& rhs) {
1443 return std::tie(lhs.id_, lhs.key_.buf, lhs.val_.buf) == std::tie(rhs.id_, rhs.key_.buf, rhs.val_.buf);
1444 }
1445
1446 static constexpr detail::ostream_format const of_ = detail::ostream_format::key_val;
1447
1448private:
1449 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1450
1451 // private constructor for internal use
1452 template <
1453 typename Buffer,
1454 std::enable_if_t<std::is_same_v<Buffer, buffer>, std::nullptr_t> = nullptr
1455 >
1456 explicit user_property(Buffer&& key, Buffer&& val, error_code& ec);
1457
1458private:
1460 detail::len_str key_;
1461 detail::len_str val_;
1462};
1463
1476class maximum_packet_size : public detail::n_bytes_property<4> {
1477public:
1482 explicit maximum_packet_size(std::uint32_t val);
1483
1488 std::uint32_t val() const;
1489
1490private:
1491 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1492
1493 // private constructor for internal use
1494 template <typename It, typename End>
1495 explicit maximum_packet_size(It b, End e, error_code& ec);
1496};
1497
1498
1511class wildcard_subscription_available : public detail::n_bytes_property<1> {
1512public:
1518
1523 bool val() const;
1524
1525private:
1526 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1527
1528 // private constructor for internal use
1529 template <typename It, typename End>
1530 explicit wildcard_subscription_available(It b, End e);
1531};
1532
1533
1546class subscription_identifier_available : public detail::n_bytes_property<1> {
1547public:
1553
1558 bool val() const;
1559
1560private:
1561 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1562
1563 // private constructor for internal use
1564 template <typename It, typename End>
1565 explicit subscription_identifier_available(It b, End e);
1566};
1567
1568
1581class shared_subscription_available : public detail::n_bytes_property<1> {
1582public:
1587 explicit shared_subscription_available(bool value);
1588
1593 bool val() const;
1594
1595private:
1596 friend property_variant async_mqtt::make_property_variant(buffer& buf, property_location loc, error_code& ec);
1597
1598 // private constructor for internal use
1599 template <typename It, typename End>
1600 explicit shared_subscription_available(It b, End e);
1601};
1602
1615template <typename Property>
1616std::enable_if_t<
1617 Property::of_ == detail::ostream_format::direct,
1618 std::ostream&
1619>
1620operator<<(std::ostream& o, Property const& v);
1621
1634template <typename Property>
1635std::enable_if_t<
1636 Property::of_ == detail::ostream_format::int_cast,
1637 std::ostream&
1638>
1639operator<<(std::ostream& o, Property const& v);
1640
1653template <typename Property>
1654std::enable_if_t<
1655 Property::of_ == detail::ostream_format::key_val,
1656 std::ostream&
1657>
1658operator<<(std::ostream& o, Property const& v);
1659
1672template <typename Property>
1673std::enable_if_t<
1674 Property::of_ == detail::ostream_format::binary_string,
1675 std::ostream&
1676>
1677operator<<(std::ostream& o, Property const& v);
1678
1691template <typename Property>
1692std::enable_if_t<
1693 Property::of_ == detail::ostream_format::json_like,
1694 std::ostream&
1695>
1696operator<<(std::ostream& o, Property const& v);
1697
1698} // namespace property
1699
1700} // namespace async_mqtt
1701
1702#include <async_mqtt/packet/impl/property.hpp>
1703
1704#endif // ASYNC_MQTT_PACKET_PROPERTY_HPP
buffer that has string_view interface and shared ownership This class is only for advanced usecase su...
Definition buffer.hpp:46
assigned_client_identifier property
Definition property.hpp:548
property::id id() const
Get property::id.
constexpr std::string val() const
Get value.
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
std::size_t size() const
Get property size.
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
assigned_client_identifier(std::string val)
constructor
constexpr buffer const & val_as_buffer() const
Get value.
authentication_data property
Definition property.hpp:756
constexpr buffer const & val_as_buffer() const
Get value.
property::id id() const
Get property::id.
std::size_t size() const
Get property size.
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
constexpr std::string val() const
Get value.
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
authentication_data(std::string val)
constructor
authentication_method property
Definition property.hpp:669
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
std::size_t size() const
Get property size.
authentication_method(std::string val)
constructor
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
property::id id() const
Get property::id.
constexpr buffer const & val_as_buffer() const
Get value.
constexpr std::string val() const
Get value.
content_type property
Definition property.hpp:227
std::size_t size() const
Get property size.
constexpr std::string val() const
Get value.
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
constexpr buffer const & val_as_buffer() const
Get value.
property::id id() const
Get property::id.
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
content_type(std::string val)
constructor
correlation_data property
Definition property.hpp:401
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
correlation_data(std::string val)
constructor
constexpr buffer const & val_as_buffer() const
Get value.
constexpr std::string val() const
Get value.
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
std::size_t size() const
Get property size.
property::id id() const
Get property::id.
maximum_packet_size property
Definition property.hpp:1476
maximum_packet_size(std::uint32_t val)
constructor
std::uint32_t val() const
Get value.
maximum_qos property
Definition property.hpp:1310
maximum_qos(qos value)
constructor
message_expiry_interval property
Definition property.hpp:193
message_expiry_interval(std::uint32_t val)
constructor
std::uint32_t val() const
Get value.
payload_format_indicator property
Definition property.hpp:155
payload_format val() const
Get value.
payload_format_indicator(payload_format fmt=payload_format::binary)
constructor
reason_string property
Definition property.hpp:1119
std::size_t size() const
Get property size.
constexpr buffer const & val_as_buffer() const
Get value.
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
constexpr std::string val() const
Get value.
reason_string(std::string val)
constructor
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
property::id id() const
Get property::id.
receive_maximum property
Definition property.hpp:1206
receive_maximum(std::uint16_t val)
constructor
std::uint16_t val() const
Get value.
request_problem_information property
Definition property.hpp:843
request_response_information property
Definition property.hpp:911
response_information property
Definition property.hpp:945
property::id id() const
Get property::id.
constexpr std::string val() const
Get value.
std::size_t size() const
Get property size.
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
constexpr buffer const & val_as_buffer() const
Get value.
response_information(std::string val)
constructor
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
response_topic property
Definition property.hpp:314
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
std::size_t size() const
Get property size.
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
response_topic(std::string val)
constructor
property::id id() const
Get property::id.
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
constexpr std::string val() const
Get value.
constexpr buffer const & val_as_buffer() const
Get value.
retain_available property
Definition property.hpp:1346
retain_available(bool value)
constructor
server_keep_alive property
Definition property.hpp:635
server_keep_alive(std::uint16_t val)
constructor
std::uint16_t val() const
Get value.
server_reference property
Definition property.hpp:1032
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
constexpr buffer const & val_as_buffer() const
Get value.
server_reference(std::string val)
constructor
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
friend bool operator==(binary_property const &lhs, binary_property const &rhs)
equal operator
friend bool operator<(binary_property const &lhs, binary_property const &rhs)
less than operator
constexpr std::string val() const
Get value.
property::id id() const
Get property::id.
std::size_t size() const
Get property size.
session_expiry_interval property
Definition property.hpp:514
std::uint32_t val() const
Get value.
session_expiry_interval(std::uint32_t val)
constructor
shared_subscription_available property
Definition property.hpp:1581
subscription_identifier_available property
Definition property.hpp:1546
subscription_identifier property
Definition property.hpp:488
subscription_identifier(std::uint32_t val)
constructor
topic_alias_maximum property
Definition property.hpp:1241
topic_alias_maximum(std::uint16_t val)
constructor
std::uint16_t val() const
Get value.
topic_alias property
Definition property.hpp:1276
std::uint16_t val() const
Get value.
topic_alias(std::uint16_t val)
constructor
user property
Definition property.hpp:1381
user_property(std::string key, std::string val)
constructor
constexpr buffer const & val_as_buffer() const
Get value as buffer.
std::size_t size() const
Get property size.
constexpr buffer const & key_as_buffer() const
Get key as buffer.
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
std::string key() const
Get key.
std::string val() const
Get value.
property::id id() const
Get property::id.
wildcard_subscription_available property
Definition property.hpp:1511
will_delay_interval property
Definition property.hpp:877
will_delay_interval(std::uint32_t val)
constructor
std::uint32_t val() const
Get value.
property variant
Definition property_variant.hpp:74
sys::error_code error_code
sys is a namespace alias of boost::sytem.
Definition error.hpp:56
std::uint16_t receive_maximum_type
type of the receive maximum value
Definition property.hpp:92
std::uint32_t session_expiry_interval_type
type of the session expiry interval (seconds)
Definition property.hpp:70
payload_format
payload_format
Definition property.hpp:56
id
MQTT property identifier.
Definition property_id.hpp:28
std::uint16_t topic_alias_type
type of the topic alias value
Definition property.hpp:81
std::enable_if_t< Property::of_==detail::ostream_format::direct, std::ostream & > operator<<(std::ostream &o, Property const &v)
stream output operator
@ subscription_identifier
Subscription Identifier.
@ request_problem_information
Request Problem Information.
@ reason_string
Reason String.
@ server_reference
Server Reference.
@ maximum_qos
Maximum QoS.
@ response_topic
Response Topic.
@ retain_available
Retain Available.
@ message_expiry_interval
Message Expiry Interval.
@ shared_subscription_available
Shared Subscription Available.
@ request_response_information
Request Response Information.
@ authentication_data
Authentication Data.
@ session_expiry_interval
Session Expiry Interval.
@ receive_maximum
Receive Maximum.
@ assigned_client_identifier
Assigned Client Identifier.
@ server_keep_alive
Server Keep Alive.
@ topic_alias
Topic Alias.
@ topic_alias_maximum
Topic Alias Maximum.
@ authentication_method
Authentication Method.
@ subscription_identifier_available
Subscription Identifier Available.
@ user_property
User Property.
@ payload_format_indicator
Payload Format Indicator.
@ will_delay_interval
Will Delay Interval.
@ wildcard_subscription_available
Wildcard Subscription Available.
@ maximum_packet_size
Maximum Packet Size.
@ content_type
Content Type.
@ correlation_data
Correlation Data.
@ response_information
Response Information.
qos
MQTT QoS.
Definition qos.hpp:35