-
Notifications
You must be signed in to change notification settings - Fork 15
Form redesign backend technology #816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gemmeren
merged 11 commits into
Framework-R-D:main
from
wwuoneway:form-redesign-backend-technology
Aug 14, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
802e307
redesign the technology for backends and move it from form/ to core/
wwuoneway 85c489a
redesign technology: replace packed-int encoding with typed form::tec…
wwuoneway e8e4d1a
form: replace packed-int technolgy with typed technology::Id (major/m…
wwuoneway 72b0377
add test to increase coverage and throw 'Technology 'HDF5' is recogni…
wwuoneway bd3fe1c
address codecov and clang-tidy fails
wwuoneway 0fa6d48
redesign factories.hpp: move from form/util to form/storage and split…
wwuoneway cf7de50
applying clang-format
wwuoneway 5258b5e
FORM: throw on unavailable/unknown storage technologies instead of si…
wwuoneway 2bf48d5
applied cmake format
wwuoneway 7e977f5
renaming 'unknown' to 'generic' and clean up 'int' in enum as it's th…
wwuoneway f1299a8
add tests for recognized ROOT major but unsupported minor
wwuoneway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #ifndef FORM_CORE_TECHNOLOGY_HPP | ||
| #define FORM_CORE_TECHNOLOGY_HPP | ||
|
|
||
| #include <compare> | ||
| #include <stdexcept> | ||
| #include <string> | ||
| #include <string_view> | ||
|
|
||
| /* A storage technology, identified by a (major, minor) pair */ | ||
|
|
||
| namespace form::technology { | ||
|
|
||
| // Major storage type (ROOT, HDF5, ...) | ||
| enum class Major { | ||
| generic = 0, // no specific technology requested | ||
| root = 1, | ||
| hdf5 = 2, | ||
| }; | ||
|
|
||
| // Minor variant within a Major (e.g. TTree vs RNTuple within ROOT) | ||
| struct Id { | ||
| Major major{Major::generic}; | ||
| int minor{0}; | ||
|
|
||
| // Exact ordering over (major, minor): lets an Id be a std::map key and drives backend dispatch | ||
| constexpr auto operator<=>(Id const&) const = default; | ||
| }; | ||
|
|
||
| // Backends: valid (major, minor) pairs, stable numeric values as a future Token may persist them | ||
| inline constexpr Id ROOT_TTREE{Major::root, 1}; | ||
| inline constexpr Id ROOT_RNTUPLE{Major::root, 2}; | ||
| inline constexpr Id HDF5{Major::hdf5, 1}; | ||
|
wwuoneway marked this conversation as resolved.
|
||
|
|
||
| // Canonical string -> technology mapping: the single place a technology string is parsed, replacing the copies that used to live in each module/source/test | ||
| inline Id from_string(std::string_view name) | ||
| { | ||
| if (name == "ROOT_TTREE") { | ||
| return ROOT_TTREE; | ||
| } | ||
| if (name == "ROOT_RNTUPLE") { | ||
| return ROOT_RNTUPLE; | ||
| } | ||
| if (name == "HDF5") { | ||
| // HDF5 is a reserved technology but has no backend yet: reject it at parse time | ||
| throw std::runtime_error("Technology 'HDF5' is recognized but not yet implemented"); | ||
| } | ||
| throw std::runtime_error("Unknown technology: " + std::string(name)); | ||
| } | ||
|
|
||
| // Canonical technology -> string mapping | ||
| inline std::string to_string(Id tech) | ||
| { | ||
| if (tech == ROOT_TTREE) { | ||
| return "ROOT_TTREE"; | ||
| } | ||
| if (tech == ROOT_RNTUPLE) { | ||
| return "ROOT_RNTUPLE"; | ||
| } | ||
| if (tech == HDF5) { | ||
| return "HDF5"; | ||
| } | ||
| return "UNKNOWN"; | ||
| } | ||
|
|
||
| } // namespace form::technology | ||
|
|
||
| #endif // FORM_CORE_TECHNOLOGY_HPP | ||
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.