diff options
author | Gordon Sim <gsim@apache.org> | 2007-04-05 11:48:05 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-04-05 11:48:05 +0000 |
commit | ca78f792bb1d381c85a8e64d1768c7abe7516f70 (patch) | |
tree | 8f7414b4268d406ac205b3405dc7720f886f1dde /qpid/cpp/src/broker/BrokerQueue.cpp | |
parent | 6aaec799e2dd38f39601fe5fe458cadf3834aae8 (diff) | |
download | qpid-python-ca78f792bb1d381c85a8e64d1768c7abe7516f70.tar.gz |
* Further (minor) changes to the interface between store and broker.
* TxBuffer now uses shared_ptr to TxOps (removed DeletingTxOp)
* Queue now persists the field table of settings
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@525801 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/broker/BrokerQueue.cpp')
-rw-r--r-- | qpid/cpp/src/broker/BrokerQueue.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/qpid/cpp/src/broker/BrokerQueue.cpp b/qpid/cpp/src/broker/BrokerQueue.cpp index 08288a9dbd..5d34a52fcc 100644 --- a/qpid/cpp/src/broker/BrokerQueue.cpp +++ b/qpid/cpp/src/broker/BrokerQueue.cpp @@ -216,19 +216,20 @@ namespace const std::string qpidMaxCount("qpid.max_count"); } -void Queue::create(const FieldTable& settings) +void Queue::create(const FieldTable& _settings) { + settings = _settings; //TODO: hold onto settings and persist them as part of encode // in fact settings should be passed in on construction if (store) { store->create(*this); } - configure(settings); + configure(_settings); } -void Queue::configure(const FieldTable& settings) +void Queue::configure(const FieldTable& _settings) { - std::auto_ptr<QueuePolicy> _policy(new QueuePolicy(settings)); + std::auto_ptr<QueuePolicy> _policy(new QueuePolicy(_settings)); if (_policy->getMaxCount() || _policy->getMaxSize()) setPolicy(_policy); } @@ -255,7 +256,7 @@ uint64_t Queue::getPersistenceId() const return persistenceId; } -void Queue::setPersistenceId(uint64_t _persistenceId) +void Queue::setPersistenceId(uint64_t _persistenceId) const { persistenceId = _persistenceId; } @@ -263,13 +264,12 @@ void Queue::setPersistenceId(uint64_t _persistenceId) void Queue::encode(framing::Buffer& buffer) const { buffer.putShortString(name); - //TODO store all required properties + buffer.putFieldTable(settings); } uint32_t Queue::encodedSize() const { - //TODO, revise when storing full set of queue properties - return name.size() + 1/*short string size octet*/; + return name.size() + 1/*short string size octet*/ + settings.size(); } Queue::shared_ptr Queue::decode(QueueRegistry& queues, framing::Buffer& buffer) @@ -277,6 +277,8 @@ Queue::shared_ptr Queue::decode(QueueRegistry& queues, framing::Buffer& buffer) string name; buffer.getShortString(name); std::pair<Queue::shared_ptr, bool> result = queues.declare(name, true); + buffer.getFieldTable(result.first->settings); + result.first->configure(result.first->settings); return result.first; } |