Repository navigation
feat(fl): bidirectional fromFled factories on Video / ScreenMap / MultiChannelConfig (#3311 PR4) - #3328
Conversation
…tiChannelConfig (#3311 PR4) PR4 of #3311. Adds the per-type fromFled static factories on the three section types that fled produces, so call sites can spell either: auto v = fled.video(); // fled-side auto v = fl::Video::fromFled(fled); // type-side interchangeably - same data, same return type, same null/empty contract. Each factory is a one-line forwarder defined in fl/fled/fled.cpp.hpp (the canonical fled TU). The declarations live in the host headers (fl/fx/video.h, fl/math/screenmap.h, fl/channels/config.h) with only a forward decl of fl::Fled, so callers don't pay an extra include cost. Tree-shake: linker resolves the static methods to fled.cpp.hpp's TU, which is only pulled into builds that already reference the Fled subsystem - sketches that don't use fled see zero size cost. Video::fromFled and MultiChannelConfig::fromFled return nullptr today because Fled::video() and Fled::channels() are themselves stubs in PR2; they'll start returning real objects when those accessors are filled in (separate scopes). ScreenMap::fromFled works today because PR2 has the real screenMap() body. Tests: 3 cases in tests/fl/fled/fled_from_fled.cpp - null Fled returns null for all three, empty bundle returns null for all three, factory returns the same pointer as the matching accessor. Refs #3311 (this is the fourth of seven planned PRs) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds bidirectional ChangesBidirectional fromFled() factory API
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
PR4 of #3311. Adds the per-type
fromFledstatic factories on the three section types thatfl::Fledproduces, so call sites can spell either:interchangeably — same data, same return type, same null/empty contract.
Tree-shake
Each factory is a one-line forwarder defined in
src/fl/fled/fled.cpp.hpp(the canonical fled TU). The declarations live in the host headers with only a forward decl offl::Fled, so callers don't pay an extra include cost. The linker resolves the static methods tofled.cpp.hpp's TU, which is only pulled in when something already references the Fled subsystem — sketches that don't use fled see zero size cost.Stub state today
ScreenMap::fromFledreturns a realScreenMap(because PR2'sFled::screenMap()is implemented).Video::fromFledandMultiChannelConfig::fromFledreturn nullptr (because the matchingFled::video()andFled::channels()are themselves stubs in PR2; they'll start returning real objects when those accessors are filled in).Files changed
src/fl/fx/video.h— fwd decl +static fromFleddeclarationsrc/fl/math/screenmap.h— fwd decl +static fromFleddeclarationsrc/fl/channels/config.h— fwd decl +static fromFleddeclaration onMultiChannelConfigsrc/fl/fled/fled.cpp.hpp— three one-line bodiestests/fl/fled/fled_from_fled.cpp— new, 3 casesTest plan
bash test fled --debug— greenbash lint --cpp— greenRefs #3311
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests