azure-core-amqp
1.0.0-beta.10
Loading...
Searching...
No Matches
inc
azure
core
amqp
models
amqp_header.hpp
1
// Copyright (c) Microsoft Corporation.
2
// Licensed under the MIT License.
3
4
#pragma once
5
6
#include <azure/core/nullable.hpp>
7
8
#include <chrono>
9
#include <cstddef>
10
#include <cstdint>
11
#include <exception>
12
#include <stdexcept>
13
#include <vector>
14
15
namespace
Azure {
namespace
Core {
namespace
Amqp {
namespace
Models {
23
struct
MessageHeader
final
24
{
26
MessageHeader
() =
default
;
28
~MessageHeader
() =
default
;
29
31
MessageHeader
(
MessageHeader
&& other) =
default
;
32
34
MessageHeader
&
operator=
(
MessageHeader
&& other) =
default
;
35
37
MessageHeader
(
MessageHeader
const
& other) =
default
;
38
40
MessageHeader
&
operator=
(
MessageHeader
const
& other) =
default
;
41
47
bool
operator==
(
MessageHeader
const
& that)
const
noexcept
;
48
54
bool
Durable
{
false
};
55
61
std::uint8_t
Priority
{4};
// Default priority is 4.
62
68
Nullable<std::chrono::milliseconds>
TimeToLive
;
69
75
bool
IsFirstAcquirer
{
false
};
76
83
std::uint32_t
DeliveryCount
{0};
84
90
bool
ShouldSerialize
() const noexcept;
91
96
static
size_t
GetSerializedSize
(
MessageHeader
const& messageHeader);
97
104
static std::vector<uint8_t>
Serialize
(
MessageHeader
const& messageHeader);
105
110
static
MessageHeader
Deserialize
(std::uint8_t const* data,
size_t
size);
111
};
112
113
std::ostream& operator<<(std::ostream&,
MessageHeader
const&);
114
115
}}}}
// namespace Azure::Core::Amqp::Models
Azure::Core::Amqp::Models::MessageHeader
The message header section carries standard delivery details about the transfer of a message through ...
Definition
amqp_header.hpp:24
Azure::Core::Amqp::Models::MessageHeader::DeliveryCount
std::uint32_t DeliveryCount
The number of unsuccessful previous attempts to deliver this message.
Definition
amqp_header.hpp:83
Azure::Core::Amqp::Models::MessageHeader::MessageHeader
MessageHeader(MessageHeader &&other)=default
Move constructor.
Azure::Core::Amqp::Models::MessageHeader::operator==
bool operator==(MessageHeader const &that) const noexcept
Compare two AMQP Message Headers for equality.
Definition
amqp_header.cpp:27
Azure::Core::Amqp::Models::MessageHeader::Serialize
static std::vector< uint8_t > Serialize(MessageHeader const &messageHeader)
Serializes this MessageHeader into a vector of bytes.
Definition
amqp_header.cpp:144
Azure::Core::Amqp::Models::MessageHeader::~MessageHeader
~MessageHeader()=default
Destructor.
Azure::Core::Amqp::Models::MessageHeader::MessageHeader
MessageHeader(MessageHeader const &other)=default
Copy constructor.
Azure::Core::Amqp::Models::MessageHeader::Durable
bool Durable
True if the message is considered "durable".
Definition
amqp_header.hpp:54
Azure::Core::Amqp::Models::MessageHeader::TimeToLive
Nullable< std::chrono::milliseconds > TimeToLive
If present, defines the time to live for the message.
Definition
amqp_header.hpp:68
Azure::Core::Amqp::Models::MessageHeader::IsFirstAcquirer
bool IsFirstAcquirer
If true, the message has not been acquired by any other link.
Definition
amqp_header.hpp:75
Azure::Core::Amqp::Models::MessageHeader::Deserialize
static MessageHeader Deserialize(std::uint8_t const *data, size_t size)
Deserializes a vector of bytes into a MessageHeader.
Definition
amqp_header.cpp:152
Azure::Core::Amqp::Models::MessageHeader::Priority
std::uint8_t Priority
Priority of the message.
Definition
amqp_header.hpp:61
Azure::Core::Amqp::Models::MessageHeader::operator=
MessageHeader & operator=(MessageHeader const &other)=default
Copy assignment operator.
Azure::Core::Amqp::Models::MessageHeader::GetSerializedSize
static size_t GetSerializedSize(MessageHeader const &messageHeader)
Returns the serialized size of this MessageHeader.
Definition
amqp_header.cpp:136
Azure::Core::Amqp::Models::MessageHeader::MessageHeader
MessageHeader()=default
Default constructor.
Azure::Core::Amqp::Models::MessageHeader::ShouldSerialize
bool ShouldSerialize() const noexcept
Returns true if this MessageHeader should be serialized into an AMQP message.
Definition
amqp_header.cpp:130
Azure::Core::Amqp::Models::MessageHeader::operator=
MessageHeader & operator=(MessageHeader &&other)=default
Move assignment operator.
Generated by
1.9.7