fallbacknameserver.h

来自「一个语言识别引擎」· C头文件 代码 · 共 47 行

H
47
字号
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-

/*
 * Copyright (C) 2006 Paul Fitzpatrick
 * CopyPolicy: Released under the terms of the GNU GPL v2.0.
 *
 */

#ifndef _YARP2_FALLBACKNAMESERVER_
#define _YARP2_FALLBACKNAMESERVER_

#include <yarp/ThreadImpl.h>
#include <yarp/Address.h>
#include <yarp/DgramTwoWayStream.h>

namespace yarp {
    class FallbackNameServer;
    class NameServer;
}

/**
 * Multi-cast server, for last resort information sharing about
 * name information -- when config files are missing or wrong
 */
class yarp::FallbackNameServer : public ThreadImpl {
public:
    FallbackNameServer(NameServer& owner) : owner(owner) {
        closed = false;
    }

    virtual void run();
    virtual void close();

    static const Address& getAddress() {
        return mcastLastResort;
    }

private:
    NameServer& owner;
    static const Address mcastLastResort;
    DgramTwoWayStream listen;
    bool closed;
};

#endif

⌨️ 快捷键说明

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