async_mqtt 5.0.0
Loading...
Searching...
No Matches
property_id.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_ID_HPP)
8#define ASYNC_MQTT_PACKET_PROPERTY_ID_HPP
9
10#include <cstdint>
11#include <ostream>
12
13namespace async_mqtt {
14
15namespace property {
16
17enum class id {
18 payload_format_indicator = 1,
19 message_expiry_interval = 2,
20 content_type = 3,
21 response_topic = 8,
22 correlation_data = 9,
23 subscription_identifier = 11,
24 session_expiry_interval = 17,
25 assigned_client_identifier = 18,
26 server_keep_alive = 19,
27 authentication_method = 21,
28 authentication_data = 22,
29 request_problem_information = 23,
30 will_delay_interval = 24,
31 request_response_information = 25,
32 response_information = 26,
33 server_reference = 28,
34 reason_string = 31,
35 receive_maximum = 33,
36 topic_alias_maximum = 34,
37 topic_alias = 35,
38 maximum_qos = 36,
39 retain_available = 37,
40 user_property = 38,
41 maximum_packet_size = 39,
42 wildcard_subscription_available = 40,
43 subscription_identifier_available = 41,
44 shared_subscription_available = 42,
45};
46
47constexpr char const* id_to_str(id v) {
48 switch (v) {
49 case id::payload_format_indicator: return "payload_format_indicator";
50 case id::message_expiry_interval: return "message_expiry_interval";
51 case id::content_type: return "content_type";
52 case id::response_topic: return "response_topic";
53 case id::correlation_data: return "correlation_data";
54 case id::subscription_identifier: return "subscription_identifier";
55 case id::session_expiry_interval: return "session_expiry_interval";
56 case id::assigned_client_identifier: return "assigned_client_identifier";
57 case id::server_keep_alive: return "server_keep_alive";
58 case id::authentication_method: return "authentication_method";
59 case id::authentication_data: return "authentication_data";
60 case id::request_problem_information: return "request_problem_information";
61 case id::will_delay_interval: return "will_delay_interval";
62 case id::request_response_information: return "request_response_information";
63 case id::response_information: return "response_information";
64 case id::server_reference: return "server_reference";
65 case id::reason_string: return "reason_string";
66 case id::receive_maximum: return "receive_maximum";
67 case id::topic_alias_maximum: return "topic_alias_maximum";
68 case id::topic_alias: return "topic_alias";
69 case id::maximum_qos: return "maximum_qos";
70 case id::retain_available: return "retain_available";
71 case id::user_property: return "user_property";
72 case id::maximum_packet_size: return "maximum_packet_size";
73 case id::wildcard_subscription_available: return "wildcard_subscription_available";
74 case id::subscription_identifier_available: return "subscription_identifier_available";
75 case id::shared_subscription_available: return "shared_subscription_available";
76 default: return "invalid id";
77 }
78}
79
80inline
81std::ostream& operator<<(std::ostream& os, id val)
82{
83 os << id_to_str(val);
84 return os;
85}
86
87} // namespace property
88
89} // namespace async_mqtt
90
91#endif // ASYNC_MQTT_PACKET_PROPERTY_ID_HPP