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

Function dump_module

bmf/cmd/src/module_manager.cpp:46–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46int dump_module(std::string module_name) {
47 auto &M = bmf_sdk::ModuleManager::instance();
48 bmf_sdk::ModuleInfo info(module_name);
49 std::shared_ptr<bmf_sdk::ModuleFactoryI> factory;
50 bool get_module_register_info = false;
51 try {
52 factory = M.load_module(info, &info);
53 get_module_register_info =
54 factory->module_info(info); // XXX: will throw an exception when
55 // dump a python non-module package
56 } catch (const std::exception &e) {
57 BMFLOG(BMF_ERROR) << "could not find module:" << module_name << ", "
58 << e.what() << std::endl;
59 return -1;
60 }
61
62 int w = std::string("module_entry: ").size();
63 if (get_module_register_info) {
64 w = std::string("module_description: ").size();
65 }
66 std::cout << std::setw(w) << std::setfill(' ')
67 << "module_name: " << info.module_name << std::endl;
68 std::cout << std::setw(w) << std::setfill(' ')
69 << "module_entry: " << info.module_entry << std::endl;
70 std::cout << std::setw(w) << std::setfill(' ')
71 << "module_type: " << info.module_type << std::endl;
72 std::cout << std::setw(w) << std::setfill(' ')
73 << "module_path: " << info.module_path << std::endl;
74 if (get_module_register_info) {
75 std::cout << std::setw(w) << std::setfill(' ')
76 << "module_description: " << info.module_description
77 << std::endl;
78 std::cout << std::setw(w) << std::setfill(' ')
79 << "module_tag: " << info.module_tag << std::endl;
80 }
81 return 0;
82}
83
84int install_module(const bmf_sdk::ModuleInfo &info, bool force) {
85 // check module_path

Callers 1

mainFunction · 0.85

Calls 5

instanceFunction · 0.85
load_moduleMethod · 0.80
module_infoMethod · 0.45
whatMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected