From 18a6720fcc3ece576f5fb26283e239cda2bebadd Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 3 Feb 2016 10:42:29 +0100 Subject: Refactored invocation code to better suite new C++11 mapping --- cpp/src/Ice/FactoryTable.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'cpp/src/Ice/FactoryTable.cpp') diff --git a/cpp/src/Ice/FactoryTable.cpp b/cpp/src/Ice/FactoryTable.cpp index d8b37ec8b58..e7fec2162ab 100644 --- a/cpp/src/Ice/FactoryTable.cpp +++ b/cpp/src/Ice/FactoryTable.cpp @@ -66,13 +66,8 @@ IceInternal::FactoryTable::removeExceptionFactory(const string& t) // // Add a factory to the value factory table. // -#ifdef ICE_CPP11_MAPPING void -IceInternal::FactoryTable::addValueFactory(const string& t, function<::Ice::ValuePtr (string)> f) -#else -void -IceInternal::FactoryTable::addValueFactory(const string& t, const ::Ice::ValueFactoryPtr& f) -#endif +IceInternal::FactoryTable::addValueFactory(const string& t, ICE_IN(ICE_VALUE_FACTORY) f) { IceUtil::Mutex::Lock lock(_m); assert(f); @@ -90,23 +85,13 @@ IceInternal::FactoryTable::addValueFactory(const string& t, const ::Ice::ValueFa // // Return the value factory for a given type ID // -#ifdef ICE_CPP11_MAPPING -function -IceInternal::FactoryTable::getValueFactory(const string& t) const -{ - IceUtil::Mutex::Lock lock(_m); - VFTable::const_iterator i = _vft.find(t); - return i != _vft.end() ? i->second.first : nullptr; -} -#else -Ice::ValueFactoryPtr +ICE_VALUE_FACTORY IceInternal::FactoryTable::getValueFactory(const string& t) const { IceUtil::Mutex::Lock lock(_m); VFTable::const_iterator i = _vft.find(t); - return i != _vft.end() ? i->second.first : Ice::ValueFactoryPtr(); + return i != _vft.end() ? i->second.first : ICE_VALUE_FACTORY(); } -#endif // // Remove a factory from the value factory table. If the factory -- cgit v1.2.3