// ********************************************************************** // // Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef ICE_RETRY_QUEUE_H #define ICE_RETRY_QUEUE_H #include #include #include #include #include #include namespace IceInternal { class RetryTask : public IceUtil::TimerTask { public: RetryTask(const RetryQueuePtr&, const OutgoingAsyncPtr&); virtual void runTimerTask(); void destroy(); bool operator<(const RetryTask&) const; private: const RetryQueuePtr _queue; const OutgoingAsyncPtr _outAsync; }; typedef IceUtil::Handle RetryTaskPtr; class RetryQueue : public IceUtil::Shared, public IceUtil::Mutex { public: RetryQueue(const InstancePtr&); void add(const OutgoingAsyncPtr&, int); void destroy(); private: bool remove(const RetryTaskPtr&); friend class RetryTask; const InstancePtr _instance; std::set _requests; }; } #endif