RMQ - RabbitMQ C++ Library
rmqt_confirmresponse.h
1// Copyright 2020-2023 Bloomberg Finance L.P.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#ifndef INCLUDED_RMQT_CONFIRMRESPONSE
17#define INCLUDED_RMQT_CONFIRMRESPONSE
18
19#include <bdlb_nullablevalue.h>
20#include <bsl_ostream.h>
21#include <bsl_string.h>
22
23namespace BloombergLP {
24namespace rmqt {
25
32
34 public:
35 enum Status { ACK, REJECT, RETURN };
36
40 explicit ConfirmResponse(const Status status);
41
46 ConfirmResponse(const uint16_t code, const bsl::string& reason);
47
48 Status status() const { return d_status; }
49 bdlb::NullableValue<uint16_t> code() const { return d_code; }
50 bdlb::NullableValue<bsl::string> reason() const { return d_reason; }
51
52 private:
53 Status d_status;
54 bdlb::NullableValue<uint16_t> d_code;
55 bdlb::NullableValue<bsl::string> d_reason;
56};
57
58bsl::ostream& operator<<(bsl::ostream&, const rmqt::ConfirmResponse&);
59bool operator==(const rmqt::ConfirmResponse& lhs,
60 const rmqt::ConfirmResponse& rhs);
61
62} // namespace rmqt
63} // namespace BloombergLP
64#endif
An AMQP publisher confirm response.
Definition: rmqt_confirmresponse.h:33
ConfirmResponse(const Status status)
ConfirmResponse constructor.
Definition: rmqt_confirmresponse.cpp:26