summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-12-29 14:07:58 +0100
committerJose <jose@zeroc.com>2015-12-29 14:07:58 +0100
commit2715a0e3b479b84fc24efa93882df47c2b373d73 (patch)
treea5971eb833bdb5a13def11910a47e56302213d2c /cpp
parent.gitignore update (diff)
downloadice-2715a0e3b479b84fc24efa93882df47c2b373d73.tar.bz2
ice-2715a0e3b479b84fc24efa93882df47c2b373d73.tar.xz
ice-2715a0e3b479b84fc24efa93882df47c2b373d73.zip
C++11 mapping fixes for IceBox
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/IceUtil/Config.h2
-rw-r--r--cpp/src/IceBox/Admin.cpp4
-rw-r--r--cpp/src/IceBox/Service.cpp2
-rw-r--r--cpp/src/IceBox/ServiceManagerI.cpp109
-rw-r--r--cpp/src/IceBox/ServiceManagerI.h30
-rw-r--r--cpp/src/Makefile3
-rw-r--r--cpp/src/Makefile.mak3
-rw-r--r--cpp/test/IceBox/admin/AllTests.cpp24
-rw-r--r--cpp/test/IceBox/admin/Client.cpp2
-rw-r--r--cpp/test/IceBox/admin/Service.cpp4
-rw-r--r--cpp/test/IceBox/admin/TestI.h2
-rw-r--r--cpp/test/IceBox/configuration/AllTests.cpp8
-rw-r--r--cpp/test/IceBox/configuration/Client.cpp2
-rw-r--r--cpp/test/IceBox/configuration/Service.cpp2
-rw-r--r--cpp/test/IceBox/configuration/TestI.cpp2
-rw-r--r--cpp/test/IceBox/configuration/TestI.h2
-rw-r--r--cpp/test/include/TestCommon.h6
17 files changed, 164 insertions, 43 deletions
diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h
index 492839920bf..f8249a3dc1f 100644
--- a/cpp/include/IceUtil/Config.h
+++ b/cpp/include/IceUtil/Config.h
@@ -269,6 +269,7 @@ typedef long long Int64;
# define ICE_VALUE_FACTORY ::std::function<::Ice::ValuePtr (const std::string& type)>
# define ICE_CLOSE_CALLBACK ::std::function<void (const ::std::shared_ptr<::Ice::Connection>&)>
# define ICE_HEARTBEAT_CALLBACK ::std::function<void (const ::std::shared_ptr<::Ice::Connection>&)>
+# define ICE_IN(T) T
#else // C++98 mapping
# define ICE_HANDLE ::IceUtil::Handle
# define ICE_INTERNAL_HANDLE ::IceInternal::Handle
@@ -284,6 +285,7 @@ typedef long long Int64;
# define ICE_VALUE_FACTORY ::Ice::ValueFactoryPtr
# define ICE_CLOSE_CALLBACK ::Ice::CloseCallbackPtr
# define ICE_HEARTBEAT_CALLBACK ::Ice::HeartbeatCallbackPtr
+# define ICE_IN(T) const T&
#endif
#endif
diff --git a/cpp/src/IceBox/Admin.cpp b/cpp/src/IceBox/Admin.cpp
index 7e3bf812513..4557d52e3b6 100644
--- a/cpp/src/IceBox/Admin.cpp
+++ b/cpp/src/IceBox/Admin.cpp
@@ -92,7 +92,7 @@ Client::run(int argc, char* argv[])
}
- ObjectPrx base = communicator()->propertyToProxy("IceBoxAdmin.ServiceManager.Proxy");
+ ObjectPrxPtr base = communicator()->propertyToProxy("IceBoxAdmin.ServiceManager.Proxy");
if(base == 0)
{
@@ -133,7 +133,7 @@ Client::run(int argc, char* argv[])
base = communicator()->stringToProxy(managerProxy);
}
- IceBox::ServiceManagerPrx manager = IceBox::ServiceManagerPrx::checkedCast(base);
+ IceBox::ServiceManagerPrxPtr manager = ICE_CHECKED_CAST(IceBox::ServiceManagerPrx, base);
if(!manager)
{
cerr << appName() << ": `" << base << "' is not an IceBox::ServiceManager" << endl;
diff --git a/cpp/src/IceBox/Service.cpp b/cpp/src/IceBox/Service.cpp
index bc228cc918d..7a444e8602d 100644
--- a/cpp/src/IceBox/Service.cpp
+++ b/cpp/src/IceBox/Service.cpp
@@ -100,7 +100,7 @@ IceBox::IceBoxService::start(int argc, char* argv[], int& status)
return false;
}
- _serviceManager = new ServiceManagerI(communicator(), argc, argv);
+ _serviceManager = ICE_MAKE_SHARED(ServiceManagerI, communicator(), argc, argv);
return _serviceManager->start();
}
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index 6dfd8a55001..bd8ba14f4d7 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -77,7 +77,9 @@ IceBox::ServiceManagerI::ServiceManagerI(CommunicatorPtr communicator, int& argc
_pendingStatusChanges(false),
_traceServiceObserver(0)
{
+#ifndef ICE_CPP11_MAPPING
const_cast<CallbackPtr&>(_observerCompletedCB) = newCallback(this, &ServiceManagerI::observerCompleted);
+#endif
_logger = _communicator->getLogger();
PropertiesPtr props = _communicator->getProperties();
@@ -118,7 +120,7 @@ IceBox::ServiceManagerI::getSliceChecksums(const Current&) const
}
void
-IceBox::ServiceManagerI::startService(const string& name, const Current&)
+IceBox::ServiceManagerI::startService(ICE_IN(string) name, const Current&)
{
ServiceInfo info;
{
@@ -194,7 +196,7 @@ IceBox::ServiceManagerI::startService(const string& name, const Current&)
}
void
-IceBox::ServiceManagerI::stopService(const string& name, const Current&)
+IceBox::ServiceManagerI::stopService(ICE_IN(string) name, const Current&)
{
ServiceInfo info;
{
@@ -270,7 +272,7 @@ IceBox::ServiceManagerI::stopService(const string& name, const Current&)
}
void
-IceBox::ServiceManagerI::addObserver(const ServiceObserverPrx& observer, const Current&)
+IceBox::ServiceManagerI::addObserver(ICE_IN(ServiceObserverPrxPtr) observer, const Current&)
{
//
// Null observers and duplicate registrations are ignored
@@ -297,7 +299,15 @@ IceBox::ServiceManagerI::addObserver(const ServiceObserverPrx& observer, const C
if(activeServices.size() > 0)
{
+#ifdef ICE_CPP11_MAPPING
+ observer->servicesStarted_async(activeServices, nullptr,
+ [this, observer](exception_ptr ex)
+ {
+ this->observerCompleted(observer, ex);
+ });
+#else
observer->begin_servicesStarted(activeServices, _observerCompletedCB);
+#endif
}
}
}
@@ -313,7 +323,7 @@ IceBox::ServiceManagerI::start()
{
try
{
- ServiceManagerPtr obj = this;
+ ServiceManagerPtr obj = ICE_SHARED_FROM_THIS;
PropertiesPtr properties = _communicator->getProperties();
//
@@ -470,7 +480,7 @@ IceBox::ServiceManagerI::start()
//
try
{
- _communicator->addAdminFacet(this, "IceBox.ServiceManager");
+ _communicator->addAdminFacet(ICE_SHARED_FROM_THIS, "IceBox.ServiceManager");
_communicator->getAdmin();
}
catch(const ObjectAdapterDeactivatedException&)
@@ -667,7 +677,7 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
SERVICE_FACTORY factory = reinterpret_cast<SERVICE_FACTORY>(sym);
try
{
- info.service = factory(_communicator);
+ info.service = ServicePtr(factory(_communicator));
}
catch(const FailureException&)
{
@@ -897,8 +907,75 @@ IceBox::ServiceManagerI::stopAll()
servicesStopped(stoppedServices, _observers);
+#ifndef ICE_CPP11_MAPPING
_observerCompletedCB = 0; // Break cyclic reference count.
+#endif
+}
+
+#ifdef ICE_CPP11_MAPPING
+
+void
+IceBox::ServiceManagerI::servicesStarted(const vector<string>& services, const set<shared_ptr<ServiceObserverPrx>>& observers)
+{
+ if(services.size() > 0)
+ {
+ for(auto p : observers)
+ {
+ p->servicesStarted_async(
+ services,
+ nullptr,
+ [this, p](exception_ptr ex)
+ {
+ this->observerCompleted(p, ex);
+ });
+ }
+ }
+}
+
+void
+IceBox::ServiceManagerI::servicesStopped(const vector<string>& services, const set<shared_ptr<ServiceObserverPrx>>& observers)
+{
+ if(services.size() > 0)
+ {
+ for(auto p : observers)
+ {
+ p->servicesStopped_async(
+ services,
+ nullptr,
+ [this, p](exception_ptr ex)
+ {
+ this->observerCompleted(p, ex);
+ });
+ }
+ }
+}
+
+void
+IceBox::ServiceManagerI::observerRemoved(const shared_ptr<ServiceObserverPrx>& observer, exception_ptr err)
+{
+ if(_traceServiceObserver >= 1)
+ {
+ try
+ {
+ rethrow_exception(err);
+ }
+ catch(const CommunicatorDestroyedException&)
+ {
+ //
+ // CommunicatorDestroyedException may occur during shutdown. The observer notification has
+ // been sent, but the communicator was destroyed before the reply was received. We do not
+ // log a message for this exception.
+ //
+ }
+ catch(const exception& ex)
+ {
+ Trace out(_logger, "IceBox.ServiceObserver");
+ out << "Removed service observer " << _communicator->proxyToString(observer)
+ << "\nafter catching " << ex.what();
+ }
+ }
}
+#else
void
IceBox::ServiceManagerI::servicesStarted(const vector<string>& services, const set<ServiceObserverPrx>& observers)
@@ -942,6 +1019,7 @@ IceBox::ServiceManagerI::observerRemoved(const ServiceObserverPrx& observer, con
}
}
}
+#endif
Ice::PropertiesPtr
IceBox::ServiceManagerI::createServiceProperties(const string& service)
@@ -976,6 +1054,24 @@ IceBox::ServiceManagerI::createServiceProperties(const string& service)
return properties;
}
+#ifdef ICE_CPP11_MAPPING
+void
+ServiceManagerI::observerCompleted(const shared_ptr<ServiceObserverPrx>& observer, exception_ptr ex)
+{
+ IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
+ //
+ // It's possible to remove several times the same observer, e.g. multiple concurrent
+ // requests that fail
+ //
+ auto p = _observers.find(observer);
+ if(p != _observers.end())
+ {
+ auto observer = *p;
+ _observers.erase(p);
+ observerRemoved(observer, ex);
+ }
+}
+#else
void
ServiceManagerI::observerCompleted(const Ice::AsyncResultPtr& result)
{
@@ -1001,6 +1097,7 @@ ServiceManagerI::observerCompleted(const Ice::AsyncResultPtr& result)
}
}
}
+#endif
void
IceBox::ServiceManagerI::destroyServiceCommunicator(const string& service, const CommunicatorPtr& communicator)
diff --git a/cpp/src/IceBox/ServiceManagerI.h b/cpp/src/IceBox/ServiceManagerI.h
index b0b776a87cd..19dbf7db8ac 100644
--- a/cpp/src/IceBox/ServiceManagerI.h
+++ b/cpp/src/IceBox/ServiceManagerI.h
@@ -19,7 +19,9 @@
namespace IceBox
{
-class ServiceManagerI : public ServiceManager, public IceUtil::Monitor<IceUtil::Mutex>
+class ServiceManagerI : public ServiceManager,
+ public IceUtil::Monitor<IceUtil::Mutex>,
+ public Ice::EnableSharedFromThis<ServiceManagerI>
{
public:
@@ -28,10 +30,10 @@ public:
virtual Ice::SliceChecksumDict getSliceChecksums(const Ice::Current&) const;
- virtual void startService(const std::string&, const ::Ice::Current&);
- virtual void stopService(const std::string&, const ::Ice::Current&);
+ virtual void startService(ICE_IN(std::string), const ::Ice::Current&);
+ virtual void stopService(ICE_IN(std::string), const ::Ice::Current&);
- virtual void addObserver(const ServiceObserverPrx&, const Ice::Current&);
+ virtual void addObserver(ICE_IN(ServiceObserverPrxPtr), const Ice::Current&);
virtual void shutdown(const ::Ice::Current&);
@@ -40,7 +42,11 @@ public:
bool start();
void stop();
+#ifdef ICE_CPP11_MAPPING
+ void observerCompleted(const std::shared_ptr<ServiceObserverPrx>&, std::exception_ptr);
+#else
void observerCompleted(const Ice::AsyncResultPtr&);
+#endif
private:
@@ -66,9 +72,14 @@ private:
void start(const std::string&, const std::string&, const ::Ice::StringSeq&);
void stopAll();
- void servicesStarted(const std::vector<std::string>&, const std::set<ServiceObserverPrx>&);
- void servicesStopped(const std::vector<std::string>&, const std::set<ServiceObserverPrx>&);
+ void servicesStarted(const std::vector<std::string>&, const std::set<ServiceObserverPrxPtr>&);
+ void servicesStopped(const std::vector<std::string>&, const std::set<ServiceObserverPrxPtr>&);
+
+#ifdef ICE_CPP11_MAPPING
+ void observerRemoved(const std::shared_ptr<ServiceObserverPrx>&, std::exception_ptr);
+#else
void observerRemoved(const ServiceObserverPrx&, const std::exception&);
+#endif
Ice::PropertiesPtr createServiceProperties(const std::string&);
void destroyServiceCommunicator(const std::string&, const Ice::CommunicatorPtr&);
@@ -85,12 +96,13 @@ private:
std::vector<ServiceInfo> _services;
bool _pendingStatusChanges;
- std::set<ServiceObserverPrx> _observers;
+ std::set<ServiceObserverPrxPtr> _observers;
int _traceServiceObserver;
+#ifndef ICE_CPP11_MAPPING
::Ice::CallbackPtr _observerCompletedCB;
+#endif
};
-
-typedef IceUtil::Handle<ServiceManagerI> ServiceManagerIPtr;
+ICE_DEFINE_PTR(ServiceManagerIPtr, ServiceManagerI);
}
diff --git a/cpp/src/Makefile b/cpp/src/Makefile
index 46517fbee9f..24411dd40f5 100644
--- a/cpp/src/Makefile
+++ b/cpp/src/Makefile
@@ -20,7 +20,8 @@ ifeq ($(CPP11_MAPPING),yes)
IceDiscovery \
Glacier2Lib \
IceStormLib \
- IceGridLib
+ IceGridLib \
+ IceBox
else
ifneq ($(findstring MINGW,$(UNAME)),)
diff --git a/cpp/src/Makefile.mak b/cpp/src/Makefile.mak
index 5e0296b48b3..b9f70020345 100644
--- a/cpp/src/Makefile.mak
+++ b/cpp/src/Makefile.mak
@@ -27,7 +27,8 @@ SUBDIRS = IceUtil \
IceDiscovery \
Glacier2Lib \
IceStormLib \
- IceGridLib
+ IceGridLib \
+ IceBox
!elseif "$(CPP_COMPILER)" == "VC100"
SUBDIRS = IceUtil \
Slice \
diff --git a/cpp/test/IceBox/admin/AllTests.cpp b/cpp/test/IceBox/admin/AllTests.cpp
index 488dbcecd1d..eaa26cbd107 100644
--- a/cpp/test/IceBox/admin/AllTests.cpp
+++ b/cpp/test/IceBox/admin/AllTests.cpp
@@ -18,25 +18,32 @@ void
allTests(const Ice::CommunicatorPtr& communicator)
{
string ref = "DemoIceBox/admin:default -p 9996 -t 10000";
- Ice::ObjectPrx admin = communicator->stringToProxy(ref);
+ Ice::ObjectPrxPtr admin = communicator->stringToProxy(ref);
- TestFacetPrx facet;
+ TestFacetPrxPtr facet;
cout << "testing custom facet... " << flush;
{
//
// Test: Verify that the custom facet is present.
//
+#ifdef ICE_CPP11_MAPPING
+ facet = Ice::checkedCast<Test::TestFacetPrx>(admin, "TestFacet");
+#else
facet = Test::TestFacetPrx::checkedCast(admin, "TestFacet");
+#endif
facet->ice_ping();
}
cout << "ok" << endl;
cout << "testing properties facet... " << flush;
{
+#ifdef ICE_CPP11_MAPPING
+ auto pa = Ice::checkedCast<Ice::PropertiesAdminPrx>(admin, "IceBox.Service.TestService.Properties");
+#else
Ice::PropertiesAdminPrx pa =
Ice::PropertiesAdminPrx::checkedCast(admin, "IceBox.Service.TestService.Properties");
-
+#endif
//
// Test: PropertiesAdmin::getProperty()
//
@@ -87,11 +94,14 @@ allTests(const Ice::CommunicatorPtr& communicator)
cout << "testing metrics admin facet... " << flush;
{
+#ifdef ICE_CPP11_MAPPING
+ auto ma = Ice::checkedCast<IceMX::MetricsAdminPrx>(admin, "IceBox.Service.TestService.Metrics");
+ auto pa = Ice::checkedCast<Ice::PropertiesAdminPrx>(admin, "IceBox.Service.TestService.Properties");
+#else
IceMX::MetricsAdminPrx ma = IceMX::MetricsAdminPrx::checkedCast(admin, "IceBox.Service.TestService.Metrics");
-
Ice::PropertiesAdminPrx pa =
Ice::PropertiesAdminPrx::checkedCast(admin, "IceBox.Service.TestService.Properties");
-
+#endif
Ice::StringSeq views;
Ice::StringSeq disabledViews;
views = ma->getMetricsViewNames(disabledViews);
@@ -108,7 +118,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
test(views.size() == 3);
// Make sure that the IceBox communicator metrics admin is a separate instance.
+#ifdef ICE_CPP11_MAPPING
+ test(Ice::checkedCast<IceMX::MetricsAdminPrx>(admin, "Metrics")->getMetricsViewNames(disabledViews).empty());
+#else
test(IceMX::MetricsAdminPrx::checkedCast(admin, "Metrics")->getMetricsViewNames(disabledViews).empty());
+#endif
}
cout << "ok" << endl;
}
diff --git a/cpp/test/IceBox/admin/Client.cpp b/cpp/test/IceBox/admin/Client.cpp
index 65003a0112b..480a47227cc 100644
--- a/cpp/test/IceBox/admin/Client.cpp
+++ b/cpp/test/IceBox/admin/Client.cpp
@@ -24,7 +24,7 @@ run(int, char**, const Ice::CommunicatorPtr& comm)
//
// Shutdown the IceBox server.
//
- Ice::ProcessPrx::uncheckedCast(comm->stringToProxy("DemoIceBox/admin -f Process:default -p 9996"))->shutdown();
+ ICE_UNCHECKED_CAST(Ice::ProcessPrx, comm->stringToProxy("DemoIceBox/admin -f Process:default -p 9996"))->shutdown();
return EXIT_SUCCESS;
}
diff --git a/cpp/test/IceBox/admin/Service.cpp b/cpp/test/IceBox/admin/Service.cpp
index a905f67a191..126abb679ca 100644
--- a/cpp/test/IceBox/admin/Service.cpp
+++ b/cpp/test/IceBox/admin/Service.cpp
@@ -44,7 +44,7 @@ create(CommunicatorPtr communicator)
ServiceI::ServiceI(const CommunicatorPtr& serviceManagerCommunicator)
{
- TestFacetIPtr facet = new TestFacetI;
+ TestFacetIPtr facet = ICE_MAKE_SHARED(TestFacetI);
//
// Install a custom admin facet.
@@ -56,7 +56,7 @@ ServiceI::ServiceI(const CommunicatorPtr& serviceManagerCommunicator)
// Set the callback on the admin facet.
//
ObjectPtr propFacet = serviceManagerCommunicator->findAdminFacet("IceBox.Service.TestService.Properties");
- NativePropertiesAdminPtr admin = NativePropertiesAdminPtr::dynamicCast(propFacet);
+ NativePropertiesAdminPtr admin = ICE_DYNAMIC_CAST(NativePropertiesAdmin, propFacet);
assert(admin);
admin->addUpdateCallback(facet);
}
diff --git a/cpp/test/IceBox/admin/TestI.h b/cpp/test/IceBox/admin/TestI.h
index 4fd2072b27f..11322fe56fa 100644
--- a/cpp/test/IceBox/admin/TestI.h
+++ b/cpp/test/IceBox/admin/TestI.h
@@ -29,6 +29,6 @@ private:
Ice::PropertyDict _changes;
bool _called;
};
-typedef IceUtil::Handle<TestFacetI> TestFacetIPtr;
+ICE_DEFINE_PTR(TestFacetIPtr, TestFacetI);
#endif
diff --git a/cpp/test/IceBox/configuration/AllTests.cpp b/cpp/test/IceBox/configuration/AllTests.cpp
index 530c17d21a0..169b81bfc02 100644
--- a/cpp/test/IceBox/configuration/AllTests.cpp
+++ b/cpp/test/IceBox/configuration/AllTests.cpp
@@ -17,10 +17,10 @@ using namespace Test;
void
allTests(const Ice::CommunicatorPtr& communicator)
{
- TestIntfPrx service1 = TestIntfPrx::uncheckedCast(communicator->stringToProxy("test:tcp -p 12010"));
- TestIntfPrx service2 = TestIntfPrx::uncheckedCast(communicator->stringToProxy("test:tcp -p 12011"));
- TestIntfPrx service3 = TestIntfPrx::uncheckedCast(communicator->stringToProxy("test:tcp -p 12012"));
- TestIntfPrx service4 = TestIntfPrx::uncheckedCast(communicator->stringToProxy("test:tcp -p 12013"));
+ TestIntfPrxPtr service1 = ICE_UNCHECKED_CAST(TestIntfPrx, communicator->stringToProxy("test:tcp -p 12010"));
+ TestIntfPrxPtr service2 = ICE_UNCHECKED_CAST(TestIntfPrx, communicator->stringToProxy("test:tcp -p 12011"));
+ TestIntfPrxPtr service3 = ICE_UNCHECKED_CAST(TestIntfPrx, communicator->stringToProxy("test:tcp -p 12012"));
+ TestIntfPrxPtr service4 = ICE_UNCHECKED_CAST(TestIntfPrx, communicator->stringToProxy("test:tcp -p 12013"));
if(service1->getProperty("IceBox.InheritProperties") == "")
{
diff --git a/cpp/test/IceBox/configuration/Client.cpp b/cpp/test/IceBox/configuration/Client.cpp
index 65003a0112b..480a47227cc 100644
--- a/cpp/test/IceBox/configuration/Client.cpp
+++ b/cpp/test/IceBox/configuration/Client.cpp
@@ -24,7 +24,7 @@ run(int, char**, const Ice::CommunicatorPtr& comm)
//
// Shutdown the IceBox server.
//
- Ice::ProcessPrx::uncheckedCast(comm->stringToProxy("DemoIceBox/admin -f Process:default -p 9996"))->shutdown();
+ ICE_UNCHECKED_CAST(Ice::ProcessPrx, comm->stringToProxy("DemoIceBox/admin -f Process:default -p 9996"))->shutdown();
return EXIT_SUCCESS;
}
diff --git a/cpp/test/IceBox/configuration/Service.cpp b/cpp/test/IceBox/configuration/Service.cpp
index 6fa838a93ef..014590dd092 100644
--- a/cpp/test/IceBox/configuration/Service.cpp
+++ b/cpp/test/IceBox/configuration/Service.cpp
@@ -54,7 +54,7 @@ void
ServiceI::start(const string& name, const CommunicatorPtr& communicator, const StringSeq& args)
{
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name + "OA");
- adapter->add(new TestI(args), communicator->stringToIdentity("test"));
+ adapter->add(ICE_MAKE_SHARED(TestI, args), communicator->stringToIdentity("test"));
adapter->activate();
}
diff --git a/cpp/test/IceBox/configuration/TestI.cpp b/cpp/test/IceBox/configuration/TestI.cpp
index 4d9f6ffa187..20de439d5b7 100644
--- a/cpp/test/IceBox/configuration/TestI.cpp
+++ b/cpp/test/IceBox/configuration/TestI.cpp
@@ -17,7 +17,7 @@ TestI::TestI(const Ice::StringSeq& args) : _args(args)
}
std::string
-TestI::getProperty(const std::string& name, const Ice::Current& current)
+TestI::getProperty(ICE_IN(std::string) name, const Ice::Current& current)
{
return current.adapter->getCommunicator()->getProperties()->getProperty(name);
}
diff --git a/cpp/test/IceBox/configuration/TestI.h b/cpp/test/IceBox/configuration/TestI.h
index aca502d7daa..579fb444fa8 100644
--- a/cpp/test/IceBox/configuration/TestI.h
+++ b/cpp/test/IceBox/configuration/TestI.h
@@ -18,7 +18,7 @@ public:
TestI(const Ice::StringSeq&);
- virtual std::string getProperty(const std::string&, const Ice::Current&);
+ virtual std::string getProperty(ICE_IN(std::string), const Ice::Current&);
virtual Ice::StringSeq getArgs(const Ice::Current&);
private:
diff --git a/cpp/test/include/TestCommon.h b/cpp/test/include/TestCommon.h
index d5b2585c627..302d4c8a008 100644
--- a/cpp/test/include/TestCommon.h
+++ b/cpp/test/include/TestCommon.h
@@ -13,12 +13,6 @@
#include <Ice/CommunicatorF.h>
#include <Ice/ProxyF.h>
-#ifdef ICE_CPP11_MAPPING
-# define ICE_IN(T) T
-#else
-# define ICE_IN(T) const T&
-#endif
-
#if defined(ICE_OS_WINRT) || (TARGET_OS_IPHONE)
# include <Ice/Initialize.h>
# include <Ice/Logger.h>