mw::com: Migrate from boolean enablers to struct Tags to enable Get/Set/Notify functionality in Fields.#357
Open
KrishaDeshkool wants to merge 10 commits into
Open
Conversation
323edba to
278adac
Compare
278adac to
c034c1e
Compare
Contributor
Author
|
Once the CI is green, i will make this PR open and can we reviewed. |
c034c1e to
894a5e7
Compare
crimson11
requested changes
Apr 28, 2026
e47f755 to
a4a564f
Compare
KrishaDeshkool
commented
May 4, 2026
ef8184e to
1b49db2
Compare
37b7cfc to
f51bb37
Compare
3f3d680 to
55b6611
Compare
55b6611 to
74a1445
Compare
The new order allows us to set the bindings to nullptrs by default for test only constructors. This will be useful for fields which will require optionally inserting get / set bindings. We change all constructors so that they're all consistent.
- Use a single test constructor which creates the get / set methods according to the provided bindings. This allows us to remove the test-only constructor overloads for each template arg combination. - Always store the get / set method dispatches as unique_ptrs even if they're not enabled (when disabled, they'll simply be nullptrs). This allows us to have a single private constructor which always accepts unique_ptrs (which may be valid or nullptrs).
…nitions Introduce field_tags.h with tag structs (WithGetter, WithSetter, WithNotifier) and the contains_type / is_tag_enabled SFINAE utilities. Re-export the tags through types.h and wire the BUILD dependency.
Change forward and friend declarations of ProxyField and SkeletonField from fixed bool parameters to variadic typename... packs. Replaces the eight explicit ProxyField friend specializations with a single template friend.
Replace the fixed bool EnableSet/EnableNotifier template parameters with a variadic Tags... pack. WithGetter, WithSetter, WithNotifier tag structs control which API is enabled/disabled via SFINAE.
Adapt all test interfaces, test fixtures, and integration helpers to use the new WithGetter/WithSetter/WithNotifier tag syntax instead of bare ProxyField<T> or SkeletonField<T, bool, bool>.
Add field_tags_test.cpp for is_tag_enabled and contains_type traits. Extend proxy_field_test.cpp to verify that notifier methods are only callable with WithNotifier, Get() with WithGetter, Set() with WithSetter.
…sent Remove the ASSERT_PRD that required proxy_event_base_dispatch to be non-null. When the field's tag pack does not include WithNotifier the production ctor passes nullptr for the event dispatch, which is valid because the notifier surface is SFINAE-removed.
SkeletonField became SkeletonField<T, Tags...> in the tag introduction commit. NamedSkeletonFieldMock must carry the same Tags... so that InjectFieldMock can dynamic_cast to the correct specialisation.
74a1445 to
1e212fe
Compare
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.
No description provided.