返回介绍

QDataSink Class

发布于 2019-10-04 14:59:20 字数 1862 浏览 1091 评论 0 收藏 0

The QDataSink class is an asynchronous consumer of data. More...

#include <qasyncio.h>

Inherits QAsyncIO.

List of all member functions.

Public Members

  • virtual int readyToReceive () = 0
  • virtual void receive ( const uchar *, intcount ) = 0
  • virtual void eof () = 0
  • void maybeReady ()

Detailed Description

This class is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.

The QDataSink class is an asynchronous consumer of data.

A data sink is an object which receives data from some source in an asynchronous manner. This means that at some time not determined by the data sink, blocks of data are given to it from processing. The data sink is able to limit the maximum size of such blocks which it is currently able to process.

See also QAsyncIO, QDataSource and QDataPump.


Member Function Documentation

void QDataSink::eof () [pure virtual]

This function will be called when no more data is available for processing.

void QDataSink::maybeReady ()

This should be called whenever readyToReceive() might have become non-zero. It is merely calls QAsyncIO::ready() if readyToReceive() is non-zero.

int QDataSink::readyToReceive () [pure virtual]

The data sink should return a value indicating how much data it is ready to consume. This may be 0.

void QDataSink::receive ( const uchar *, intcount ) [pure virtual]

This function is called to provide data for the data sink. The count will be no more than the amount indicated by the most recent call to readyToReceive(). The sink must use all the provided data.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文