twowaystream.h

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

H
49
字号
// -*- 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_TWOWAYSTREAM_
#define _YARP2_TWOWAYSTREAM_

#include <yarp/Address.h>
#include <yarp/InputStream.h>
#include <yarp/OutputStream.h>

namespace yarp {
    class TwoWayStream;
}

/**
 * An object containing an InputStream + OutputStream pair.
 */
class yarp::TwoWayStream {
public:
    virtual ~TwoWayStream() {
    }

    virtual InputStream& getInputStream() = 0; // throws
    virtual OutputStream& getOutputStream() = 0; // throws

    virtual const Address& getLocalAddress() = 0; // throws
    virtual const Address& getRemoteAddress() = 0; // throws

    virtual bool isOk() = 0;

    virtual void reset() = 0;

    virtual void close() = 0; // throws

    // These should be called at the beginning and end of logical packets.
    // Streams are encouraged to handle errors and atomicity at the level of 
    // logical packets
    virtual void beginPacket() = 0;
    virtual void endPacket() = 0;
};

#endif

⌨️ 快捷键说明

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