diff options
Diffstat (limited to 'cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h')
-rw-r--r-- | cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h b/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h new file mode 100644 index 0000000000..6e97e99349 --- /dev/null +++ b/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h @@ -0,0 +1,75 @@ +/* + * 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 TxnPublish.h + */ + +#ifndef tests_storePerftools_asyncPerf_TxnPublish_h_ +#define tests_storePerftools_asyncPerf_TxnPublish_h_ + +#include "Deliverable.h" + +#include "qpid/broker/TxnOp.h" + +#include <boost/intrusive_ptr.hpp> +#include <boost/shared_ptr.hpp> +#include <list> + +namespace qpid { +namespace broker { + +class TransactionContext; + +}} + +namespace tests { +namespace storePerftools { +namespace asyncPerf { + +class QueuedMessage; +class SimplePersistableMessage; +class SimplePersistableQueue; + +class TxnPublish : public qpid::broker::TxnOp, + public Deliverable +{ +public: + TxnPublish(boost::intrusive_ptr<SimplePersistableMessage> msg); + virtual ~TxnPublish(); + + // --- Interface TxOp --- + bool prepare(qpid::broker::TxnHandle& th) throw(); + void commit() throw(); + void rollback() throw(); + + // --- Interface Deliverable --- + uint64_t contentSize(); + void deliverTo(const boost::shared_ptr<SimplePersistableQueue>& queue); + SimplePersistableMessage& getMessage(); + +private: + boost::intrusive_ptr<SimplePersistableMessage> m_msg; + std::list<boost::shared_ptr<QueuedMessage> > m_queues; + std::list<boost::shared_ptr<QueuedMessage> > m_prepared; +}; + +}}} // namespace tests::storePerftools::asyncPerf + +#endif // tests_storePerftools_asyncPerf_TxnPublish_h_ |