diff options
author | Alan Conway <aconway@apache.org> | 2006-12-19 17:55:16 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2006-12-19 17:55:16 +0000 |
commit | 19e767250f689cac7ab950f68e6421a4490f76f6 (patch) | |
tree | 81df6cd819e1f0fa23c71f4761978445c4353904 /cpp/lib | |
parent | 7edf1cc45ee35542df2ba4e3ebd2bc4d9e9dd9b9 (diff) | |
download | qpid-python-19e767250f689cac7ab950f68e6421a4490f76f6.tar.gz |
* cpp/gen/Makefile.am: fixed generated code dependencies.
* *Channel,SessionHandlerImpl,FramingTest: added FieldTable argument
to consume() to conform to updated XML.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@488745 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib')
-rw-r--r-- | cpp/lib/broker/BrokerChannel.cpp | 2 | ||||
-rw-r--r-- | cpp/lib/broker/BrokerChannel.h | 3 | ||||
-rw-r--r-- | cpp/lib/broker/SessionHandlerImpl.cpp | 13 | ||||
-rw-r--r-- | cpp/lib/broker/SessionHandlerImpl.h | 24 | ||||
-rw-r--r-- | cpp/lib/client/ClientChannel.cpp | 14 | ||||
-rw-r--r-- | cpp/lib/client/ClientChannel.h | 7 |
6 files changed, 35 insertions, 28 deletions
diff --git a/cpp/lib/broker/BrokerChannel.cpp b/cpp/lib/broker/BrokerChannel.cpp index 8805b72774..5d4f68a8af 100644 --- a/cpp/lib/broker/BrokerChannel.cpp +++ b/cpp/lib/broker/BrokerChannel.cpp @@ -53,7 +53,7 @@ bool Channel::exists(const string& consumerTag){ return consumers.find(consumerTag) != consumers.end(); } -void Channel::consume(string& tag, Queue::shared_ptr queue, bool acks, bool exclusive, ConnectionToken* const connection){ +void Channel::consume(string& tag, Queue::shared_ptr queue, bool acks, bool exclusive, ConnectionToken* const connection, const FieldTable*){ if(tag.empty()) tag = tagGenerator.generate(); ConsumerImpl* c(new ConsumerImpl(this, tag, queue, connection, acks)); try{ diff --git a/cpp/lib/broker/BrokerChannel.h b/cpp/lib/broker/BrokerChannel.h index 50c8358e96..fa3912c78e 100644 --- a/cpp/lib/broker/BrokerChannel.h +++ b/cpp/lib/broker/BrokerChannel.h @@ -103,7 +103,8 @@ namespace qpid { inline u_int32_t setPrefetchSize(u_int32_t size){ return prefetchSize = size; } inline u_int16_t setPrefetchCount(u_int16_t count){ return prefetchCount = count; } bool exists(const string& consumerTag); - void consume(string& tag, Queue::shared_ptr queue, bool acks, bool exclusive, ConnectionToken* const connection = 0); + void consume(string& tag, Queue::shared_ptr queue, bool acks, bool exclusive, + ConnectionToken* const connection = 0, const qpid::framing::FieldTable* = 0); void cancel(const string& tag); bool get(Queue::shared_ptr queue, bool ackExpected); void begin(); diff --git a/cpp/lib/broker/SessionHandlerImpl.cpp b/cpp/lib/broker/SessionHandlerImpl.cpp index ad203b4515..bd6ca9dee9 100644 --- a/cpp/lib/broker/SessionHandlerImpl.cpp +++ b/cpp/lib/broker/SessionHandlerImpl.cpp @@ -360,10 +360,12 @@ void SessionHandlerImpl::BasicHandlerImpl::qos(u_int16_t channel, u_int32_t pref parent->client->getBasic().qosOk(channel); } -void SessionHandlerImpl::BasicHandlerImpl::consume(u_int16_t channelId, u_int16_t /*ticket*/, - const string& queueName, const string& consumerTag, - bool noLocal, bool noAck, bool exclusive, - bool nowait){ +void SessionHandlerImpl::BasicHandlerImpl::consume( + u_int16_t channelId, u_int16_t /*ticket*/, + const string& queueName, const string& consumerTag, + bool noLocal, bool noAck, bool exclusive, + bool nowait, const FieldTable& fields) +{ Queue::shared_ptr queue = parent->getQueue(queueName, channelId); Channel* channel = parent->channels[channelId]; @@ -373,7 +375,8 @@ void SessionHandlerImpl::BasicHandlerImpl::consume(u_int16_t channelId, u_int16_ try{ string newTag = consumerTag; - channel->consume(newTag, queue, !noAck, exclusive, noLocal ? parent : 0); + channel->consume( + newTag, queue, !noAck, exclusive, noLocal ? parent : 0, &fields); if(!nowait) parent->client->getBasic().consumeOk(channelId, newTag); diff --git a/cpp/lib/broker/SessionHandlerImpl.h b/cpp/lib/broker/SessionHandlerImpl.h index 043ad8bf98..7e631b4505 100644 --- a/cpp/lib/broker/SessionHandlerImpl.h +++ b/cpp/lib/broker/SessionHandlerImpl.h @@ -61,7 +61,7 @@ struct ConnectionException : public std::exception { }; class Settings { -public: + public: const u_int32_t timeout;//timeout for auto-deleted queues (in ms) const u_int64_t stagingThreshold; @@ -125,7 +125,6 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, public: inline ConnectionHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} - // Change to match new code generator function signature (adding const to string& and FieldTable&) - kpvdr 2006-11-20 virtual void startOk(u_int16_t channel, const qpid::framing::FieldTable& clientProperties, const string& mechanism, const string& response, const string& locale); @@ -172,7 +171,6 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, public: inline ExchangeHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} - // Change to match new code generator function signature (adding const to string& and FieldTable&) - kpvdr 2006-11-20 virtual void declare(u_int16_t channel, u_int16_t ticket, const string& exchange, const string& type, bool passive, bool durable, bool autoDelete, bool internal, bool nowait, const qpid::framing::FieldTable& arguments); @@ -189,17 +187,14 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, public: inline QueueHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} - // Change to match new code generator function signature (adding const to string& and FieldTable&) - kpvdr 2006-11-20 virtual void declare(u_int16_t channel, u_int16_t ticket, const string& queue, bool passive, bool durable, bool exclusive, bool autoDelete, bool nowait, const qpid::framing::FieldTable& arguments); - // Change to match new code generator function signature (adding const to string& and FieldTable&) - kpvdr 2006-11-20 virtual void bind(u_int16_t channel, u_int16_t ticket, const string& queue, const string& exchange, const string& routingKey, bool nowait, const qpid::framing::FieldTable& arguments); - - // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20 + virtual void purge(u_int16_t channel, u_int16_t ticket, const string& queue, bool nowait); @@ -216,19 +211,18 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, inline BasicHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} virtual void qos(u_int16_t channel, u_int32_t prefetchSize, u_int16_t prefetchCount, bool global); - - // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20 - virtual void consume(u_int16_t channel, u_int16_t ticket, const string& queue, const string& consumerTag, - bool noLocal, bool noAck, bool exclusive, bool nowait); + + virtual void consume( + u_int16_t channel, u_int16_t ticket, const string& queue, + const string& consumerTag, bool noLocal, bool noAck, + bool exclusive, bool nowait, + const qpid::framing::FieldTable& fields); - // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20 virtual void cancel(u_int16_t channel, const string& consumerTag, bool nowait); - // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20 virtual void publish(u_int16_t channel, u_int16_t ticket, const string& exchange, const string& routingKey, bool mandatory, bool immediate); - // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20 virtual void get(u_int16_t channel, u_int16_t ticket, const string& queue, bool noAck); virtual void ack(u_int16_t channel, u_int64_t deliveryTag, bool multiple); @@ -242,7 +236,7 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, class TxHandlerImpl : public virtual TxHandler{ SessionHandlerImpl* parent; - public: + public: TxHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} virtual ~TxHandlerImpl() {} virtual void select(u_int16_t channel); diff --git a/cpp/lib/client/ClientChannel.cpp b/cpp/lib/client/ClientChannel.cpp index ba21199732..c7b8e39ae5 100644 --- a/cpp/lib/client/ClientChannel.cpp +++ b/cpp/lib/client/ClientChannel.cpp @@ -124,11 +124,17 @@ void Channel::bind(const Exchange& exchange, const Queue& queue, const std::stri } } -void Channel::consume(Queue& queue, std::string& tag, MessageListener* listener, - int ackMode, bool noLocal, bool synch){ - +void Channel::consume( + Queue& queue, std::string& tag, MessageListener* listener, + int ackMode, bool noLocal, bool synch, const FieldTable* fields) +{ string q = queue.getName(); - AMQFrame* frame = new AMQFrame(id, new BasicConsumeBody(version, 0, q, (string&) tag, noLocal, ackMode == NO_ACK, false, !synch)); + AMQFrame* frame = + new AMQFrame( + id, + new BasicConsumeBody( + version, 0, q, tag, noLocal, ackMode == NO_ACK, false, !synch, + fields ? *fields : FieldTable())); if(synch){ sendAndReceive(frame, method_bodies.basic_consume_ok); BasicConsumeOkBody::shared_ptr response = dynamic_pointer_cast<BasicConsumeOkBody, AMQMethodBody>(responses.getResponse()); diff --git a/cpp/lib/client/ClientChannel.h b/cpp/lib/client/ClientChannel.h index e617da05c0..27509a10d9 100644 --- a/cpp/lib/client/ClientChannel.h +++ b/cpp/lib/client/ClientChannel.h @@ -213,8 +213,11 @@ namespace client { * @param synch if true this call will block until a response * is received from the broker */ - void consume(Queue& queue, std::string& tag, MessageListener* listener, - int ackMode = NO_ACK, bool noLocal = false, bool synch = true); + void consume( + Queue& queue, std::string& tag, MessageListener* listener, + int ackMode = NO_ACK, bool noLocal = false, bool synch = true, + const qpid::framing::FieldTable* fields = 0); + /** * Cancels a subscription previously set up through a call to consume(). * |