Skip to content

MINIFICPP-2805 Move reinterpret casts into functions in minifi-c.cpp#2211

Open
martinzink wants to merge 2 commits into
apache:mainfrom
martinzink:MINIFICPP-2805
Open

MINIFICPP-2805 Move reinterpret casts into functions in minifi-c.cpp#2211
martinzink wants to merge 2 commits into
apache:mainfrom
martinzink:MINIFICPP-2805

Conversation

@martinzink

Copy link
Copy Markdown
Member

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:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.h with shared helpers for string conversion and generic toC / toCpp casts between opaque C handles and C++ types.
  • Updates libminifi/src/minifi-api.cpp to use the new helpers instead of ad-hoc reinterpret_cast and local conversion functions.
  • Updates CProcessor and CControllerService wrappers 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.

Comment thread libminifi/include/utils/minifi-api-utils.h
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants