Catalog and loader cleanup#659
Conversation
Added explicit deleted copy constructor and assignment operator to prevent node_catalog instances from being copied. A framework_graph's node_catalog is meant to be unique and should not be duplicated.
Removed using namespace boost; and made all boost namespace references explicit by qualifying them with boost:: prefix. This improves code readability and searchability.
Replace boost::dll::import_symbol with three explicit wrapper structs (module_plugin, source_plugin, driver_plugin), each owning a boost::dll::shared_library and a raw function pointer. This makes library lifetime explicit rather than relying on std::function to keep the loaded .so alive implicitly. plugin_loader now returns std::pair<shared_library, creator_t*> instead of std::function<creator_t>. create_driver changes from std::function<driver_shim_t> to std::optional<driver_plugin>.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
31 fixed, 0 new since branch point (a98ac3d) ✅ 31 CodeQL alerts resolved since the previous PR commit
✅ 31 CodeQL alerts resolved since the branch point
Review the full CodeQL report for details. |
Clang-Tidy Check ResultsFound 6444 issue(s); none are newly introduced by this patch. All issues by check:
See inline comments for details. Comment |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #659 +/- ##
==========================================
+ Coverage 83.27% 83.54% +0.27%
==========================================
Files 162 170 +8
Lines 5912 6619 +707
Branches 670 798 +128
==========================================
+ Hits 4923 5530 +607
- Misses 796 820 +24
- Partials 193 269 +76
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 18 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Clang-Tidy Check ResultsFound 5555 issue(s); none are newly introduced by this patch. All issues by check:
See inline comments for details. Comment |
This PR aims to improve the robustness and clarity of the node_catalog and plugin loading machinery.
Changes:
Make plugin library lifetime explicit — Replace
boost::dll::import_symbol(which relies onstd::functionto keep a shared library alive implicitly) with three explicit wrapper structs (module_plugin,source_plugin,driver_plugin), each owning aboost::dll::shared_libraryand a raw function pointer.plugin_loadernow returnsstd::pair<shared_library, creator_t*>andcreate_driverusesstd::optional<driver_plugin>.Prevent accidental copying of
node_catalog— Add deleted copy constructor and assignment operator, since aframework_graph's catalog is meant to be unique.Remove implicit boost namespace — Replace
using namespace boost;with explicitboost::qualifications for better readability and searchability.Document
node_catalog— Add documentation for registration and module loading behavior.