feat(sdk): early runtime host binding for dialog + listAvailableEncodings vector helper#28
Merged
Conversation
…ings vector helper Enable plugins to query available encodings before dialog is shown by binding a minimal runtime host (registry only) early in the session lifecycle. Changes: - DataSourceSession: add bindRuntimeHostForDialog() for early binding - main_window: call bindRuntimeHostForDialog() before showing dialog - SDK: listAvailableEncodings() now returns std::vector<std::string> - SDK: listAvailableEncodingsJson() returns raw JSON for special cases - SDK: zero-dependency JSON array parser in pj_base - Tests: updated for new API
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.
Summary
Enable plugins to query available encodings before the dialog is shown by introducing a two-phase runtime host binding pattern.
Problem
The original
listAvailableEncodings()added in PR #27 was callable only afterbindRuntimeHost(), which happens AFTER the dialog closes. Plugins like MQTT/ZMQ need this information to populate their encoding combo boxes duringwidget_data().Solution: Two-Phase Binding
Phase 1 (before dialog): Bind minimal runtime host with registry access only
Phase 2 (after dialog): Complete binding with engine and dataset
Changes
DataSourceSession
bindRuntimeHostForDialog()method for early bindingmain_window.cpp
bindRuntimeHostForDialog()before showing the dialogSDK (
data_source_plugin_base.hpp)listAvailableEncodings()now returnsstd::vector<std::string>directlylistAvailableEncodingsJson()returns raw JSON for special casesTests
data_source_library_test.cppwith new test casesUsage from Plugins
Related PRs
listAvailableEncodings()to vtable