Refactor. Streams hierarchy V2. Compiles.

This commit is contained in:
lganzzzo 2019-12-28 23:22:05 +02:00
parent 52e1e4835e
commit a99b5933eb
3 changed files with 12 additions and 9 deletions

View File

@ -149,11 +149,10 @@ void PipelineAsyncTest::onRun() {
}
oatpp::data::stream::BufferInputStream inputStream(pipelineStream.toString());
oatpp::data::stream::DefaultWriteCallback writeCallback(connection.get());
oatpp::data::buffer::IOBuffer ioBuffer;
oatpp::data::stream::transfer(&inputStream, &writeCallback, 0, ioBuffer.getData(), ioBuffer.getSize());
oatpp::data::stream::transfer(&inputStream, connection.get(), 0, ioBuffer.getData(), ioBuffer.getSize());
});

View File

@ -144,11 +144,10 @@ void PipelineTest::onRun() {
}
oatpp::data::stream::BufferInputStream inputStream(pipelineStream.toString());
oatpp::data::stream::DefaultWriteCallback writeCallback(connection.get());
oatpp::data::buffer::IOBuffer ioBuffer;
oatpp::data::stream::transfer(&inputStream, &writeCallback, 0, ioBuffer.getData(), ioBuffer.getSize());
oatpp::data::stream::transfer(&inputStream, connection.get(), 0, ioBuffer.getData(), ioBuffer.getSize());
});

View File

@ -151,15 +151,20 @@ public:
, m_iterations(iterations)
{}
oatpp::async::Action readAsyncInline(oatpp::data::stream::AsyncInlineReadData& inlineData, oatpp::async::Action&& nextAction) override {
data::v_io_size read(void *buffer, v_buff_size count) override {
if(m_counter < m_iterations) {
std::memcpy(inlineData.currBufferPtr, m_text->getData(), m_text->getSize());
inlineData.inc(m_text->getSize());
std::memcpy(buffer, m_text->getData(), m_text->getSize());
m_counter ++;
return m_text->getSize();
}
m_counter ++;
return std::forward<oatpp::async::Action>(nextAction);
return 0;
}
async::Action suggestInputStreamAction(data::v_io_size ioResult) override {
throw std::runtime_error("Not implemented!");
}
};
Action act() {