diff options
Diffstat (limited to 'cpp/src/IceBox/ServiceManagerI.h')
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/cpp/src/IceBox/ServiceManagerI.h b/cpp/src/IceBox/ServiceManagerI.h index c3602ed45bb..dd56621ac3f 100644 --- a/cpp/src/IceBox/ServiceManagerI.h +++ b/cpp/src/IceBox/ServiceManagerI.h @@ -19,7 +19,11 @@ namespace IceBox { -class ServiceManagerI : public ServiceManager, public IceUtil::Monitor<IceUtil::Mutex> +class ServiceManagerI : public ServiceManager, + public IceUtil::Monitor<IceUtil::Mutex> +#ifdef ICE_CPP11_MAPPING + , public std::enable_shared_from_this<ServiceManagerI> +#endif { public: @@ -28,10 +32,10 @@ public: virtual Ice::SliceChecksumDict getSliceChecksums(const Ice::Current&) const; - virtual void startService(const std::string&, const ::Ice::Current&); - virtual void stopService(const std::string&, const ::Ice::Current&); + virtual void startService(ICE_IN(std::string), const ::Ice::Current&); + virtual void stopService(ICE_IN(std::string), const ::Ice::Current&); - virtual void addObserver(const ServiceObserverPrx&, const Ice::Current&); + virtual void addObserver(ICE_IN(ServiceObserverPrxPtr), const Ice::Current&); virtual void shutdown(const ::Ice::Current&); @@ -40,7 +44,11 @@ public: bool start(); void stop(); +#ifdef ICE_CPP11_MAPPING + void observerCompleted(const std::shared_ptr<ServiceObserverPrx>&, std::exception_ptr); +#else void observerCompleted(const Ice::AsyncResultPtr&); +#endif private: @@ -66,9 +74,15 @@ private: void start(const std::string&, const std::string&, const ::Ice::StringSeq&); void stopAll(); - void servicesStarted(const std::vector<std::string>&, const std::set<ServiceObserverPrx>&); - void servicesStopped(const std::vector<std::string>&, const std::set<ServiceObserverPrx>&); + void servicesStarted(const std::vector<std::string>&, const std::set<ServiceObserverPrxPtr>&); + void servicesStopped(const std::vector<std::string>&, const std::set<ServiceObserverPrxPtr>&); + +#ifdef ICE_CPP11_MAPPING + std::function<void(std::exception_ptr)> makeObserverCompletedCallback(const std::shared_ptr<ServiceObserverPrx>&); + void observerRemoved(const std::shared_ptr<ServiceObserverPrx>&, std::exception_ptr); +#else void observerRemoved(const ServiceObserverPrx&, const std::exception&); +#endif Ice::PropertiesPtr createServiceProperties(const std::string&); void destroyServiceCommunicator(const std::string&, const Ice::CommunicatorPtr&); @@ -85,12 +99,13 @@ private: std::vector<ServiceInfo> _services; bool _pendingStatusChanges; - std::set<ServiceObserverPrx> _observers; + std::set<ServiceObserverPrxPtr> _observers; int _traceServiceObserver; +#ifndef ICE_CPP11_MAPPING ::Ice::CallbackPtr _observerCompletedCB; +#endif }; - -typedef IceUtil::Handle<ServiceManagerI> ServiceManagerIPtr; +ICE_DEFINE_PTR(ServiceManagerIPtr, ServiceManagerI); } |