diff options
author | Kim van der Riet <kpvdr@apache.org> | 2012-05-14 13:53:27 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2012-05-14 13:53:27 +0000 |
commit | 1416b27f148e334d2751ff9a7cf59d6b0f022a14 (patch) | |
tree | 99ee96af45af8e1e975d325f6ddd6658e4e8b184 | |
parent | b6851f7bafd90d24bb518b63e7fc9f91e1cd84eb (diff) | |
download | qpid-python-1416b27f148e334d2751ff9a7cf59d6b0f022a14.tar.gz |
QPID-3858: Restructuring: Moved QueueContext out of MockPersistableQueue class
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1338199 13f79535-47bb-0310-9956-ffa450edef68
5 files changed, 119 insertions, 55 deletions
diff --git a/cpp/src/tests/CMakeLists.txt b/cpp/src/tests/CMakeLists.txt index ba4f5d321e..e8ad5ee8bd 100644 --- a/cpp/src/tests/CMakeLists.txt +++ b/cpp/src/tests/CMakeLists.txt @@ -383,6 +383,7 @@ set (asyncStorePerf_SOURCES storePerftools/asyncPerf/MockPersistableQueue.cpp storePerftools/asyncPerf/MockTransactionContext.cpp storePerftools/asyncPerf/PerfTest.cpp + storePerftools/asyncPerf/QueueContext.cpp storePerftools/asyncPerf/QueuedMessage.cpp storePerftools/asyncPerf/TestOptions.cpp storePerftools/asyncPerf/TestResult.cpp diff --git a/cpp/src/tests/storePerftools/asyncPerf/MockPersistableQueue.cpp b/cpp/src/tests/storePerftools/asyncPerf/MockPersistableQueue.cpp index c1d637f621..aa55ee5a7e 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/MockPersistableQueue.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/MockPersistableQueue.cpp @@ -25,6 +25,7 @@ #include "MockPersistableMessage.h" #include "MockTransactionContext.h" +#include "QueueContext.h" #include "QueuedMessage.h" #include "TestOptions.h" @@ -35,46 +36,6 @@ namespace tests { namespace storePerftools { namespace asyncPerf { -// --- Inner class MockPersistableQueue::QueueContext --- - -MockPersistableQueue::QueueContext::QueueContext(intrusive_ptr q, - const qpid::asyncStore::AsyncOperation::opCode op) : - qpid::broker::BrokerContext(), - m_q(q), - m_op(op) -{ - assert(m_q.get() != 0); -} - -MockPersistableQueue::QueueContext::~QueueContext() -{} - -qpid::asyncStore::AsyncOperation::opCode -MockPersistableQueue::QueueContext::getOpCode() const -{ - return m_op; -} - -const char* -MockPersistableQueue::QueueContext::getOpStr() const -{ - return qpid::asyncStore::AsyncOperation::getOpStr(m_op); -} - -MockPersistableQueue::intrusive_ptr -MockPersistableQueue::QueueContext::getQueue() const -{ - return m_q; -} - -void -MockPersistableQueue::QueueContext::destroy() -{ - delete this; -} - -// --- Class MockPersistableQueue --- - MockPersistableQueue::MockPersistableQueue(const std::string& name, const qpid::framing::FieldTable& /*args*/, qpid::asyncStore::AsyncStoreImpl* store, diff --git a/cpp/src/tests/storePerftools/asyncPerf/MockPersistableQueue.h b/cpp/src/tests/storePerftools/asyncPerf/MockPersistableQueue.h index 2e06b0256e..3867cad08d 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/MockPersistableQueue.h +++ b/cpp/src/tests/storePerftools/asyncPerf/MockPersistableQueue.h @@ -48,6 +48,7 @@ namespace tests { namespace storePerftools { namespace asyncPerf { +class QueueContext; class QueuedMessage; class TestOptions; @@ -58,21 +59,6 @@ class MockPersistableQueue : public qpid::broker::PersistableQueue, public qpid: public: typedef boost::intrusive_ptr<MockPersistableQueue> intrusive_ptr; - class QueueContext : public qpid::broker::BrokerContext - { - public: - QueueContext(intrusive_ptr q, - const qpid::asyncStore::AsyncOperation::opCode op); - virtual ~QueueContext(); - qpid::asyncStore::AsyncOperation::opCode getOpCode() const; - const char* getOpStr() const; - intrusive_ptr getQueue() const; - void destroy(); - protected: - intrusive_ptr m_q; - const qpid::asyncStore::AsyncOperation::opCode m_op; - }; - MockPersistableQueue(const std::string& name, const qpid::framing::FieldTable& args, qpid::asyncStore::AsyncStoreImpl* store, diff --git a/cpp/src/tests/storePerftools/asyncPerf/QueueContext.cpp b/cpp/src/tests/storePerftools/asyncPerf/QueueContext.cpp new file mode 100644 index 0000000000..2b690a5d71 --- /dev/null +++ b/cpp/src/tests/storePerftools/asyncPerf/QueueContext.cpp @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * \file QueueContext.cpp + */ + +#include "QueueContext.h" + +namespace tests { +namespace storePerftools { +namespace asyncPerf { + +QueueContext::QueueContext(MockPersistableQueue::intrusive_ptr q, + const qpid::asyncStore::AsyncOperation::opCode op) : + qpid::broker::BrokerContext(), + m_q(q), + m_op(op) +{ + assert(m_q.get() != 0); +} + +QueueContext::~QueueContext() +{} + +qpid::asyncStore::AsyncOperation::opCode +QueueContext::getOpCode() const +{ + return m_op; +} + +const char* +QueueContext::getOpStr() const +{ + return qpid::asyncStore::AsyncOperation::getOpStr(m_op); +} + +MockPersistableQueue::intrusive_ptr +QueueContext::getQueue() const +{ + return m_q; +} + +void +QueueContext::destroy() +{ + delete this; +} + +}}} // namespace tests::storePerftools::asyncPerf diff --git a/cpp/src/tests/storePerftools/asyncPerf/QueueContext.h b/cpp/src/tests/storePerftools/asyncPerf/QueueContext.h new file mode 100644 index 0000000000..0c69381e31 --- /dev/null +++ b/cpp/src/tests/storePerftools/asyncPerf/QueueContext.h @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * \file QueueContext.h + */ + +#ifndef tests_storePerftools_asyncPerf_QueueContext_h_ +#define tests_storePerftools_asyncPerf_QueueContext_h_ + +#include "MockPersistableQueue.h" + +namespace tests { +namespace storePerftools { +namespace asyncPerf { + +class QueueContext: public qpid::broker::BrokerContext +{ +public: + QueueContext(MockPersistableQueue::intrusive_ptr q, + const qpid::asyncStore::AsyncOperation::opCode op); + virtual ~QueueContext(); + qpid::asyncStore::AsyncOperation::opCode getOpCode() const; + const char* getOpStr() const; + MockPersistableQueue::intrusive_ptr getQueue() const; + void destroy(); +protected: + MockPersistableQueue::intrusive_ptr m_q; + const qpid::asyncStore::AsyncOperation::opCode m_op; +}; + +}}} // namespace tests::storePerftools::asyncPerf + +#endif // tests_storePerftools_asyncPerf_QueueContext_h_ |