summaryrefslogtreecommitdiff
path: root/include/comphelper
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-17 13:43:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-17 16:24:05 +0000
commit3744d8506ef231d642785faf6da4926cea64c6a0 (patch)
tree2d57ca5be9eda54aafb5065d7010bb50a37053ac /include/comphelper
parent7a17c038a6f4c433a69c6c1ed04aca2e5c929027 (diff)
boost->std
Change-Id: I8371b942d915f777a29ca01cd0aed674db0ca853
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/unique_disposing_ptr.hxx (renamed from include/comphelper/scoped_disposing_ptr.hxx)28
1 files changed, 15 insertions, 13 deletions
diff --git a/include/comphelper/scoped_disposing_ptr.hxx b/include/comphelper/unique_disposing_ptr.hxx
index 2625f40510b9..1848639698c2 100644
--- a/include/comphelper/scoped_disposing_ptr.hxx
+++ b/include/comphelper/unique_disposing_ptr.hxx
@@ -7,11 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_COMPHELPER_SCOPED_DISPOSING_PTR_HXX
-#define INCLUDED_COMPHELPER_SCOPED_DISPOSING_PTR_HXX
+#ifndef INCLUDED_COMPHELPER_UNIQUE_DISPOSING_PTR_HXX
+#define INCLUDED_COMPHELPER_UNIQUE_DISPOSING_PTR_HXX
#include <cppuhelper/implbase1.hxx>
-#include <boost/utility.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
@@ -22,13 +21,16 @@
namespace comphelper
{
//Similar to std::unique_ptr, except additionally releases the ptr on XComponent::disposing and/or XTerminateListener::notifyTermination if supported
-template<class T> class scoped_disposing_ptr : private boost::noncopyable
+template<class T> class unique_disposing_ptr
{
private:
std::unique_ptr<T> m_xItem;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XTerminateListener> m_xTerminateListener;
+
+ unique_disposing_ptr(const unique_disposing_ptr&) SAL_DELETED_FUNCTION;
+ unique_disposing_ptr& operator=(const unique_disposing_ptr&) SAL_DELETED_FUNCTION;
public:
- scoped_disposing_ptr( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &rComponent, T * p = 0 )
+ unique_disposing_ptr( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &rComponent, T * p = 0 )
: m_xItem(p)
{
m_xTerminateListener = new TerminateListener(rComponent, *this);
@@ -59,7 +61,7 @@ public:
return static_cast< bool >(m_xItem);
}
- virtual ~scoped_disposing_ptr()
+ virtual ~unique_disposing_ptr()
{
reset();
}
@@ -68,10 +70,10 @@ private:
{
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xComponent;
- scoped_disposing_ptr<T>& m_rItem;
+ unique_disposing_ptr<T>& m_rItem;
public:
TerminateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &rComponent,
- scoped_disposing_ptr<T>& rItem) : m_xComponent(rComponent), m_rItem(rItem)
+ unique_disposing_ptr<T>& rItem) : m_xComponent(rComponent), m_rItem(rItem)
{
if (m_xComponent.is())
{
@@ -135,19 +137,19 @@ private:
//for threadsafety. The user can ensure this, except in the case of its dtor
//being called from reset due to a terminate on the XComponent being called
//from an aribitrary thread
-template<class T> class scoped_disposing_solar_mutex_reset_ptr
- : public scoped_disposing_ptr<T>
+template<class T> class unique_disposing_solar_mutex_reset_ptr
+ : public unique_disposing_ptr<T>
{
public:
- scoped_disposing_solar_mutex_reset_ptr( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &rComponent, T * p = 0 )
- : scoped_disposing_ptr<T>(rComponent, p)
+ unique_disposing_solar_mutex_reset_ptr( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &rComponent, T * p = 0 )
+ : unique_disposing_ptr<T>(rComponent, p)
{
}
virtual void reset(T * p = 0)
{
SolarMutexGuard aGuard;
- scoped_disposing_ptr<T>::reset(p);
+ unique_disposing_ptr<T>::reset(p);
}
};