diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2012-05-09 14:19:28 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2012-05-09 14:19:28 +0000 |
| commit | 2e3690efe94e6161d129ebce2f8c22cb25819ec1 (patch) | |
| tree | 8fc2b2aa701127d7ee827319b809aeaf543f2a59 /cpp/src/qpid/broker | |
| parent | 633c33f224f3196f3f9bd80bd2e418d8143fea06 (diff) | |
| download | qpid-python-2e3690efe94e6161d129ebce2f8c22cb25819ec1.tar.gz | |
QPID-3858: Initial checkin of async interface implementation and test harness.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1336220 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
| -rw-r--r-- | cpp/src/qpid/broker/ConfigHandle.cpp | 57 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/ConfigHandle.h | 54 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/EnqueueHandle.cpp | 57 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/EnqueueHandle.h | 54 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/EventHandle.cpp | 65 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/EventHandle.h | 54 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/IdHandle.cpp | 35 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/IdHandle.h | 38 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/MessageHandle.cpp | 57 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/MessageHandle.h | 54 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/QueueHandle.cpp | 64 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/QueueHandle.h | 54 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/TxnHandle.cpp | 71 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/TxnHandle.h | 55 |
14 files changed, 769 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/ConfigHandle.cpp b/cpp/src/qpid/broker/ConfigHandle.cpp new file mode 100644 index 0000000000..8d7a2f1e7d --- /dev/null +++ b/cpp/src/qpid/broker/ConfigHandle.cpp @@ -0,0 +1,57 @@ +/* + * 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 ConfigHandle.cpp + */ + +#include "ConfigHandle.h" + +#include "qpid/messaging/PrivateImplRef.h" + +namespace qpid { +namespace broker { + +typedef qpid::messaging::PrivateImplRef<ConfigHandle> PrivateImpl; + +ConfigHandle::ConfigHandle(qpid::asyncStore::ConfigHandleImpl* p) : + IdHandle() +{ + PrivateImpl::ctor(*this, p); +} + +ConfigHandle::ConfigHandle(const ConfigHandle& r) : + qpid::messaging::Handle<qpid::asyncStore::ConfigHandleImpl>(), + IdHandle() +{ + PrivateImpl::copy(*this, r); +} + +ConfigHandle::~ConfigHandle() +{ + PrivateImpl::dtor(*this); +} + +ConfigHandle& +ConfigHandle::operator=(const ConfigHandle& r) +{ + return PrivateImpl::assign(*this, r); +} + +}} // namespace qpid::broker diff --git a/cpp/src/qpid/broker/ConfigHandle.h b/cpp/src/qpid/broker/ConfigHandle.h new file mode 100644 index 0000000000..e2cdca6f15 --- /dev/null +++ b/cpp/src/qpid/broker/ConfigHandle.h @@ -0,0 +1,54 @@ +/* + * 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 ConfigHandle.h + */ + +#ifndef qpid_broker_ConfigHandleImpl_h_ +#define qpid_broker_ConfigHandleImpl_h_ + +#include "IdHandle.h" + +#include "qpid/asyncStore/ConfigHandleImpl.h" +#include "qpid/messaging/Handle.h" + +namespace qpid { +namespace broker { + +class ConfigHandle : public qpid::messaging::Handle<qpid::asyncStore::ConfigHandleImpl>, public IdHandle +{ +public: + ConfigHandle(qpid::asyncStore::ConfigHandleImpl* p = 0); + ConfigHandle(const ConfigHandle& r); + ~ConfigHandle(); + ConfigHandle& operator=(const ConfigHandle& r); + + // ConfigHandleImpl methods + // <none> + +private: + typedef qpid::asyncStore::ConfigHandleImpl Impl; + Impl* impl; + friend class qpid::messaging::PrivateImplRef<ConfigHandle>; +}; + +}} // namespace qpid::broker + +#endif // qpid_broker_ConfigHandleImpl_h_ diff --git a/cpp/src/qpid/broker/EnqueueHandle.cpp b/cpp/src/qpid/broker/EnqueueHandle.cpp new file mode 100644 index 0000000000..10d53c51e0 --- /dev/null +++ b/cpp/src/qpid/broker/EnqueueHandle.cpp @@ -0,0 +1,57 @@ +/* + * 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 EnqueueHandle.cpp + */ + +#include "EnqueueHandle.h" + +#include "qpid/messaging/PrivateImplRef.h" + +namespace qpid { +namespace broker { + +typedef qpid::messaging::PrivateImplRef<EnqueueHandle> PrivateImpl; + +EnqueueHandle::EnqueueHandle(qpid::asyncStore::EnqueueHandleImpl* p) : + IdHandle() +{ + PrivateImpl::ctor(*this, p); +} + +EnqueueHandle::EnqueueHandle(const EnqueueHandle& r) : + qpid::messaging::Handle<qpid::asyncStore::EnqueueHandleImpl>(), + IdHandle() +{ + PrivateImpl::copy(*this, r); +} + +EnqueueHandle::~EnqueueHandle() +{ + PrivateImpl::dtor(*this); +} + +EnqueueHandle& +EnqueueHandle::operator=(const EnqueueHandle& r) +{ + return PrivateImpl::assign(*this, r); +} + +}} // namespace qpid::broker diff --git a/cpp/src/qpid/broker/EnqueueHandle.h b/cpp/src/qpid/broker/EnqueueHandle.h new file mode 100644 index 0000000000..3ab6885497 --- /dev/null +++ b/cpp/src/qpid/broker/EnqueueHandle.h @@ -0,0 +1,54 @@ +/* + * 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 EnqueueHandle.h + */ + +#ifndef qpid_broker_EnqueueHandleImpl_h_ +#define qpid_broker_EnqueueHandleImpl_h_ + +#include "IdHandle.h" + +#include "qpid/asyncStore/EnqueueHandleImpl.h" +#include "qpid/messaging/Handle.h" + +namespace qpid { +namespace broker { + +class EnqueueHandle : public qpid::messaging::Handle<qpid::asyncStore::EnqueueHandleImpl>, public IdHandle +{ +public: + EnqueueHandle(qpid::asyncStore::EnqueueHandleImpl* p = 0); + EnqueueHandle(const EnqueueHandle& r); + ~EnqueueHandle(); + EnqueueHandle& operator=(const EnqueueHandle& r); + + // EnqueueHandleImpl methods + // <none> + +private: + typedef qpid::asyncStore::EnqueueHandleImpl Impl; + Impl* impl; + friend class qpid::messaging::PrivateImplRef<EnqueueHandle>; +}; + +}} // namespace qpid::broker + +#endif // qpid_broker_EnqueueHandleImpl_h_ diff --git a/cpp/src/qpid/broker/EventHandle.cpp b/cpp/src/qpid/broker/EventHandle.cpp new file mode 100644 index 0000000000..09f0ef0b28 --- /dev/null +++ b/cpp/src/qpid/broker/EventHandle.cpp @@ -0,0 +1,65 @@ +/* + * 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 EventHandle.cpp + */ + +#include "EventHandle.h" + +#include "qpid/messaging/PrivateImplRef.h" + +namespace qpid { +namespace broker { + +typedef qpid::messaging::PrivateImplRef<EventHandle> PrivateImpl; + +EventHandle::EventHandle(qpid::asyncStore::EventHandleImpl* p) : + IdHandle() +{ + PrivateImpl::ctor(*this, p); +} + +EventHandle::EventHandle(const EventHandle& r) : + qpid::messaging::Handle<qpid::asyncStore::EventHandleImpl>(), + IdHandle() +{ + PrivateImpl::copy(*this, r); +} + +EventHandle::~EventHandle() +{ + PrivateImpl::dtor(*this); +} + +EventHandle& +EventHandle::operator=(const EventHandle& r) +{ + return PrivateImpl::assign(*this, r); +} + +// --- EventHandleImpl methods --- + +const std::string& +EventHandle::getKey() const +{ + return impl->getKey(); +} + +}} // namespace qpid::broker diff --git a/cpp/src/qpid/broker/EventHandle.h b/cpp/src/qpid/broker/EventHandle.h new file mode 100644 index 0000000000..355cb3a091 --- /dev/null +++ b/cpp/src/qpid/broker/EventHandle.h @@ -0,0 +1,54 @@ +/* + * 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 EventHandle.h + */ + +#ifndef qpid_broker_EventHandleImpl_h_ +#define qpid_broker_EventHandleImpl_h_ + +#include "IdHandle.h" + +#include "qpid/asyncStore/EventHandleImpl.h" +#include "qpid/messaging/Handle.h" + +namespace qpid { +namespace broker { + +class EventHandle : public qpid::messaging::Handle<qpid::asyncStore::EventHandleImpl>, public IdHandle +{ +public: + EventHandle(qpid::asyncStore::EventHandleImpl* p = 0); + EventHandle(const EventHandle& r); + ~EventHandle(); + EventHandle& operator=(const EventHandle& r); + + // EventHandleImpl methods + const std::string& getKey() const; + +private: + typedef qpid::asyncStore::EventHandleImpl Impl; + Impl* impl; + friend class qpid::messaging::PrivateImplRef<EventHandle>; +}; + +}} // namespace qpid::broker + +#endif // qpid_broker_EventHandleImpl_h_ diff --git a/cpp/src/qpid/broker/IdHandle.cpp b/cpp/src/qpid/broker/IdHandle.cpp new file mode 100644 index 0000000000..07bd49293d --- /dev/null +++ b/cpp/src/qpid/broker/IdHandle.cpp @@ -0,0 +1,35 @@ +/* + * 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 IdHandle.cpp + */ + +#include "IdHandle.h" + +namespace qpid { +namespace broker { + +IdHandle::IdHandle() +{} + +IdHandle::~IdHandle() +{} + +}} // namespace qpid::broker diff --git a/cpp/src/qpid/broker/IdHandle.h b/cpp/src/qpid/broker/IdHandle.h new file mode 100644 index 0000000000..e28d9472be --- /dev/null +++ b/cpp/src/qpid/broker/IdHandle.h @@ -0,0 +1,38 @@ +/* + * 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 IdHandle.h + */ + +#ifndef qpid_broker_IdHandle_h_ +#define qpid_broker_IdHandle_h_ + +namespace qpid { +namespace broker { + +class IdHandle { +public: + IdHandle(); + virtual ~IdHandle(); +}; + +}} // namespace qpid::broker + +#endif // qpid_broker_IdHandle_h_ diff --git a/cpp/src/qpid/broker/MessageHandle.cpp b/cpp/src/qpid/broker/MessageHandle.cpp new file mode 100644 index 0000000000..9a7b631e8b --- /dev/null +++ b/cpp/src/qpid/broker/MessageHandle.cpp @@ -0,0 +1,57 @@ +/* + * 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 MessageHandle.cpp + */ + +#include "MessageHandle.h" + +#include "qpid/messaging/PrivateImplRef.h" + +namespace qpid { +namespace broker { + +typedef qpid::messaging::PrivateImplRef<MessageHandle> PrivateImpl; + +MessageHandle::MessageHandle(qpid::asyncStore::MessageHandleImpl* p) : + IdHandle() +{ + PrivateImpl::ctor(*this, p); +} + +MessageHandle::MessageHandle(const MessageHandle& r) : + qpid::messaging::Handle<qpid::asyncStore::MessageHandleImpl>(), + IdHandle() +{ + PrivateImpl::copy(*this, r); +} + +MessageHandle::~MessageHandle() +{ + PrivateImpl::dtor(*this); +} + +MessageHandle& +MessageHandle::operator=(const MessageHandle& r) +{ + return PrivateImpl::assign(*this, r); +} + +}} // namespace qpid::broker diff --git a/cpp/src/qpid/broker/MessageHandle.h b/cpp/src/qpid/broker/MessageHandle.h new file mode 100644 index 0000000000..74c38d92cc --- /dev/null +++ b/cpp/src/qpid/broker/MessageHandle.h @@ -0,0 +1,54 @@ +/* + * 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 MessageHandle.h + */ + +#ifndef qpid_broker_MessageHandleImpl_h_ +#define qpid_broker_MessageHandleImpl_h_ + +#include "IdHandle.h" + +#include "qpid/asyncStore/MessageHandleImpl.h" +#include "qpid/messaging/Handle.h" + +namespace qpid { +namespace broker { + +class MessageHandle : public qpid::messaging::Handle<qpid::asyncStore::MessageHandleImpl>, public IdHandle +{ +public: + MessageHandle(qpid::asyncStore::MessageHandleImpl* p = 0); + MessageHandle(const MessageHandle& r); + ~MessageHandle(); + MessageHandle& operator=(const MessageHandle& r); + + // MessageHandleImpl methods + // <none> + +private: + typedef qpid::asyncStore::MessageHandleImpl Impl; + Impl* impl; + friend class qpid::messaging::PrivateImplRef<MessageHandle>; +}; + +}} // namespace qpid::broker + +#endif // qpid_broker_MessageHandleImpl_h_ diff --git a/cpp/src/qpid/broker/QueueHandle.cpp b/cpp/src/qpid/broker/QueueHandle.cpp new file mode 100644 index 0000000000..780eb6395c --- /dev/null +++ b/cpp/src/qpid/broker/QueueHandle.cpp @@ -0,0 +1,64 @@ +/* + * 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 QueueHandle.cpp + */ + +#include "QueueHandle.h" + +#include "qpid/messaging/PrivateImplRef.h" + +namespace qpid { +namespace broker { + +typedef qpid::messaging::PrivateImplRef<QueueHandle> PrivateImpl; + +QueueHandle::QueueHandle(qpid::asyncStore::QueueHandleImpl* p) : + IdHandle() +{ + PrivateImpl::ctor(*this, p); +} + +QueueHandle::QueueHandle(const QueueHandle& r) : + qpid::messaging::Handle<qpid::asyncStore::QueueHandleImpl>(), + IdHandle() +{ + PrivateImpl::copy(*this, r); +} + +QueueHandle::~QueueHandle() +{ + PrivateImpl::dtor(*this); +} + +QueueHandle& +QueueHandle::operator=(const QueueHandle& r) +{ + return PrivateImpl::assign(*this, r); +} + +// --- QueueHandleImpl methods --- +const std::string& +QueueHandle::getName() const +{ + return impl->getName(); +} + +}} // namespace qpid::broker diff --git a/cpp/src/qpid/broker/QueueHandle.h b/cpp/src/qpid/broker/QueueHandle.h new file mode 100644 index 0000000000..a8caa03f97 --- /dev/null +++ b/cpp/src/qpid/broker/QueueHandle.h @@ -0,0 +1,54 @@ +/* + * 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 QueueHandle.h + */ + +#ifndef qpid_broker_QueueHandleImpl_h_ +#define qpid_broker_QueueHandleImpl_h_ + +#include "IdHandle.h" + +#include "qpid/asyncStore/QueueHandleImpl.h" +#include "qpid/messaging/Handle.h" + +namespace qpid { +namespace broker { + +class QueueHandle : public qpid::messaging::Handle<qpid::asyncStore::QueueHandleImpl>, public IdHandle +{ +public: + QueueHandle(qpid::asyncStore::QueueHandleImpl* p = 0); + QueueHandle(const QueueHandle& r); + ~QueueHandle(); + QueueHandle& operator=(const QueueHandle& r); + + // QueueHandleImpl methods + const std::string& getName() const; + +private: + typedef qpid::asyncStore::QueueHandleImpl Impl; + Impl* impl; + friend class qpid::messaging::PrivateImplRef<QueueHandle>; +}; + +}} // namespace qpid::broker + +#endif // qpid_broker_QueueHandleImpl_h_ diff --git a/cpp/src/qpid/broker/TxnHandle.cpp b/cpp/src/qpid/broker/TxnHandle.cpp new file mode 100644 index 0000000000..4ba41c4cbd --- /dev/null +++ b/cpp/src/qpid/broker/TxnHandle.cpp @@ -0,0 +1,71 @@ +/* + * 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 TxnHandle.cpp + */ + +#include "TxnHandle.h" + +#include "qpid/messaging/PrivateImplRef.h" + +namespace qpid { +namespace broker { + +typedef qpid::messaging::PrivateImplRef<TxnHandle> PrivateImpl; + +TxnHandle::TxnHandle(qpid::asyncStore::TxnHandleImpl* p) : + IdHandle() +{ + PrivateImpl::ctor(*this, p); +} + +TxnHandle::TxnHandle(const TxnHandle& r) : + qpid::messaging::Handle<qpid::asyncStore::TxnHandleImpl>(), + IdHandle() +{ + PrivateImpl::copy(*this, r); +} + +TxnHandle::~TxnHandle() +{ + PrivateImpl::dtor(*this); +} + +TxnHandle& +TxnHandle::operator=(const TxnHandle& r) +{ + return PrivateImpl::assign(*this, r); +} + +// --- TxnHandleImpl methods --- + +const std::string& +TxnHandle::getXid() const +{ + return impl->getXid(); +} + +bool +TxnHandle::is2pc() const +{ + return impl->is2pc(); +} + +}} // namespace qpid::broker diff --git a/cpp/src/qpid/broker/TxnHandle.h b/cpp/src/qpid/broker/TxnHandle.h new file mode 100644 index 0000000000..814b4ea0b3 --- /dev/null +++ b/cpp/src/qpid/broker/TxnHandle.h @@ -0,0 +1,55 @@ +/* + * 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 TxnHandle.h + */ + +#ifndef qpid_broker_TxnHandleImpl_h_ +#define qpid_broker_TxnHandleImpl_h_ + +#include "IdHandle.h" + +#include "qpid/asyncStore/TxnHandleImpl.h" +#include "qpid/messaging/Handle.h" + +namespace qpid { +namespace broker { + +class TxnHandle : public qpid::messaging::Handle<qpid::asyncStore::TxnHandleImpl>, public IdHandle +{ +public: + TxnHandle(qpid::asyncStore::TxnHandleImpl* p = 0); + TxnHandle(const TxnHandle& r); + ~TxnHandle(); + TxnHandle& operator=(const TxnHandle& r); + + // TxnHandleImpl methods + const std::string& getXid() const; + bool is2pc() const; + +private: + typedef qpid::asyncStore::TxnHandleImpl Impl; + Impl* impl; + friend class qpid::messaging::PrivateImplRef<TxnHandle>; +}; + +}} // namespace qpid::broker + +#endif // qpid_broker_TxnHandleImpl_h_ |
