00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _QueueBindings_
00022 #define _QueueBindings_
00023
00024 #include "qpid/framing/FieldTable.h"
00025 #include <boost/ptr_container/ptr_list.hpp>
00026 #include <boost/shared_ptr.hpp>
00027 #include <algorithm>
00028
00029 namespace qpid {
00030 namespace broker {
00031
00032 class ExchangeRegistry;
00033 class Queue;
00034
00035 struct QueueBinding{
00036 std::string exchange;
00037 std::string key;
00038 qpid::framing::FieldTable args;
00039 QueueBinding(const std::string& exchange, const std::string& key, const qpid::framing::FieldTable& args);
00040 };
00041
00042 class QueueBindings
00043 {
00044 public:
00045
00047 template <class F> void eachBinding(F f) const { std::for_each(bindings.begin(), bindings.end(), f); }
00048
00049 void add(const std::string& exchange, const std::string& key, const qpid::framing::FieldTable& args);
00050 void unbind(ExchangeRegistry& exchanges, boost::shared_ptr<Queue> queue);
00051
00052 private:
00053 typedef std::vector<QueueBinding> Bindings;
00054 Bindings bindings;
00055 };
00056
00057
00058 }}
00059
00060
00061 #endif