diff options
Diffstat (limited to 'cpp/include/Ice/NativePropertiesAdmin.h')
-rw-r--r-- | cpp/include/Ice/NativePropertiesAdmin.h | 67 |
1 files changed, 45 insertions, 22 deletions
diff --git a/cpp/include/Ice/NativePropertiesAdmin.h b/cpp/include/Ice/NativePropertiesAdmin.h index 15bcbb4f9e4..0d1596efc19 100644 --- a/cpp/include/Ice/NativePropertiesAdmin.h +++ b/cpp/include/Ice/NativePropertiesAdmin.h @@ -15,36 +15,47 @@ namespace Ice { -// -// An application can be notified when its configuration properties are modified -// via the Properties admin facet. The application must define a subclass of -// PropertiesAdminUpdateCallback and register it with the facet. The facet -// implements the class NativePropertiesAdmin, so the application needs to -// downcast the facet to this type in order to register the callback. -// -// For example: -// -// Ice::ObjectPtr obj = communicator->findAdminFacet("Properties"); -// assert(obj); // May be null if the facet is not enabled -// NativePropertiesAdminPtr facet = NativePropertiesAdminPtr::dynamicCast(obj); -// PropertiesAdminUpdateCallbackPtr myCallback = ...; -// facet->addUpdateCallback(myCallback); -// -// Ice ignores any exceptions raised by the callback. -// - #ifndef ICE_CPP11_MAPPING +/** + * An application can be notified when its configuration properties are modified + * via the Properties admin facet. The application must define a subclass of + * PropertiesAdminUpdateCallback and register it with the facet. The facet + * implements the class NativePropertiesAdmin, so the application needs to + * downcast the facet to this type in order to register the callback. + * + * For example: + * + * \code + * Ice::ObjectPtr obj = communicator->findAdminFacet("Properties"); + * assert(obj); // May be null if the facet is not enabled + * NativePropertiesAdminPtr facet = NativePropertiesAdminPtr::dynamicCast(obj); + * PropertiesAdminUpdateCallbackPtr myCallback = ...; + * facet->addUpdateCallback(myCallback); + * \endcode + * + * Ice ignores any exceptions raised by the callback. + * \headerfile Ice/Ice.h + */ class ICE_API PropertiesAdminUpdateCallback : public virtual Ice::LocalObject { public: virtual ~PropertiesAdminUpdateCallback(); - virtual void updated(const PropertyDict&) = 0; + /** + * Called when the communicator's properties have been updated. + * @param d A dictionary containing the properties that were added, changed or removed, + * with a removed property denoted by an entry whose value is an empty string. + */ + virtual void updated(const PropertyDict& d) = 0; }; typedef IceUtil::Handle<PropertiesAdminUpdateCallback> PropertiesAdminUpdateCallbackPtr; #endif +/** + * Base class for the Properties admin facet. + * \headerfile Ice/Ice.h + */ class ICE_API NativePropertiesAdmin #ifndef ICE_CPP11_MAPPING : public virtual IceUtil::Shared @@ -55,10 +66,22 @@ public: virtual ~NativePropertiesAdmin(); #ifdef ICE_CPP11_MAPPING - virtual std::function<void()> addUpdateCallback(std::function<void(const PropertyDict&)>) = 0; + /** + * Register an update callback that will be invoked when property updates occur. + * @param cb The callback. + */ + virtual std::function<void()> addUpdateCallback(std::function<void(const PropertyDict&)> cb) = 0; #else - virtual void addUpdateCallback(const PropertiesAdminUpdateCallbackPtr&) = 0; - virtual void removeUpdateCallback(const PropertiesAdminUpdateCallbackPtr&) = 0; + /** + * Register an update callback that will be invoked when property updates occur. + * @param cb The callback. + */ + virtual void addUpdateCallback(const PropertiesAdminUpdateCallbackPtr& cb) = 0; + /** + * Remove an update callback. + * @param cb The callback to be removed. + */ + virtual void removeUpdateCallback(const PropertiesAdminUpdateCallbackPtr& cb) = 0; #endif }; ICE_DEFINE_PTR(NativePropertiesAdminPtr, NativePropertiesAdmin); |