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

Function create_assemble_node

bmf/engine/c_engine/src/optimizer.cpp:333–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333NodeConfig create_assemble_node(int id, std::vector<StreamConfig> input_streams,
334 int scheduler, int dist_nums) {
335 nlohmann:json info;
336
337 info["id"] = id;
338 // info["alias"] = alias_;
339 info["module_info"] = {
340 {"entry", "assemble_module:AssembleModule"},
341 {"name", "assemble_module"},
342 {"path", "libengine.so"},
343 {"type", "c++"}
344 };
345 // info["meta_info"] = {
346 // "callback_binding", []
347 // "premodule_id", 0
348 // };
349 info["input_streams"] = nlohmann::json::array();
350 for (auto &s : input_streams) {
351 info["input_streams"].push_back({
352 {"alias", s.get_alias()},
353 {"identifier", s.get_identifier()},
354 {"notify", s.get_notify()}
355 });
356 }
357
358 std::ostringstream output_identifier;
359 output_identifier << "assemble_module_" << id << "_0";
360
361 info["output_streams"] = nlohmann::json::array();
362 info["output_streams"].push_back({
363 {"alias", ""},
364 {"identifier", output_identifier.str()},
365 {"notify", ""}
366 });
367 // info["option"] = option_.json_value_;
368 info["scheduler"] = scheduler;
369 info["dist_nums"] = 1;
370 info["input_manager"] = "immediate";
371
372 return NodeConfig(info);
373}
374
375void process_distributed_node(std::vector<bmf_engine::NodeConfig> &nodes) {
376 NodeConfig *upstream_node = nullptr;

Callers 1

process_distributed_nodeFunction · 0.85

Calls 5

strMethod · 0.80
NodeConfigClass · 0.50
get_aliasMethod · 0.45
get_identifierMethod · 0.45
get_notifyMethod · 0.45

Tested by

no test coverage detected