MCPcopy Create free account
hub / github.com/BabitMF/bmf / process

Method process

bmf/c_modules/src/mock_decoder.cpp:25–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25int MockDecoder::process(Task &task) {
26 BMFLOG_NODE(BMF_INFO, node_id_) << "process";
27 number_++;
28 for (auto output_queue : task.get_outputs()) {
29 std::string data = "hello world";
30 auto packet = Packet(data);
31 packet.set_timestamp(number_);
32 BMFLOG_NODE(BMF_INFO, node_id_)
33 << packet.timestamp() << "data type:" << packet.type_info().name;
34 task.fill_output_packet(output_queue.first, packet);
35
36 sleep(1);
37 if (number_ == 10) {
38 task.fill_output_packet(output_queue.first,
39 Packet::generate_eof_packet());
40 task.set_timestamp(DONE);
41 }
42 }
43 BMFLOG_NODE(BMF_INFO, node_id_)
44 << "MockDecoder process result output queue size: "
45 << task.get_outputs()[0]->size() << std::endl;
46 return 0;
47}
48
49int MockDecoder::reset() { return 0; }
50

Callers 1

TESTFunction · 0.45

Calls 5

fill_output_packetMethod · 0.80
PacketFunction · 0.50
set_timestampMethod · 0.45
timestampMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.36