async_mqtt 5.0.0
Loading...
Searching...
No Matches
property.hpp
Go to the documentation of this file.
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/optional.hpp>
24#include <async_mqtt/util/move.hpp>
25#include <async_mqtt/util/static_vector.hpp>
26#include <async_mqtt/util/endian_convert.hpp>
27#include <async_mqtt/util/json_like_out.hpp>
28#include <async_mqtt/util/utf8validate.hpp>
29
30#include <async_mqtt/exception.hpp>
32#include <async_mqtt/packet/property_id.hpp>
33#include <async_mqtt/variable_bytes.hpp>
34#include <async_mqtt/buffer.hpp>
35
37
38namespace async_mqtt {
39
40namespace as = boost::asio;
41
45enum class payload_format {
46 binary,
47 string
48};
49
50
51namespace property {
52
53namespace detail {
54
55enum class ostream_format {
56 direct,
57 int_cast,
58 key_val,
59 binary_string,
60 json_like
61};
62
69template <std::size_t N>
70struct n_bytes_property : private boost::totally_ordered<n_bytes_property<N>> {
71 n_bytes_property(property::id id, static_vector<char, N> const& buf)
72 : id_{id},
73 buf_{buf} // very small size copy
74 {
75 }
76
77 template <typename It, typename End>
78 n_bytes_property(property::id id, It b, End e)
79 :id_{id}, buf_(b, e) {}
80
81 n_bytes_property(property::id id, buffer const& buf)
82 :id_{id} {
83 BOOST_ASSERT(buf.size() >= N);
84 buf_.insert(buf_.end(), (buf.begin(), std::next(buf.begin(), N)));
85 }
86
91 std::vector<as::const_buffer> const_buffer_sequence() const {
92 std::vector<as::const_buffer> v;
94 v.emplace_back(as::buffer(&id_, 1));
95 v.emplace_back(as::buffer(buf_.data(), buf_.size()));
96 return v;
97 }
98
103 property::id id() const {
104 return id_;
105 }
106
111 std::size_t size() const {
112 return 1 + buf_.size();
113 }
114
119 static constexpr std::size_t num_of_const_buffer_sequence() {
120 return 2;
121 }
122
123 friend bool operator<(n_bytes_property<N> const& lhs, n_bytes_property<N> const& rhs) {
124 return std::tie(lhs.id_, lhs.buf_) < std::tie(rhs.id_, rhs.buf_);
125 }
126
127 friend bool operator==(n_bytes_property<N> const& lhs, n_bytes_property<N> const& rhs) {
128 return std::tie(lhs.id_, lhs.buf_) == std::tie(rhs.id_, rhs.buf_);
129 }
130
131 static constexpr ostream_format const of_ = ostream_format::direct;
132 property::id id_;
134};
135
139struct binary_property : private boost::totally_ordered<binary_property> {
140 binary_property(property::id id, buffer buf)
141 :id_{id},
142 buf_{force_move(buf)},
143 length_(2) // size 2
144 {
145 if (buf_.size() > 0xffff) {
146 throw make_error(
147 errc::bad_message,
148 "property::binary_property length is invalid"
149 );
150 }
151 endian_store(boost::numeric_cast<std::uint16_t>(buf_.size()), length_.data());
152 }
153
158 std::vector<as::const_buffer> const_buffer_sequence() const {
159 std::vector<as::const_buffer> v;
161 v.emplace_back(as::buffer(&id_, 1));
162 v.emplace_back(as::buffer(length_.data(), length_.size()));
163 v.emplace_back(as::buffer(buf_.data(), buf_.size()));
164 return v;
165 }
166
171 property::id id() const {
172 return id_;
173 }
174
179 std::size_t size() const {
180 return 1 + length_.size() + buf_.size();
181 }
182
187 static constexpr std::size_t num_of_const_buffer_sequence() {
188 return 3;
189 }
190
195 constexpr buffer const& val() const {
196 return buf_;
197 }
198
199 friend bool operator<(binary_property const& lhs, binary_property const& rhs) {
200 return std::tie(lhs.id_, lhs.buf_) < std::tie(rhs.id_, rhs.buf_);
201 }
202
203 friend bool operator==(binary_property const& lhs, binary_property const& rhs) {
204 return std::tie(lhs.id_, lhs.buf_) == std::tie(rhs.id_, rhs.buf_);
205 }
206
207 static constexpr ostream_format const of_ = ostream_format::json_like;
208 property::id id_;
209 buffer buf_;
211};
212
217 string_property(property::id id, buffer buf)
218 :binary_property{id, force_move(buf)} {
219 if (!utf8string_check(this->val())) {
220 throw make_error(
221 errc::bad_message,
222 "string property invalid utf8"
223 );
224 }
225 }
226};
227
233struct variable_property : private boost::totally_ordered<variable_property> {
234 variable_property(property::id id, std::uint32_t value)
235 :id_{id} {
236 value_ = val_to_variable_bytes(boost::numeric_cast<std::uint32_t>(value));
237 }
238
243 std::vector<as::const_buffer> const_buffer_sequence() const {
244 std::vector<as::const_buffer> v;
246 v.emplace_back(as::buffer(&id_, 1));
247 v.emplace_back(as::buffer(value_.data(), value_.size()));
248 return v;
249 }
250
255 property::id id() const {
256 return id_;
257 }
258
263 std::size_t size() const {
264 return 1 + value_.size();
265 }
266
271 static constexpr std::size_t num_of_const_buffer_sequence() {
272 return 2;
273 }
274
279 std::size_t val() const {
280 auto it{value_.begin()};
281 auto val_opt{variable_bytes_to_val(it, value_.end())};
283 return *val_opt;
284 }
285
286 friend bool operator<(variable_property const& lhs, variable_property const& rhs) {
287 auto const& lval = lhs.val();
288 auto const& rval = rhs.val();
289 return std::tie(lhs.id_, lval) < std::tie(rhs.id_, rval);
290 }
291
292 friend bool operator==(variable_property const& lhs, variable_property const& rhs) {
293 auto const& lval = lhs.val();
294 auto const& rval = rhs.val();
295 return std::tie(lhs.id_, lval) == std::tie(rhs.id_, rval);
296 }
297
298 static constexpr ostream_format const of_ = ostream_format::direct;
299 property::id id_;
301};
302
303} // namespace detail
304
305
310public:
316 : detail::n_bytes_property<1>{
317 id::payload_format_indicator,
318 {
319 [&] {
320 if (fmt == payload_format::binary) return char(0);
321 return char(1);
322 }()
323 }
324 }
325 {}
326
327 template <typename It, typename End>
328 payload_format_indicator(It b, End e)
329 : detail::n_bytes_property<1>{id::payload_format_indicator, b, e} {}
330
336 return
337 [&] {
338 if (buf_.front() == 0) return payload_format::binary;
339 return payload_format::string;
340 } ();
341 }
342
343 static constexpr detail::ostream_format const of_ = detail::ostream_format::binary_string;
344};
345
346
351public:
357 : detail::n_bytes_property<4>{id::message_expiry_interval, endian_static_vector(val)} {}
358
359 template <typename It, typename End>
360 message_expiry_interval(It b, End e)
361 : detail::n_bytes_property<4>{id::message_expiry_interval, b, e} {}
362
367 std::uint32_t val() const {
368 return endian_load<std::uint32_t>(buf_.data());
369 }
370};
371
376public:
382 : detail::string_property{id::content_type, force_move(val)} {}
383};
384
389public:
395 : detail::string_property{id::response_topic, force_move(val)} {}
396};
397
402public:
408 : detail::binary_property{id::correlation_data, force_move(val)} {}
409};
410
415public:
421 : detail::variable_property{id::subscription_identifier, subscription_id} {}
422};
423
428public:
434 : detail::n_bytes_property<4>{id::session_expiry_interval, endian_static_vector(val)} {
435 }
436
437 template <typename It>
438 session_expiry_interval(It b, It e)
439 : detail::n_bytes_property<4>{id::session_expiry_interval, b, e} {}
440
445 std::uint32_t val() const {
446 return endian_load<std::uint32_t>(buf_.data());
447 }
448};
449
454public:
460 : detail::string_property{id::assigned_client_identifier, force_move(val)} {}
461};
462
467public:
472 server_keep_alive(std::uint16_t val)
473 : detail::n_bytes_property<2>{id::server_keep_alive, endian_static_vector(val)} {}
474
475 template <typename It, typename End>
476 server_keep_alive(It b, End e)
477 : detail::n_bytes_property<2>{id::server_keep_alive, b, e} {}
478
483 std::uint16_t val() const {
484 return endian_load<uint16_t>(buf_.data());
485 }
486};
487
492public:
498 : detail::string_property{id::authentication_method, force_move(val)} {}
499};
500
505public:
511 : detail::binary_property{id::authentication_data, force_move(val)} {}
512};
513
518public:
524 : detail::n_bytes_property<1>{
525 id::request_problem_information,
526 {
527 [&] {
528 if (value) return char(1);
529 return char(0);
530 }()
531 }
532 }
533 {}
534 template <typename It, typename End>
535 request_problem_information(It b, End e)
536 : detail::n_bytes_property<1>{id::request_problem_information, b, e} {}
537
542 bool val() const {
543 return buf_.front() == 1;
544 }
545};
546
551public:
557 : detail::n_bytes_property<4>{id::will_delay_interval, endian_static_vector(val)} {}
558
559 template <typename It, typename End>
560 will_delay_interval(It b, End e)
561 : detail::n_bytes_property<4>{id::will_delay_interval, b, e} {}
562
567 std::uint32_t val() const {
568 return endian_load<uint32_t>(buf_.data());
569 }
570};
571
576public:
582 : detail::n_bytes_property<1>{
583 id::request_response_information,
584 {
585 [&] {
586 if (value) return char(1);
587 return char(0);
588 }()
589 }
590 }
591 {}
592
593 template <typename It, typename End>
594 request_response_information(It b, End e)
595 : detail::n_bytes_property<1>(id::request_response_information, b, e) {}
596
601 bool val() const {
602 return buf_.front() == 1;
603 }
604};
605
610public:
616 : detail::string_property{id::response_information, force_move(val)} {}
617};
618
623public:
629 : detail::string_property{id::server_reference, force_move(val)} {}
630};
631
636public:
642 : detail::string_property{id::reason_string, force_move(val)} {}
643};
644
649public:
654 receive_maximum(std::uint16_t val)
655 : detail::n_bytes_property<2>{id::receive_maximum, endian_static_vector(val)} {
656 if (val == 0) {
657 throw make_error(
658 errc::bad_message,
659 "property::receive_maximum value is invalid"
660 );
661 }
662 }
663
664 template <typename It, typename End>
665 receive_maximum(It b, End e)
666 : detail::n_bytes_property<2>{id::receive_maximum, b, e} {
667 if (val() == 0) {
668 throw make_error(
669 errc::bad_message,
670 "property::receive_maximum value is invalid"
671 );
672 }
673 }
674
679 std::uint16_t val() const {
680 return endian_load<std::uint16_t>(buf_.data());
681 }
682};
683
684
689public:
695 : detail::n_bytes_property<2>{id::topic_alias_maximum, endian_static_vector(val)} {}
696
697 template <typename It, typename End>
698 topic_alias_maximum(It b, End e)
699 : detail::n_bytes_property<2>{id::topic_alias_maximum, b, e} {}
700
705 std::uint16_t val() const {
706 return endian_load<std::uint16_t>(buf_.data());
707 }
708};
709
710
715public:
720 topic_alias(std::uint16_t val)
721 : detail::n_bytes_property<2>{id::topic_alias, endian_static_vector(val)} {}
722
723 template <typename It, typename End>
724 topic_alias(It b, End e)
725 : detail::n_bytes_property<2>(id::topic_alias, b, e) {}
726
731 std::uint16_t val() const {
732 return endian_load<std::uint16_t>(buf_.data());
733 }
734};
735
740public:
746 : detail::n_bytes_property<1>{id::maximum_qos, {static_cast<char>(value)}} {
747 if (value != qos::at_most_once &&
748 value != qos::at_least_once) {
749 throw make_error(
750 errc::bad_message,
751 "property::maximum_qos value is invalid"
752 );
753 }
754 }
755
756 template <typename It, typename End>
757 maximum_qos(It b, End e)
758 : detail::n_bytes_property<1>{id::maximum_qos, b, e} {}
759
764 std::uint8_t val() const {
765 return static_cast<std::uint8_t>(buf_.front());
766 }
767
768 static constexpr const detail::ostream_format of_ = detail::ostream_format::int_cast;
769};
770
775public:
781 : detail::n_bytes_property<1>{
782 id::retain_available,
783 {
784 [&] {
785 if (value) return char(1);
786 return char(0);
787 }()
788 }
789 }
790 {}
791
792 template <typename It, typename End>
793 retain_available(It b, End e)
794 : detail::n_bytes_property<1>{id::retain_available, b, e} {}
795
800 bool val() const {
801 return buf_.front() == 1;
802 }
803};
804
805
809class user_property : private boost::totally_ordered<user_property> {
810public:
816 : key_{force_move(key)}, val_{force_move(val)} {
817 if (key_.size() > 0xffff) {
818 throw make_error(
819 errc::bad_message,
820 "property::user_property key length is invalid"
821 );
822 }
823 if (val_.size() > 0xffff) {
824 throw make_error(
825 errc::bad_message,
826 "property::user_property val length is invalid"
827 );
828 }
829 }
830
835 std::vector<as::const_buffer> const_buffer_sequence() const {
836 std::vector<as::const_buffer> v;
838 v.emplace_back(as::buffer(&id_, 1));
839 v.emplace_back(as::buffer(key_.len.data(), key_.len.size()));
840 v.emplace_back(as::buffer(key_.buf));
841 v.emplace_back(as::buffer(val_.len.data(), val_.len.size()));
842 v.emplace_back(as::buffer(val_.buf));
843 return v;
844 }
845
850 property::id id() const {
851 return id_;
852 }
853
858 std::size_t size() const {
859 return
860 1 + // id_
861 key_.size() +
862 val_.size();
863 }
864
869 static constexpr std::size_t num_of_const_buffer_sequence() {
870 return
871 1 + // header
872 2 + // key (len, buf)
873 2; // val (len, buf)
874 }
875
880 constexpr buffer const& key() const {
881 return key_.buf;
882 }
883
888 constexpr buffer const& val() const {
889 return val_.buf;
890 }
891
892 friend bool operator<(user_property const& lhs, user_property const& rhs) {
893 return std::tie(lhs.id_, lhs.key_.buf, lhs.val_.buf) < std::tie(rhs.id_, rhs.key_.buf, rhs.val_.buf);
894 }
895
896 friend bool operator==(user_property const& lhs, user_property const& rhs) {
897 return std::tie(lhs.id_, lhs.key_.buf, lhs.val_.buf) == std::tie(rhs.id_, rhs.key_.buf, rhs.val_.buf);
898 }
899
900 static constexpr detail::ostream_format const of_ = detail::ostream_format::key_val;
901
902private:
903 struct len_str {
904 explicit len_str(buffer b)
905 : buf{force_move(b)},
906 len{endian_static_vector(boost::numeric_cast<std::uint16_t>(buf.size()))}
907 {
908#if 0 // TBD
909 auto r = utf8string::validate_contents(buf);
910 if (r != utf8string::validation::well_formed) throw utf8string_contents_error(r);
911#endif
912 }
913
914 std::size_t size() const {
915 return len.size() + buf.size();
916 }
917 buffer buf;
918 static_vector<char, 2> len;
919 };
920
921private:
922 property::id id_ = id::user_property;
923 len_str key_;
924 len_str val_;
925};
926
931public:
937 : detail::n_bytes_property<4>{id::maximum_packet_size, endian_static_vector(val)} {
938 if (val == 0) {
939 throw make_error(
940 errc::bad_message,
941 "property::maximum_packet_size value is invalid"
942 );
943 }
944 }
945
946 template <typename It, typename End>
947 maximum_packet_size(It b, End e)
948 : detail::n_bytes_property<4>{id::maximum_packet_size, b, e} {
949 if (val() == 0) {
950 throw make_error(
951 errc::bad_message,
952 "property::maximum_packet_size value is invalid"
953 );
954 }
955 }
956
961 std::uint32_t val() const {
962 return endian_load<std::uint32_t>(buf_.data());
963 }
964};
965
966
971public:
977 : detail::n_bytes_property<1>{
978 id::wildcard_subscription_available,
979 {
980 [&] {
981 if (value) return char(1);
982 return char(0);
983 }()
984 }
985 }
986 {}
987
988 template <typename It, typename End>
989 wildcard_subscription_available(It b, End e)
990 : detail::n_bytes_property<1>{id::wildcard_subscription_available, b, e} {}
991
996 bool val() const {
997 return buf_.front() == 1;
998 }
999};
1000
1001
1006public:
1012 : detail::n_bytes_property<1>{
1013 id::subscription_identifier_available,
1014 {
1015 [&] {
1016 if (value) return char(1);
1017 return char(0);
1018 }()
1019 }
1020 }
1021 {}
1022
1023 template <typename It, typename End>
1024 subscription_identifier_available(It b, End e)
1025 : detail::n_bytes_property<1>{id::subscription_identifier_available, b, e} {}
1026
1031 bool val() const {
1032 return buf_.front() == 1;
1033 }
1034};
1035
1036
1041public:
1047 : detail::n_bytes_property<1>{
1048 id::shared_subscription_available,
1049 {
1050 [&] {
1051 if (value) return char(1);
1052 return char(0);
1053 }()
1054 }
1055 }
1056 {}
1057
1058 template <typename It, typename End>
1059 shared_subscription_available(It b, End e)
1060 : detail::n_bytes_property<1>{id::shared_subscription_available, b, e} {}
1061
1066 bool val() const {
1067 return buf_.front() == 1;
1068 }
1069};
1070
1071template <typename Property>
1072std::enable_if_t< Property::of_ == detail::ostream_format::direct, std::ostream& >
1073operator<<(std::ostream& o, Property const& p) {
1074 o <<
1075 "{" <<
1076 "id:" << p.id() << "," <<
1077 "val:" << p.val() <<
1078 "}";
1079 return o;
1080}
1081
1082template <typename Property>
1083std::enable_if_t< Property::of_ == detail::ostream_format::int_cast, std::ostream& >
1084operator<<(std::ostream& o, Property const& p) {
1085 o <<
1086 "{" <<
1087 "id:" << p.id() << "," <<
1088 "val:" << static_cast<int>(p.val()) <<
1089 "}";
1090 return o;
1091}
1092
1093template <typename Property>
1094std::enable_if_t< Property::of_ == detail::ostream_format::key_val, std::ostream& >
1095operator<<(std::ostream& o, Property const& p) {
1096 o <<
1097 "{" <<
1098 "id:" << p.id() << "," <<
1099 "key:" << p.key() << "," <<
1100 "val:" << p.val() <<
1101 "}";
1102 return o;
1103}
1104
1105template <typename Property>
1106std::enable_if_t< Property::of_ == detail::ostream_format::binary_string, std::ostream& >
1107operator<<(std::ostream& o, Property const& p) {
1108 // Note this only compiles because both strings below are the same length.
1109 o <<
1110 "{" <<
1111 "id:" << p.id() << "," <<
1112 "val:" <<
1113 [&] {
1114 if (p.val() == payload_format::binary) return "binary";
1115 return "string";
1116 }() <<
1117 "}";
1118 return o;
1119}
1120
1121template <typename Property>
1122std::enable_if_t< Property::of_ == detail::ostream_format::json_like, std::ostream& >
1123operator<<(std::ostream& o, Property const& p) {
1124 o <<
1125 "{" <<
1126 "id:" << p.id() << "," <<
1127 "val:" << json_like_out(p.val()) <<
1128 "}";
1129 return o;
1130}
1131
1132
1133} // namespace property
1134
1135} // namespace async_mqtt
1136
1137#endif // ASYNC_MQTT_PACKET_PROPERTY_HPP
Definition packet_variant.hpp:49
buffer that has string_view interface This class provides string_view interface. This class hold stri...
Definition buffer.hpp:30
assigned_client_identifier(buffer val)
constructor
Definition property.hpp:459
authentication_data(buffer val)
constructor
Definition property.hpp:510
authentication_method(buffer val)
constructor
Definition property.hpp:497
Definition property.hpp:375
content_type(buffer val)
constructor
Definition property.hpp:381
Definition property.hpp:401
correlation_data(buffer val)
constructor
Definition property.hpp:407
maximum_packet_size(std::uint32_t val)
constructor
Definition property.hpp:936
std::uint32_t val() const
Get value.
Definition property.hpp:961
Definition property.hpp:739
std::uint8_t val() const
Get value.
Definition property.hpp:764
maximum_qos(qos value)
constructor
Definition property.hpp:745
message_expiry_interval(std::uint32_t val)
constructor
Definition property.hpp:356
std::uint32_t val() const
Get value.
Definition property.hpp:367
payload_format val() const
Get value.
Definition property.hpp:335
payload_format_indicator(payload_format fmt=payload_format::binary)
constructor
Definition property.hpp:315
Definition property.hpp:635
reason_string(buffer val)
constructor
Definition property.hpp:641
Definition property.hpp:648
receive_maximum(std::uint16_t val)
constructor
Definition property.hpp:654
std::uint16_t val() const
Get value.
Definition property.hpp:679
bool val() const
Get value.
Definition property.hpp:542
request_problem_information(bool value)
constructor
Definition property.hpp:523
request_response_information(bool value)
constructor
Definition property.hpp:581
bool val() const
Get value.
Definition property.hpp:601
response_information(buffer val)
constructor
Definition property.hpp:615
Definition property.hpp:388
response_topic(buffer val)
constructor
Definition property.hpp:394
Definition property.hpp:774
bool val() const
Get value.
Definition property.hpp:800
retain_available(bool value)
constructor
Definition property.hpp:780
Definition property.hpp:466
server_keep_alive(std::uint16_t val)
constructor
Definition property.hpp:472
std::uint16_t val() const
Get value.
Definition property.hpp:483
Definition property.hpp:622
server_reference(buffer val)
constructor
Definition property.hpp:628
std::uint32_t val() const
Get value.
Definition property.hpp:445
session_expiry_interval(std::uint32_t val)
constructor
Definition property.hpp:433
bool val() const
Get value.
Definition property.hpp:1066
shared_subscription_available(bool value)
constructor
Definition property.hpp:1046
bool val() const
Get value.
Definition property.hpp:1031
subscription_identifier_available(bool value)
constructor
Definition property.hpp:1011
subscription_identifier(std::uint32_t subscription_id)
constructor
Definition property.hpp:420
topic_alias_maximum(std::uint16_t val)
constructor
Definition property.hpp:694
std::uint16_t val() const
Get value.
Definition property.hpp:705
Definition property.hpp:714
std::uint16_t val() const
Get value.
Definition property.hpp:731
topic_alias(std::uint16_t val)
constructor
Definition property.hpp:720
Definition property.hpp:809
constexpr buffer const & key() const
Get key.
Definition property.hpp:880
std::size_t size() const
Get property size.
Definition property.hpp:858
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
Definition property.hpp:835
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
Definition property.hpp:869
constexpr buffer const & val() const
Get value.
Definition property.hpp:888
user_property(buffer key, buffer val)
constructor
Definition property.hpp:815
property::id id() const
Get property::id.
Definition property.hpp:850
bool val() const
Get value.
Definition property.hpp:996
wildcard_subscription_available(bool value)
constructor
Definition property.hpp:976
will_delay_interval(std::uint32_t val)
constructor
Definition property.hpp:556
std::uint32_t val() const
Get value.
Definition property.hpp:567
payload_format
Definition property.hpp:45
qos
MQTT QoS.
Definition qos.hpp:23
binary_property
Definition property.hpp:139
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
Definition property.hpp:187
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
Definition property.hpp:158
property::id id() const
Get property::id.
Definition property.hpp:171
std::size_t size() const
Get property size.
Definition property.hpp:179
constexpr buffer const & val() const
Get value.
Definition property.hpp:195
N bytes_property.
Definition property.hpp:70
property::id id() const
Get property::id.
Definition property.hpp:103
std::size_t size() const
Get property size.
Definition property.hpp:111
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
Definition property.hpp:91
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
Definition property.hpp:119
string_property
Definition property.hpp:216
variable property
Definition property.hpp:233
property::id id() const
Get property::id.
Definition property.hpp:255
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
Definition property.hpp:271
std::size_t size() const
Get property size.
Definition property.hpp:263
std::size_t val() const
Get value.
Definition property.hpp:279
std::vector< as::const_buffer > const_buffer_sequence() const
Add const buffer sequence into the given buffer.
Definition property.hpp:243