diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-02-03 10:42:29 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-02-03 10:42:29 +0100 |
commit | 18a6720fcc3ece576f5fb26283e239cda2bebadd (patch) | |
tree | a7d9de0acab9e092943fb182fa880b2c4b950db6 /cpp/include/Ice/FactoryTableInit.h | |
parent | ICE-6861 - Java stream API changes (diff) | |
download | ice-18a6720fcc3ece576f5fb26283e239cda2bebadd.tar.bz2 ice-18a6720fcc3ece576f5fb26283e239cda2bebadd.tar.xz ice-18a6720fcc3ece576f5fb26283e239cda2bebadd.zip |
Refactored invocation code to better suite new C++11 mapping
Diffstat (limited to 'cpp/include/Ice/FactoryTableInit.h')
-rw-r--r-- | cpp/include/Ice/FactoryTableInit.h | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/cpp/include/Ice/FactoryTableInit.h b/cpp/include/Ice/FactoryTableInit.h index 51660970d1d..4ded5bb725b 100644 --- a/cpp/include/Ice/FactoryTableInit.h +++ b/cpp/include/Ice/FactoryTableInit.h @@ -34,10 +34,10 @@ class ICE_API CompactIdInit public: CompactIdInit(const char*, int); - ~CompactIdInit(); private: + const int _compactId; }; @@ -46,19 +46,17 @@ class DefaultUserExceptionFactoryInit { public: - DefaultUserExceptionFactoryInit(const char* typeId) : - _typeId(typeId) + DefaultUserExceptionFactoryInit(const char* tId) : typeId(tId) { - factoryTable->addExceptionFactory(_typeId, new DefaultUserExceptionFactory<E>(_typeId)); + factoryTable->addExceptionFactory(typeId, new DefaultUserExceptionFactory<E>(typeId)); } ~DefaultUserExceptionFactoryInit() { - factoryTable->removeExceptionFactory(_typeId); + factoryTable->removeExceptionFactory(typeId); } -private: - const ::std::string _typeId; + const ::std::string typeId; }; template<class O> @@ -66,28 +64,25 @@ class DefaultValueFactoryInit { public: - DefaultValueFactoryInit(const char* typeId) : - _typeId(typeId) + DefaultValueFactoryInit(const char* tId) : typeId(tId) { #ifdef ICE_CPP11_MAPPING - factoryTable->addValueFactory(_typeId, - [](const std::string&) - { - return ::std::make_shared<O>(); - }); + factoryTable->addValueFactory(typeId, + [](const std::string&) + { + return ::std::make_shared<O>(); + }); #else - factoryTable->addValueFactory(_typeId, new DefaultValueFactory<O>(_typeId)); + factoryTable->addValueFactory(typeId, new DefaultValueFactory<O>(typeId)); #endif } ~DefaultValueFactoryInit() { - factoryTable->removeValueFactory(_typeId); + factoryTable->removeValueFactory(typeId); } -private: - const ::std::string _typeId; - + const ::std::string typeId; }; } |