⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 callbacki.h

📁 ICE-3.2 一个开源的中间件
💻 H
字号:
// **********************************************************************//// Copyright (c) 2003-2007 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 CALLBACK_I_H#define CALLBACK_I_H#include <IceUtil/Thread.h>#include <IceUtil/Monitor.h>#include <Callback.h>#include <set>class CallbackSenderI;typedef IceUtil::Handle<CallbackSenderI> CallbackSenderIPtr;class CallbackSenderI : public Demo::CallbackSender, public IceUtil::Monitor<IceUtil::Mutex>{public:        CallbackSenderI(const Ice::CommunicatorPtr&);    void destroy();    virtual void addClient(const Ice::Identity&, const Ice::Current&);    void start();    void run();private:    Ice::CommunicatorPtr _communicator;    bool _destroy;    Ice::Int _num;    std::set<Demo::CallbackReceiverPrx> _clients;    //    // We cannot derive CallbackSenderI from IceUtil::Thread, because    // CallbackSenderI uses IceUtil::GCShared as base, and    // IceUtil::Thread uses IceUtil::Shared as base. These two base    // classes are not compatible. Therefore we use this helper class.    //    class CallbackSenderThread : public IceUtil::Thread    {    public:        CallbackSenderThread(const CallbackSenderIPtr& callbackSender) :            _callbackSender(callbackSender)        {        }        virtual void run()        {            _callbackSender->run();        }    private:        const CallbackSenderIPtr _callbackSender;    };    IceUtil::ThreadPtr _callbackSenderThread;};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -