diff options
Diffstat (limited to 'cpp/src/Ice/FactoryTableDef.cpp')
-rw-r--r-- | cpp/src/Ice/FactoryTableDef.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/cpp/src/Ice/FactoryTableDef.cpp b/cpp/src/Ice/FactoryTableDef.cpp index e31a7fd0a7e..9241c8da8d6 100644 --- a/cpp/src/Ice/FactoryTableDef.cpp +++ b/cpp/src/Ice/FactoryTableDef.cpp @@ -17,11 +17,11 @@ namespace IceInternal { -FactoryTableWrapper factoryTableWrapper; // Single global instance of the wrapper object that - // initializes factoryTable. +FactoryTableWrapper factoryTableWrapper; // Single global instance of the wrapper object that + // initializes factoryTable. -ICE_API FactoryTableDef* factoryTable; // Single global instance of the factory table for - // non-local exceptions and non-abstract classes +ICE_API FactoryTableDef* factoryTable; // Single global instance of the factory table for + // non-local exceptions and non-abstract classes } // @@ -35,11 +35,11 @@ IceInternal::FactoryTableDef::addExceptionFactory(const std::string& t, const Ic EFTable::iterator i = _eft.find(t); if(i == _eft.end()) { - _eft[t] = EFPair(f, 1); + _eft[t] = EFPair(f, 1); } else { - i->second.second++; + i->second.second++; } } @@ -54,23 +54,23 @@ IceInternal::FactoryTableDef::getExceptionFactory(const std::string& t) const #ifdef __APPLE__ if(i == _eft.end()) { - lock.release(); - - // - // Try to find the symbol, if found this should trigger the - // object static constructors to be called. - // - std::string symbol = "__F"; - for(std::string::const_iterator p = t.begin(); p != t.end(); ++p) - { - symbol += ((*p) == ':') ? '_' : *p; - } - symbol += "__initializer"; - dlsym(RTLD_DEFAULT, symbol.c_str()); - - lock.acquire(); - - i = _eft.find(t); + lock.release(); + + // + // Try to find the symbol, if found this should trigger the + // object static constructors to be called. + // + std::string symbol = "__F"; + for(std::string::const_iterator p = t.begin(); p != t.end(); ++p) + { + symbol += ((*p) == ':') ? '_' : *p; + } + symbol += "__initializer"; + dlsym(RTLD_DEFAULT, symbol.c_str()); + + lock.acquire(); + + i = _eft.find(t); } #endif return i != _eft.end() ? i->second.first : IceInternal::UserExceptionFactoryPtr(); @@ -89,10 +89,10 @@ IceInternal::FactoryTableDef::removeExceptionFactory(const std::string& t) EFTable::iterator i = _eft.find(t); if(i != _eft.end()) { - if(--i->second.second == 0) - { - _eft.erase(i); - } + if(--i->second.second == 0) + { + _eft.erase(i); + } } } @@ -106,11 +106,11 @@ IceInternal::FactoryTableDef::addObjectFactory(const std::string& t, const Ice:: OFTable::iterator i = _oft.find(t); if(i == _oft.end()) { - _oft[t] = OFPair(f, 1); + _oft[t] = OFPair(f, 1); } else { - i->second.second++; + i->second.second++; } } @@ -125,23 +125,23 @@ IceInternal::FactoryTableDef::getObjectFactory(const std::string& t) const #ifdef __APPLE__ if(i == _oft.end()) { - lock.release(); - - // - // Try to find the symbol, if found this should trigger the - // object static constructors to be called. - // - std::string symbol = "__F"; - for(std::string::const_iterator p = t.begin(); p != t.end(); ++p) - { - symbol += ((*p) == ':') ? '_' : *p; - } - symbol += "__initializer"; - dlsym(RTLD_DEFAULT, symbol.c_str()); - - lock.acquire(); - - i = _oft.find(t); + lock.release(); + + // + // Try to find the symbol, if found this should trigger the + // object static constructors to be called. + // + std::string symbol = "__F"; + for(std::string::const_iterator p = t.begin(); p != t.end(); ++p) + { + symbol += ((*p) == ':') ? '_' : *p; + } + symbol += "__initializer"; + dlsym(RTLD_DEFAULT, symbol.c_str()); + + lock.acquire(); + + i = _oft.find(t); } #endif return i != _oft.end() ? i->second.first : Ice::ObjectFactoryPtr(); @@ -160,10 +160,10 @@ IceInternal::FactoryTableDef::removeObjectFactory(const std::string& t) OFTable::iterator i = _oft.find(t); if(i != _oft.end()) { - if(--i->second.second == 0) - { - _oft.erase(i); - } + if(--i->second.second == 0) + { + _oft.erase(i); + } } } @@ -193,7 +193,7 @@ IceInternal::FactoryTableWrapper::initialize() IceUtil::StaticMutex::Lock lock(_m); if(_initCount == 0) { - factoryTable = new FactoryTableDef; + factoryTable = new FactoryTableDef; } ++_initCount; } @@ -207,9 +207,9 @@ IceInternal::FactoryTableWrapper::finalize() IceUtil::StaticMutex::Lock lock(_m); if(--_initCount == 0) { - delete factoryTable; + delete factoryTable; } } IceUtil::StaticMutex IceInternal::FactoryTableWrapper::_m = ICE_STATIC_MUTEX_INITIALIZER; -int IceInternal::FactoryTableWrapper::_initCount = 0; // Initialization count +int IceInternal::FactoryTableWrapper::_initCount = 0; // Initialization count |