701 Add dynamic targeting functionality for factory services to DS. (#977)#1161
Merged
jeffdiclemente merged 2 commits intoCppMicroServices:c++14-compliantfrom Jul 25, 2025
Merged
Conversation
…icroServices#977) * Add dynamic targeting functionality for factory services to DS. Add dynamic targeting functionality for factory services to DS. - move CreateFactoryComponent from ConfigurationNotifier to new class ComponentFactoryImpl - Process targets from configuration objects in CreateFactoryComponent - Add one test. (more to be added later). Signed-off by: pelliott@mathworks.com * Update TestSCRExtensionRegistry.cpp Fix merge issue. Signed-off-by: pelliott@mathworks.com * Update ComponentFactoryImpl.cpp Fixed local variable with no name issue. Signed-off-by: pelliott@mathworks.com * Changes requested by code reviews Changes from code reviews to improve efficiency. Signed-off-by: pelliott@mathworks.com * Added tests for the dynamic target functionality Added more tests for the factory dynamic target functionality. Signed-off by: The MathWorks Inc. <pelliott@mathworks.com> * Update ConfigurationNotifier.cpp Fixed compiler error on mac os caused by initializing memory variables out of order. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Fix data race condition detected by Thread Sanitizer Added mutex to be used by CreateFactoryConfiguration when calculating the random instance name for the factory pid. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Update TestFactoryTarget.cpp Fix memory leak in usDeclarativeServicesTests. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * dynamic target for factory services Made some fixes as a result of code review feedback. Also added tests to improve code coverage. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Fixed issues from code review of dynamic target functionality Fixed issues in ComponentFactoryImpl.cpp and TestFactoryTarget.cpp. Code review feedback. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Added tests for dynamic targets Dynamic targets only apply to configuration objects associated with constructing factory instances. Added code to detect and log dynamic targets in configuration objects that are not constructing factory instances. Added tests to confirm logging and to confirm that the appearance of a dynamic target in a configuration object that is not constructing a factory instance has no effect. Signed-off-by. The MathWorks, Inc. <pelliott@mathworks.com> * SCRCodeGen change for factory components Added test to make sure that the configuration-pid array for factory components only contains one pid. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Changes do to code review feedback for dynamic target implementation Changes from code review feedback. The most significant ones were: ConfigurationAdminImpl::RandomInstanceName - replaced mutex by using thread_local storage for the variable. When a dynamic target appears in a configuration object the key will be referenceName.target instead of interfaceName. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Responses to code review feedback Fixed issues raised by code reviews. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Responses to code review feedback Update dynamic target functionality based on code review feedback. Signed-off-by: The Mathworks, Inc. <pelliott@mathworks.com> * Update ComponentFactoryImpl.cpp Fixed problem introduced in last commit. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Update ConfigurationAdminImpl.hpp Whitespace change. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * TestBundleDSFAC1 fix Fix unused input parameter error. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Update TestFixture.hpp Removing these reset function calls introduced some memcheck issues. Restoring the calls. Signed-off-by: The MathWorks, Inc. <pelliott@mathworks.com> * Update ConfigurationNotifier.hpp FIx merge issue * Update ConfigurationNotifier.hpp Fix merge issue * Update compendium/DeclarativeServices/src/manager/ComponentFactoryImpl.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update compendium/DeclarativeServices/src/manager/ComponentFactoryImpl.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update compendium/DeclarativeServices/src/manager/ComponentFactoryImpl.hpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update compendium/DeclarativeServices/src/manager/ComponentFactoryImpl.hpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update compendium/test_bundles/TestBundleDSFAC1/src/ServiceImpl.hpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update compendium/DeclarativeServices/src/manager/ComponentFactoryImpl.hpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Get rid of some clang tidy warnings Signed-off-by The MathWorks, Inc. <pelliott#mathworks.com> * Update ServiceImpl.hpp Updating link tidy warnings. <pelliott@mathworks.com> * Fixed errors introduced by clang tidy fixes. Fixed errors introduced by clang tidy fixes.Signed-off-by <pelliott@mathworks.com> * Update ComponentFactoryImpl.cpp Fix issues introduced by clang tidy edits. signed-off-by The MathWorks, Inc. <pelliott@mathworks.com> * Update ComponentFactoryImpl.cpp Fiz ComponentFactoryImpl Constructor issue introduced by clang tidy "fixes". Signed-off-by The MathWorks, Inc. <pelliott@mathworks.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## c++14-compliant #1161 +/- ##
===================================================
- Coverage 88.10% 86.08% -2.02%
===================================================
Files 231 131 -100
Lines 11547 7502 -4045
===================================================
- Hits 10173 6458 -3715
+ Misses 1374 1044 -330 🚀 New features to boost your workflow:
|
1b87699
into
CppMicroServices:c++14-compliant
18 of 46 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cherry-pick of commit 5f144ee (PR #977)
additional commit to adapt for C++14 (for inline variables)
see discussion #701