MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / checkBuffersPool

Method checkBuffersPool

Libraries/AsyncStreams/AsyncStreams.cpp:1265–1289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1263 return emptySlot;
1264}
1265
1266Result AsyncPipeline::checkBuffersPool()
1267{
1268 AsyncBuffersPool& buffers = source->getBuffersPool();
1269
1270 for (AsyncWritableStream* sink : sinks)
1271 {
1272 if (sink == nullptr)
1273 break;
1274 if (&sink->getBuffersPool() != &buffers)
1275 {
1276 return Result::Error("AsyncPipeline::start - all streams must use the same AsyncBuffersPool");
1277 }
1278 }
1279 for (AsyncDuplexStream* transform : transforms)
1280 {
1281 if (transform == nullptr)
1282 break;
1283 if ((&transform->AsyncReadableStream::getBuffersPool() != &buffers) and
1284 (&transform->AsyncWritableStream::getBuffersPool() != &buffers))
1285 {
1286 return Result::Error("AsyncPipeline::start - all streams must use the same AsyncBuffersPool");
1287 }
1288 }
1289 return Result(true);
1290}
1291
1292bool AsyncPipeline::listenToEventData(AsyncReadableStream& readable, AsyncDuplexStream& transform, bool listen)

Callers

nothing calls this directly

Calls 2

ErrorEnum · 0.50
ResultClass · 0.50

Tested by

no test coverage detected