diff options
author | Joe George <joe@zeroc.com> | 2015-12-08 11:33:42 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2015-12-08 16:09:24 -0500 |
commit | 6a43686ce26de5d2d5edf4a485ecff3a242c26b6 (patch) | |
tree | d31e4f16dc9ed6e28056a7224e045a4638955f5e /cpp/src/Ice/FactoryTable.cpp | |
parent | C++11 mapping IceDiscovery plug-in (diff) | |
download | ice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.tar.bz2 ice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.tar.xz ice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.zip |
ICE-6908 - Add ValueFactory
ValueFactory is a replacement for ObjectFactory (which is still
available if needed). It is an interface with only one operation
and can has the "delegate" metadata.
Diffstat (limited to 'cpp/src/Ice/FactoryTable.cpp')
-rw-r--r-- | cpp/src/Ice/FactoryTable.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/cpp/src/Ice/FactoryTable.cpp b/cpp/src/Ice/FactoryTable.cpp index bc48ab8d6e9..680f19aa241 100644 --- a/cpp/src/Ice/FactoryTable.cpp +++ b/cpp/src/Ice/FactoryTable.cpp @@ -8,7 +8,7 @@ // ********************************************************************** #include <Ice/FactoryTable.h> -#include <Ice/ObjectFactory.h> +#include <Ice/ValueFactory.h> using namespace std; @@ -64,22 +64,22 @@ IceInternal::FactoryTable::removeExceptionFactory(const string& t) } // -// Add a factory to the object factory table. +// Add a factory to the value factory table. // #ifdef ICE_CPP11_MAPPING void -IceInternal::FactoryTable::addObjectFactory(const string& t, function<::Ice::ValuePtr (const string&)> f) +IceInternal::FactoryTable::addValueFactory(const string& t, function<::Ice::ValuePtr (const string&)> f) #else void -IceInternal::FactoryTable::addObjectFactory(const string& t, const ::Ice::ObjectFactoryPtr& f) +IceInternal::FactoryTable::addValueFactory(const string& t, const ::Ice::ValueFactoryPtr& f) #endif { IceUtil::Mutex::Lock lock(_m); assert(f); - OFTable::iterator i = _oft.find(t); - if(i == _oft.end()) + VFTable::iterator i = _vft.find(t); + if(i == _vft.end()) { - _oft[t] = OFPair(f, 1); + _vft[t] = VFPair(f, 1); } else { @@ -88,48 +88,48 @@ IceInternal::FactoryTable::addObjectFactory(const string& t, const ::Ice::Object } // -// Return the object factory for a given type ID +// Return the value factory for a given type ID // #ifdef ICE_CPP11_MAPPING function<Ice::ValuePtr(const string&)> -IceInternal::FactoryTable::getObjectFactory(const string& t) const +IceInternal::FactoryTable::getValueFactory(const string& t) const { IceUtil::Mutex::Lock lock(_m); - OFTable::const_iterator i = _oft.find(t); - return i != _oft.end() ? i->second.first : nullptr; + VFTable::const_iterator i = _vft.find(t); + return i != _vft.end() ? i->second.first : nullptr; } #else -Ice::ObjectFactoryPtr -IceInternal::FactoryTable::getObjectFactory(const string& t) const +Ice::ValueFactoryPtr +IceInternal::FactoryTable::getValueFactory(const string& t) const { IceUtil::Mutex::Lock lock(_m); - OFTable::const_iterator i = _oft.find(t); - return i != _oft.end() ? i->second.first : Ice::ObjectFactoryPtr(); + VFTable::const_iterator i = _vft.find(t); + return i != _vft.end() ? i->second.first : Ice::ValueFactoryPtr(); } #endif // -// Remove a factory from the object factory table. If the factory +// Remove a factory from the value factory table. If the factory // is not present, do nothing; otherwise, decrement the factory's // reference count if the count drops to zero, remove the factory's // entry from the table. // void -IceInternal::FactoryTable::removeObjectFactory(const string& t) +IceInternal::FactoryTable::removeValueFactory(const string& t) { IceUtil::Mutex::Lock lock(_m); - OFTable::iterator i = _oft.find(t); - if(i != _oft.end()) + VFTable::iterator i = _vft.find(t); + if(i != _vft.end()) { if(--i->second.second == 0) { - _oft.erase(i); + _vft.erase(i); } } } // -// Add a factory to the object factory table. +// Add a factory to the value factory table. // void IceInternal::FactoryTable::addTypeId(int compactId, const string& typeId) |