diff options
Diffstat (limited to 'cpp/include')
-rw-r--r-- | cpp/include/Ice/OutgoingAsync.h | 80 |
1 files changed, 37 insertions, 43 deletions
diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h index 8871ba08a68..e72fef15768 100644 --- a/cpp/include/Ice/OutgoingAsync.h +++ b/cpp/include/Ice/OutgoingAsync.h @@ -30,33 +30,51 @@ class ICE_API OutgoingAsyncMessageCallback : virtual public IceUtil::Shared { public: - virtual ~OutgoingAsyncMessageCallback() { } + OutgoingAsyncMessageCallback(); + virtual ~OutgoingAsyncMessageCallback(); virtual void __sent(Ice::ConnectionI*) = 0; virtual void __finished(const Ice::LocalException&) = 0; + + virtual void ice_exception(const Ice::Exception&) = 0; + + BasicStream* + __getOs() + { + return __os; + } + + void __exception(const Ice::Exception&); + +protected: + + void __acquire(const Ice::ObjectPrx&); + void __release(const Ice::LocalException&); + void __release() + { + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(__monitor); + __releaseNoSync(); + } + void __releaseNoSync(); + + void __warning(const std::exception&) const; + void __warning() const; + + IceUtil::Monitor<IceUtil::Mutex> __monitor; + BasicStream* __is; + BasicStream* __os; }; // // We need virtual inheritance from shared, because the user might use // multiple inheritance from IceUtil::Shared. // -class ICE_API OutgoingAsync : public OutgoingAsyncMessageCallback, public IceUtil::TimerTask +class ICE_API OutgoingAsync : public OutgoingAsyncMessageCallback, private IceUtil::TimerTask { public: - OutgoingAsync(); - virtual ~OutgoingAsync(); - void __sent(Ice::ConnectionI*); - BasicStream* - __getOs() - { - return __os; - } - - virtual void ice_exception(const Ice::Exception&) = 0; - void __finished(BasicStream&); void __finished(const Ice::LocalException&); void __finished(const LocalExceptionWrapper&); @@ -68,17 +86,13 @@ protected: virtual void __response(bool) = 0; - BasicStream* __is; - BasicStream* __os; - private: - void runTimerTask(); // Implementation of TimerTask::runTimerTask() - - void warning(const std::exception&) const; - void warning() const; + void handleException(const Ice::LocalException&); + void handleException(const LocalExceptionWrapper&); - void cleanup(); + void runTimerTask(); // Implementation of TimerTask::runTimerTask() + Ice::ConnectionIPtr _timerTaskConnection; bool _sent; bool _response; @@ -86,38 +100,18 @@ private: Handle< ::IceDelegate::Ice::Object> _delegate; int _cnt; Ice::OperationMode _mode; - - Ice::ConnectionIPtr _timerTaskConnection; - IceUtil::Monitor<IceUtil::Mutex> _monitor; }; class ICE_API BatchOutgoingAsync : public OutgoingAsyncMessageCallback { public: - BatchOutgoingAsync(); - - void __prepare(const InstancePtr&); virtual void __sent(Ice::ConnectionI*); virtual void __finished(const Ice::LocalException&); - BasicStream* - __getOs() - { - return _os; - } - - virtual void ice_exception(const Ice::Exception&) = 0; - -private: - - void warning(const std::exception&) const; - void warning() const; - - void cleanup(); +protected: - IceUtil::Monitor<IceUtil::Mutex> _monitor; - BasicStream* _os; + void __prepare(const InstancePtr&); }; } |