Add C++20 concepts for frame type interfaces #43
+461
−0
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.
Description
Adds C++20 concepts defining common interfaces across frame types, enabling compile-time type checking and generic programming with detector data structures.
Implementation
Core concepts (12 total organized by category):
HasADC(single-sample),HasADCSample(TDE16Frame interface),HasChannelData(WIBFrame channel-based),HasMultiSampleADC(WIBEthFrame multi-sample)HasTimestamp,HasChannel,HasHeaderIsFrame(timestamp + any data access),IsCompleteFrame(adds channel ID)BinaryCompatible,FrameHeader,WordBased,ADCDataDesign decisions:
IsFramevia its specific data access patternUsage example:
Type of change
Testing checklist
dbt-build --unittest)pytest -s minimal_system_quick_test.py)daqsystemtest_integtest_bundle.sh)python -m pytest)pre-commit run --all-files)Comprehensive unit tests added in
Concepts_test.cxxverifying all concepts against all frame types. Concepts verified to compile with g++ 13.3.0 and C++20.Further checks
dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)All concepts documented with usage examples in
docs/README.md.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.