diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-07-26 18:07:13 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-07-26 18:07:13 -0400 |
commit | 6b130bc0088cdb0d55efc1e4f0fe36033bad770a (patch) | |
tree | ac9c5ed4272e9b2fbde2f8e9adf72caea1cd1595 /cpp/src/Ice/PropertiesAdminI.h | |
parent | ICE-7252 - Disable optimizer for non-VC140 builds (diff) | |
download | ice-6b130bc0088cdb0d55efc1e4f0fe36033bad770a.tar.bz2 ice-6b130bc0088cdb0d55efc1e4f0fe36033bad770a.tar.xz ice-6b130bc0088cdb0d55efc1e4f0fe36033bad770a.zip |
C++11 mapping for PropertiesAdminUpdateCallback
Diffstat (limited to 'cpp/src/Ice/PropertiesAdminI.h')
-rw-r--r-- | cpp/src/Ice/PropertiesAdminI.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/cpp/src/Ice/PropertiesAdminI.h b/cpp/src/Ice/PropertiesAdminI.h index 6e852c7b583..8fcdc891cfe 100644 --- a/cpp/src/Ice/PropertiesAdminI.h +++ b/cpp/src/Ice/PropertiesAdminI.h @@ -16,36 +16,53 @@ #include <Ice/NativePropertiesAdmin.h> #include <Ice/LoggerF.h> +#ifdef ICE_CPP11_MAPPING +#include <list> +#endif + namespace IceInternal { -class PropertiesAdminI : public Ice::PropertiesAdmin, public Ice::NativePropertiesAdmin, private IceUtil::RecMutex +class PropertiesAdminI : public Ice::PropertiesAdmin, public Ice::NativePropertiesAdmin, +#ifdef ICE_CPP11_MAPPING + public std::enable_shared_from_this<PropertiesAdminI>, +#endif + private IceUtil::RecMutex { public: PropertiesAdminI(const Ice::PropertiesPtr&, const Ice::LoggerPtr&); #ifdef ICE_CPP11_MAPPING - virtual std::string getProperty(std::string, const Ice::Current&); - virtual Ice::PropertyDict getPropertiesForPrefix(std::string, const Ice::Current&); + virtual std::string getProperty(std::string, const Ice::Current&) override; + virtual Ice::PropertyDict getPropertiesForPrefix(std::string, const Ice::Current&) override; virtual void setPropertiesAsync(::Ice::PropertyDict, ::std::function<void()>, ::std::function<void(::std::exception_ptr)>, - const Ice::Current&); + const Ice::Current&) override; + + virtual std::function<void()> addUpdateCallback(std::function<void(const Ice::PropertyDict&)>) override; + void removeUpdateCallback(std::list<std::function<void(const Ice::PropertyDict&)>>::iterator); + #else virtual std::string getProperty(const std::string&, const Ice::Current&); virtual Ice::PropertyDict getPropertiesForPrefix(const std::string&, const Ice::Current&); virtual void setProperties_async(const Ice::AMD_PropertiesAdmin_setPropertiesPtr&, const Ice::PropertyDict&, const Ice::Current&); -#endif virtual void addUpdateCallback(const Ice::PropertiesAdminUpdateCallbackPtr&); virtual void removeUpdateCallback(const Ice::PropertiesAdminUpdateCallbackPtr&); +#endif private: const Ice::PropertiesPtr _properties; const Ice::LoggerPtr _logger; + +#ifdef ICE_CPP11_MAPPING + std::list<std::function<void(const Ice::PropertyDict&)>> _updateCallbacks; +#else std::vector<Ice::PropertiesAdminUpdateCallbackPtr> _updateCallbacks; +#endif }; ICE_DEFINE_PTR(PropertiesAdminIPtr, PropertiesAdminI); |