RMQ - RabbitMQ C++ Library
rmqt_exchangebinding.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_EXCHANGEBINDING
17#define INCLUDED_RMQT_EXCHANGEBINDING
18
19#include <rmqt_binding.h>
20#include <rmqt_exchange.h>
21#include <rmqt_fieldvalue.h>
22
23#include <bsl_ostream.h>
24#include <bsl_string.h>
25
26namespace BloombergLP {
27namespace rmqt {
28
33
34class ExchangeBinding : public Binding {
35 public:
42 ExchangeBinding(const ExchangeHandle& sourceExchange,
43 const ExchangeHandle& destinationExchange,
44 const bsl::string& bindingKey,
45 const rmqt::FieldTable& args = rmqt::FieldTable())
46 : Binding(bindingKey, args)
47 , d_sourceExchange(sourceExchange)
48 , d_destinationExchange(destinationExchange)
49 {
50 }
51
52 const ExchangeHandle& sourceExchange() const { return d_sourceExchange; }
53 const ExchangeHandle& destinationExchange() const
54 {
55 return d_destinationExchange;
56 }
57
58 friend bsl::ostream& operator<<(bsl::ostream& os,
59 const ExchangeBinding& queue);
60
61 private:
62 ExchangeHandle d_sourceExchange;
63 ExchangeHandle d_destinationExchange;
64};
65
66bsl::ostream& operator<<(bsl::ostream& os, const ExchangeBinding& queue);
67
68} // namespace rmqt
69} // namespace BloombergLP
70#endif
An AMQP binding.
Definition: rmqt_binding.h:31
An AMQP exchange binding.
Definition: rmqt_exchangebinding.h:34
ExchangeBinding(const ExchangeHandle &sourceExchange, const ExchangeHandle &destinationExchange, const bsl::string &bindingKey, const rmqt::FieldTable &args=rmqt::FieldTable())
Exchange binding constructor.
Definition: rmqt_exchangebinding.h:42
Represents AMQP 0.9.1 Field Table (dict of FieldValues)
Definition: rmqt_fieldvalue.h:108