async_mqtt
9.0.1
Loading...
Searching...
No Matches
qos.hpp
1
// Copyright Takatoshi Kondo 2022
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_QOS_HPP)
8
#define ASYNC_MQTT_PACKET_QOS_HPP
9
10
#include <cstdint>
11
#include <ostream>
12
21
namespace
async_mqtt {
22
34
enum class
qos
: std::uint8_t
35
{
36
at_most_once
= 0b00000000,
37
at_least_once
= 0b00000001,
38
exactly_once
= 0b00000010,
39
};
40
52
constexpr
char
const
*
qos_to_str
(
qos
v) {
53
switch
(v) {
54
case
qos::at_most_once
:
return
"at_most_once"
;
55
case
qos::at_least_once
:
return
"at_least_once"
;
56
case
qos::exactly_once
:
return
"exactly_once"
;
57
default
:
return
"invalid_qos"
;
58
}
59
}
60
73
inline
74
std::ostream&
operator<<
(std::ostream& o,
qos
v)
75
{
76
o <<
qos_to_str
(v);
77
return
o;
78
}
79
80
}
// namespace async_mqtt
81
82
#endif
// ASYNC_MQTT_PACKET_QOS_HPP
async_mqtt::operator<<
std::ostream & operator<<(std::ostream &o, mqtt_error v)
output to the stream
async_mqtt::qos
qos
MQTT QoS.
Definition
qos.hpp:35
async_mqtt::qos_to_str
constexpr char const * qos_to_str(qos v)
stringize qos
Definition
qos.hpp:52
async_mqtt::qos::exactly_once
@ exactly_once
Exactly once delivery.
async_mqtt::qos::at_most_once
@ at_most_once
At most once delivery.
async_mqtt::qos::at_least_once
@ at_least_once
At least once delivery.
include
async_mqtt
packet
qos.hpp
Generated by
1.12.0