00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _FanOutExchange_
00022 #define _FanOutExchange_
00023
00024 #include <map>
00025 #include <vector>
00026 #include "Exchange.h"
00027 #include "qpid/framing/FieldTable.h"
00028 #include "qpid/sys/Monitor.h"
00029 #include "Queue.h"
00030
00031 namespace qpid {
00032 namespace broker {
00033
00034 class FanOutExchange : public virtual Exchange {
00035 std::vector<Binding::shared_ptr> bindings;
00036 qpid::sys::RWlock lock;
00037
00038 public:
00039 static const std::string typeName;
00040
00041 FanOutExchange(const std::string& name, management::Manageable* parent = 0);
00042 FanOutExchange(const string& _name, bool _durable,
00043 const qpid::framing::FieldTable& _args,
00044 management::Manageable* parent = 0);
00045
00046 virtual std::string getType() const { return typeName; }
00047
00048 virtual bool bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
00049
00050 virtual bool unbind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
00051
00052 virtual void route(Deliverable& msg, const std::string& routingKey, const qpid::framing::FieldTable* args);
00053
00054 virtual bool isBound(Queue::shared_ptr queue, const string* const routingKey, const qpid::framing::FieldTable* const args);
00055
00056 virtual ~FanOutExchange();
00057 };
00058
00059 }
00060 }
00061
00062
00063
00064 #endif