gpt4 book ai didi

c++ - 可以从 ByteQueue 中抽取数据的自定义源

转载 作者:太空狗 更新时间:2023-10-29 23:14:21 25 4
gpt4 key购买 nike

Crypto++ 有 StringSource、ArraySource、FileSource 等。

但我需要使用可以从 ByteQueue 中获取数据的源类,以便将来传递给过滤器和接收器。

即:

 _QUEUE_Source( MyPreparedQueue, true,
new HashFilter(hash,
new FileSink(zOutputFile),
true));

如果不将 MyPreparedQueue 发送到额外的中间内存缓冲区并选择 ArraySource,我该怎么做?

最佳答案

I need to use source class which can fetch data from ByteQueue for future pass to filter and sink...

Source classes可以提取数据并将其泵送到过滤器。您的 _QUEUE_Source 应该来自 Source . Source 只是一个 BufferedTransformation 带有附件界面。

MyPreparedQueue 可以继承自 ByteQueue .如果您查看继承图,ByteQueue 继承自 BufferedTransformation。或者,MyPreparedQueue 可以继承自 FilterBufferedTransformation

一旦计算出这两个声明缺少的函数:

QueueSource : public Source { ... }
PreparedQueue : public Filter { ... }

对于过滤器,你只需要实现Put2


Crypto++ wiki 有一些关于过滤器的简单阅读。参见 FiltersFilter (Intermediate) .

关于c++ - 可以从 ByteQueue 中抽取数据的自定义源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34043723/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com