summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-14 09:21:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-14 12:54:25 +0000
commit22b80ac8e213ff63ce4f60e7d491f12cb42db313 (patch)
treeb00f1ed362747a05d79686a8709c3408cfdee59b /cppuhelper
parentd8026ad65c8d50868f0f2fc0d2bd95820cddea83 (diff)
boost->std
Change-Id: I3fd9e1599c5ad812879a58cf1dabbcd393105e1c Reviewed-on: https://gerrit.libreoffice.org/18564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/inc/pch/precompiled_cppuhelper.hxx2
-rw-r--r--cppuhelper/source/servicemanager.cxx52
-rw-r--r--cppuhelper/source/servicemanager.hxx14
3 files changed, 32 insertions, 36 deletions
diff --git a/cppuhelper/inc/pch/precompiled_cppuhelper.hxx b/cppuhelper/inc/pch/precompiled_cppuhelper.hxx
index 0eae67893273..d54a695f1f14 100644
--- a/cppuhelper/inc/pch/precompiled_cppuhelper.hxx
+++ b/cppuhelper/inc/pch/precompiled_cppuhelper.hxx
@@ -17,8 +17,6 @@
#include <algorithm>
#include <boost/noncopyable.hpp>
#include <memory>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
#include <cassert>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/Property.hpp>
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 2140a2f74f07..c58caf891da2 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -14,8 +14,6 @@
#include <vector>
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/container/ElementExistException.hpp>
@@ -67,7 +65,7 @@ void insertImplementationMap(
i != source.end(); ++i)
{
std::vector<
- boost::shared_ptr<
+ std::shared_ptr<
cppuhelper::ServiceManager::Data::Implementation > > & impls
= (*destination)[i->first];
impls.insert(impls.end(), i->second.begin(), i->second.end());
@@ -77,7 +75,7 @@ void insertImplementationMap(
void removeFromImplementationMap(
cppuhelper::ServiceManager::Data::ImplementationMap * map,
std::vector< rtl::OUString > const & elements,
- boost::shared_ptr< cppuhelper::ServiceManager::Data::Implementation >
+ std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation >
const & implementation)
{
// The underlying data structures make this function somewhat inefficient,
@@ -90,7 +88,7 @@ void removeFromImplementationMap(
map->find(*i));
assert(j != map->end());
std::vector<
- boost::shared_ptr<
+ std::shared_ptr<
cppuhelper::ServiceManager::Data::Implementation > >::iterator
k(std::find(j->second.begin(), j->second.end(), implementation));
assert(k != j->second.end());
@@ -129,7 +127,7 @@ private:
rtl::OUString attrUri_;
rtl::OUString attrEnvironment_;
rtl::OUString attrPrefix_;
- boost::shared_ptr< cppuhelper::ServiceManager::Data::Implementation >
+ std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation >
implementation_;
};
@@ -495,7 +493,7 @@ class SingletonFactory:
public:
SingletonFactory(
rtl::Reference< cppuhelper::ServiceManager > const & manager,
- boost::shared_ptr<
+ std::shared_ptr<
cppuhelper::ServiceManager::Data::Implementation > const &
implementation):
manager_(manager), implementation_(implementation)
@@ -516,7 +514,7 @@ private:
throw (css::uno::Exception, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
rtl::Reference< cppuhelper::ServiceManager > manager_;
- boost::shared_ptr< cppuhelper::ServiceManager::Data::Implementation >
+ std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation >
implementation_;
};
@@ -549,7 +547,7 @@ class ImplementationWrapper:
public:
ImplementationWrapper(
rtl::Reference< cppuhelper::ServiceManager > const & manager,
- boost::shared_ptr<
+ std::shared_ptr<
cppuhelper::ServiceManager::Data::Implementation > const &
implementation):
manager_(manager), implementation_(implementation)
@@ -587,7 +585,7 @@ private:
getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
rtl::Reference< cppuhelper::ServiceManager > manager_;
- boost::weak_ptr< cppuhelper::ServiceManager::Data::Implementation >
+ std::weak_ptr< cppuhelper::ServiceManager::Data::Implementation >
implementation_;
};
@@ -596,7 +594,7 @@ ImplementationWrapper::createInstanceWithContext(
css::uno::Reference< css::uno::XComponentContext > const & Context)
throw (css::uno::Exception, css::uno::RuntimeException, std::exception)
{
- boost::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = implementation_.lock();
+ std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = implementation_.lock();
assert(impl);
manager_->loadImplementation(Context, impl);
return impl->createInstance(Context, false);
@@ -608,7 +606,7 @@ ImplementationWrapper::createInstanceWithArgumentsAndContext(
css::uno::Reference< css::uno::XComponentContext > const & Context)
throw (css::uno::Exception, css::uno::RuntimeException, std::exception)
{
- boost::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = implementation_.lock();
+ std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = implementation_.lock();
assert(impl);
manager_->loadImplementation(Context, impl);
return impl->createInstanceWithArguments(
@@ -634,7 +632,7 @@ ImplementationWrapper::createInstanceWithArguments(
rtl::OUString ImplementationWrapper::getImplementationName()
throw (css::uno::RuntimeException, std::exception)
{
- boost::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = implementation_.lock();
+ std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = implementation_.lock();
assert(impl);
return impl->info->name;
}
@@ -649,7 +647,7 @@ css::uno::Sequence< rtl::OUString >
ImplementationWrapper::getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception)
{
- boost::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = implementation_.lock();
+ std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = implementation_.lock();
assert(impl);
if (impl->info->services.size()
> static_cast< sal_uInt32 >(SAL_MAX_INT32))
@@ -773,7 +771,7 @@ void cppuhelper::ServiceManager::addSingletonContextEntries(
void cppuhelper::ServiceManager::loadImplementation(
css::uno::Reference< css::uno::XComponentContext > const & context,
- boost::shared_ptr< Data::Implementation > & implementation)
+ std::shared_ptr< Data::Implementation > & implementation)
{
assert(implementation.get() != 0);
{
@@ -1014,7 +1012,7 @@ cppuhelper::ServiceManager::createInstanceWithContext(
css::uno::Reference< css::uno::XComponentContext > const & Context)
throw (css::uno::Exception, css::uno::RuntimeException, std::exception)
{
- boost::shared_ptr< Data::Implementation > impl(
+ std::shared_ptr< Data::Implementation > impl(
findServiceImplementation(Context, aServiceSpecifier));
return impl.get() == 0
? css::uno::Reference< css::uno::XInterface >()
@@ -1028,7 +1026,7 @@ cppuhelper::ServiceManager::createInstanceWithArgumentsAndContext(
css::uno::Reference< css::uno::XComponentContext > const & Context)
throw (css::uno::Exception, css::uno::RuntimeException, std::exception)
{
- boost::shared_ptr< Data::Implementation > impl(
+ std::shared_ptr< Data::Implementation > impl(
findServiceImplementation(Context, ServiceSpecifier));
return impl.get() == 0
? css::uno::Reference< css::uno::XInterface >()
@@ -1183,7 +1181,7 @@ cppuhelper::ServiceManager::createContentEnumeration(
rtl::OUString const & aServiceName)
throw (css::uno::RuntimeException, std::exception)
{
- std::vector< boost::shared_ptr< Data::Implementation > > impls;
+ std::vector< std::shared_ptr< Data::Implementation > > impls;
{
osl::MutexGuard g(rBHelper.rMutex);
Data::ImplementationMap::const_iterator i(
@@ -1194,7 +1192,7 @@ cppuhelper::ServiceManager::createContentEnumeration(
}
std::vector< css::uno::Any > factories;
for (std::vector<
- boost::shared_ptr< Data::Implementation > >::const_iterator i(
+ std::shared_ptr< Data::Implementation > >::const_iterator i(
impls.begin());
i != impls.end(); ++i)
{
@@ -1496,7 +1494,7 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(rtl::OUString const & uri) {
assert(implKey.getName().match("/IMPLEMENTATIONS/"));
rtl::OUString name(
implKey.getName().copy(RTL_CONSTASCII_LENGTH("/IMPLEMENTATIONS/")));
- boost::shared_ptr< Data::Implementation > impl(
+ std::shared_ptr< Data::Implementation > impl(
new Data::Implementation(
name, readLegacyRdbString(uri, implKey, "UNO/ACTIVATOR"),
readLegacyRdbString(uri, implKey, "UNO/LOCATION"), "", "", "",
@@ -1633,7 +1631,7 @@ void cppuhelper::ServiceManager::insertLegacyFactory(
}
css::uno::Reference< css::lang::XComponent > comp(
factoryInfo, css::uno::UNO_QUERY);
- boost::shared_ptr< Data::Implementation > impl(
+ std::shared_ptr< Data::Implementation > impl(
new Data::Implementation(name, f1, f2, comp));
Data extra;
if (!name.isEmpty()) {
@@ -1739,7 +1737,7 @@ void cppuhelper::ServiceManager::removeRdbFiles(
// The underlying data structures make this function somewhat inefficient,
// but the assumption is that it is rarely called (and that if it is called,
// it is called with a uris vector of size one):
- std::vector< boost::shared_ptr< Data::Implementation > > clear;
+ std::vector< std::shared_ptr< Data::Implementation > > clear;
{
osl::MutexGuard g(rBHelper.rMutex);
for (std::vector< rtl::OUString >::const_iterator i(uris.begin());
@@ -1774,7 +1772,7 @@ bool cppuhelper::ServiceManager::removeLegacyFactory(
bool removeListener)
{
assert(factoryInfo.is());
- boost::shared_ptr< Data::Implementation > clear;
+ std::shared_ptr< Data::Implementation > clear;
css::uno::Reference< css::lang::XComponent > comp;
{
osl::MutexGuard g(rBHelper.rMutex);
@@ -1807,7 +1805,7 @@ bool cppuhelper::ServiceManager::removeLegacyFactory(
void cppuhelper::ServiceManager::removeImplementation(const rtl::OUString & name) {
// The underlying data structures make this function somewhat inefficient,
// but the assumption is that it is rarely called:
- boost::shared_ptr< Data::Implementation > clear;
+ std::shared_ptr< Data::Implementation > clear;
{
osl::MutexGuard g(rBHelper.rMutex);
if (isDisposed()) {
@@ -1840,12 +1838,12 @@ void cppuhelper::ServiceManager::removeImplementation(const rtl::OUString & name
}
}
-boost::shared_ptr< cppuhelper::ServiceManager::Data::Implementation >
+std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation >
cppuhelper::ServiceManager::findServiceImplementation(
css::uno::Reference< css::uno::XComponentContext > const & context,
rtl::OUString const & specifier)
{
- boost::shared_ptr< Data::Implementation > impl;
+ std::shared_ptr< Data::Implementation > impl;
bool loaded;
{
osl::MutexGuard g(rBHelper.rMutex);
@@ -1856,7 +1854,7 @@ cppuhelper::ServiceManager::findServiceImplementation(
data_.namedImplementations.find(specifier));
if (j == data_.namedImplementations.end()) {
SAL_INFO("cppuhelper", "No implementation for " << specifier);
- return boost::shared_ptr< Data::Implementation >();
+ return std::shared_ptr< Data::Implementation >();
}
impl = j->second;
} else {
diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx
index 903084b11eef..03ed72abe2c8 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -14,10 +14,10 @@
#include <cassert>
#include <map>
+#include <memory>
#include <vector>
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
@@ -138,7 +138,7 @@ public:
enum Status { STATUS_NEW, STATUS_WRAPPER, STATUS_LOADED };
- boost::shared_ptr< ImplementationInfo > info;
+ std::shared_ptr< ImplementationInfo > info;
ImplementationConstructorFn * constructor;
css::uno::Reference< css::lang::XSingleComponentFactory > factory1;
css::uno::Reference< css::lang::XSingleServiceFactory > factory2;
@@ -155,19 +155,19 @@ public:
css::uno::Reference<css::uno::XInterface> const & instance);
};
- typedef std::map< rtl::OUString, boost::shared_ptr< Implementation > >
+ typedef std::map< rtl::OUString, std::shared_ptr< Implementation > >
NamedImplementations;
typedef
std::map<
css::uno::Reference< css::lang::XServiceInfo >,
- boost::shared_ptr< Implementation > >
+ std::shared_ptr< Implementation > >
DynamicImplementations;
typedef
std::map<
rtl::OUString,
- std::vector< boost::shared_ptr< Implementation > > >
+ std::vector< std::shared_ptr< Implementation > > >
ImplementationMap;
NamedImplementations namedImplementations;
@@ -201,7 +201,7 @@ public:
void loadImplementation(
css::uno::Reference< css::uno::XComponentContext > const & context,
- boost::shared_ptr< Data::Implementation > & implementation);
+ std::shared_ptr< Data::Implementation > & implementation);
private:
virtual ~ServiceManager() {}
@@ -371,7 +371,7 @@ private:
void removeImplementation(const rtl::OUString & name);
- boost::shared_ptr< Data::Implementation > findServiceImplementation(
+ std::shared_ptr< Data::Implementation > findServiceImplementation(
css::uno::Reference< css::uno::XComponentContext > const & context,
rtl::OUString const & specifier);