MINIFICPP-2805 Move reinterpret casts into functions in minifi-c.cpp#2211
Open
martinzink wants to merge 2 commits into
Open
MINIFICPP-2805 Move reinterpret casts into functions in minifi-c.cpp#2211martinzink wants to merge 2 commits into
martinzink wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the MiNiFi C API bridge layer by centralizing C↔C++ reinterpret-casts and string-view conversions into a shared utility header, reducing repetition and making the API boundary code easier to audit and maintain.
Changes:
- Introduces
utils/minifi-api-utils.hwith shared helpers for string conversion and generictoC/toCppcasts between opaque C handles and C++ types. - Updates
libminifi/src/minifi-api.cppto use the new helpers instead of ad-hocreinterpret_castand local conversion functions. - Updates
CProcessorandCControllerServicewrappers to use the shared helpers for logger and context/session casting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| libminifi/src/minifi-api.cpp | Replaces local string helpers and repeated reinterpret_cast usage with centralized utility helpers. |
| libminifi/include/utils/minifi-api-utils.h | Adds shared conversion utilities and type mapping for opaque C API handles. |
| libminifi/include/utils/CProcessor.h | Switches C API callback argument casting and metadata packing to use the new helpers. |
| libminifi/include/utils/CControllerService.h | Switches C API callback argument casting and metadata packing to use the new helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically main)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.