MCPcopy Create free account
hub / github.com/andreiavrammsd/cpp-channel / transform

Function transform

examples/cmake-project/src/main.cpp:25–31  ·  view source on GitHub ↗

Read data from the incoming channel, process it, then send it on the outgoing channel

Source from the content-addressed store, hash-verified

23
24// Read data from the incoming channel, process it, then send it on the outgoing channel
25void transform(chan& incoming, chan& outgoing)
26{
27 for (auto input : incoming) {
28 auto result = add(input, 2);
29 outgoing << result;
30 }
31}
32
33// Read result of processing from the outgoing channel and save it
34void write_outgoing(chan& outgoing)

Callers 2

TESTFunction · 0.85
mainFunction · 0.85

Calls 1

addFunction · 0.85

Tested by 1

TESTFunction · 0.68