Add missing CommonRulesPropertyClient C++ implementation #31
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.
Add CommonRulesPropertyClient C++ Implementation
This PR ports the missing
CommonRulesPropertyClientclass from the Kotlin implementation to C++ and fixes the uninitializedproperty_rules_member inPropertyClientFacade.Changes Made
New Files Created
include/midi-ci/properties/PropertyCommonRules.hpp- Constants and structures for MIDI-CI property handlinginclude/midi-ci/properties/CommonRulesPropertyHelper.hpp- Helper class for JSON header creation and parsinginclude/midi-ci/properties/CommonRulesPropertyClient.hpp- Main client class implementing MidiCIClientPropertyRules interfacesrc/midi-ci/properties/CommonRulesPropertyHelper.cpp- Implementation of helper functionalitysrc/midi-ci/properties/CommonRulesPropertyClient.cpp- Implementation of the property clientModified Files
src/midi-ci/properties/PropertyClientFacade.cpp- Initialize property_rules_ with CommonRulesPropertyClientsrc/CMakeLists.txt- Added new source and header files to build systemsrc/midi-ci/messages/Message.cpp- Fixed JSON serialization bug affecting property testsImplementation Details
The C++ implementation closely mirrors the Kotlin version's structure and functionality:
MidiCIClientPropertyRulesinterface with all 8 required virtual methodsThe implementation uses existing C++ JSON utilities and follows modern C++ conventions with smart pointers and RAII principles.
Bug Fixes
Fixed a JSON serialization bug in
Message.cppwhereget_serialized_bytes()was double-escaping JSON strings. This was causing property JSON serialization tests to fail.Testing
Verification
The
PropertyClientFacadenow properly initializes theproperty_rules_member with a workingCommonRulesPropertyClientimplementation, resolving the core issue described in the task.Link to Devin run: https://app.devin.ai/sessions/b6c66f486eb14a8890d611d305e3f787
Requested by: Atsushi Eno (atsushieno@gmail.com)