From c73f9286ebff93a6c8dbc29cf05e258c4b55c976 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Fri, 4 May 2012 14:16:21 +0000 Subject: QPID-3858: WIP - Updates to async store interface. Removed the errors/exception classes, will use qpid exceptions instead. Some class renaming. git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1333978 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/AsyncStore.cpp | 157 ++++++------------------------------- 1 file changed, 25 insertions(+), 132 deletions(-) (limited to 'cpp/src/qpid/broker/AsyncStore.cpp') diff --git a/cpp/src/qpid/broker/AsyncStore.cpp b/cpp/src/qpid/broker/AsyncStore.cpp index aba75669fd..ff3e77dba5 100644 --- a/cpp/src/qpid/broker/AsyncStore.cpp +++ b/cpp/src/qpid/broker/AsyncStore.cpp @@ -22,137 +22,30 @@ namespace qpid { namespace broker { - AsyncStorePlus::storeConfigDataReturn_t - AsyncStorePlus::storeConfigData(const boost::intrusive_ptr configData, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - boost::intrusive_ptr configTok(nextConfigToken()); - AsyncStoreOp op(AsyncStoreOp::OP_CONFIG_CREATE, configData, configTok, 0, 0, successCb, failCb, cbCtxt); - return AsyncStorePlus::storeConfigDataReturn_t(submit(op), configTok); - } - - int - AsyncStorePlus::destroyConfigData(const boost::intrusive_ptr configTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - AsyncStoreOp op(AsyncStoreOp::OP_CONFIG_DESTROY, 0, configTok, 0, 0, successCb, failCb, cbCtxt); - return submit(op); - } - - AsyncStorePlus::createQueueReturn_t - AsyncStorePlus::createQueue(const std::string& name, - const qpid::types::Variant::Map& options, - const boost::intrusive_ptr queueData, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - boost::intrusive_ptr queueTok(nextQueueToken(name, options)); - AsyncStoreOp op(AsyncStoreOp::OP_CONFIG_CREATE, queueData, queueTok, 0, 0, successCb, failCb, cbCtxt); - return AsyncStorePlus::createQueueReturn_t(submit(op), queueTok); - } - - int - AsyncStorePlus::destroyQueue(const boost::intrusive_ptr queueTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - AsyncStoreOp op(AsyncStoreOp::OP_CONFIG_DESTROY, 0, queueTok, 0, 0, successCb, failCb, cbCtxt); - return submit(op); - } - - AsyncStorePlus::txnReturn_t - AsyncStorePlus::beginTxn(const std::string xid, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - boost::intrusive_ptr txnTok(nextTxnToken(xid)); - AsyncStoreOp op(AsyncStoreOp::OP_TXN_BEGIN, 0, 0, 0, txnTok, successCb, failCb, cbCtxt); - return AsyncStorePlus::txnReturn_t(submit(op), txnTok); - } - - int - AsyncStorePlus::prepareTxn(const boost::intrusive_ptr txnTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - AsyncStoreOp op(AsyncStoreOp::OP_TXN_PREPARE, 0, 0, 0, txnTok, successCb, failCb, cbCtxt); - return submit(op); - } - - int - AsyncStorePlus::commitTxn(const boost::intrusive_ptr txnTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - AsyncStoreOp op(AsyncStoreOp::OP_TXN_COMMIT, 0, 0, 0, txnTok, successCb, failCb, cbCtxt); - return submit(op); - } - - int - AsyncStorePlus::abortTxn(const boost::intrusive_ptr txnTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - AsyncStoreOp op(AsyncStoreOp::OP_TXN_ABORT, 0, 0, 0, txnTok, successCb, failCb, cbCtxt); - return submit(op); - } - - AsyncStorePlus::enqReturn_t - AsyncStorePlus::enqueueMsg(const boost::intrusive_ptr msgData, - const boost::intrusive_ptr queueTok, - const boost::intrusive_ptr txnTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - boost::intrusive_ptr msgTok(nextMessageToken()); - AsyncStoreOp op(AsyncStoreOp::OP_ENQUEUE, msgData, msgTok, queueTok, txnTok, successCb, failCb, cbCtxt); - return AsyncStorePlus::enqReturn_t(submit(op), msgTok); - } - - int - AsyncStorePlus::dequeueMsg(const boost::intrusive_ptr msgTok, - const boost::intrusive_ptr queueTok, - const boost::intrusive_ptr txnTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - AsyncStoreOp op(AsyncStoreOp::OP_DEQUEUE, 0, msgTok, queueTok, txnTok, successCb, failCb, cbCtxt); - return submit(op); - } - - AsyncStorePlus::storeEventReturn_t - AsyncStorePlus::storeQueueEvent(const boost::intrusive_ptr eventData, - const boost::intrusive_ptr queueTok, - const boost::intrusive_ptr txnTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - boost::intrusive_ptr eventTok(nextEventToken()); - AsyncStoreOp op(AsyncStoreOp::OP_EVENT_STORE, eventData, eventTok, queueTok, txnTok, successCb, failCb, cbCtxt); - return AsyncStorePlus::storeEventReturn_t(submit(op), eventTok); - } - - int - AsyncStorePlus::flushQueue(const boost::intrusive_ptr queueTok, - const successCbFn_t successCb, - const failCbFn_t failCb, - const void* cbCtxt) - { - AsyncStoreOp op(AsyncStoreOp::OP_FLUSH, 0, 0, queueTok, 0, successCb, failCb, cbCtxt); - return submit(op); - } +DataSource::~DataSource() +{} + +AsyncStore::AsyncStore() +{} + +AsyncStore::~AsyncStore() +{} + +AsyncResult::AsyncResult() : + errNo(0), + errMsg() +{} + +AsyncResult::AsyncResult(const int errNo, + const std::string& errMsg) : + errNo(errNo), + errMsg(errMsg) +{} + +void +AsyncResult::destroy() +{ + delete this; +} }} // namespace qpid::broker -- cgit v1.2.1