mw:com: Clean up Field impl#496
Open
KrishaDeshkool wants to merge 20 commits into
Open
Conversation
e9f557d to
ae56c92
Compare
f63201a to
5e300ec
Compare
610b3dd to
86a56d4
Compare
6406140 to
7832839
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.
method_identifier.h defines a UniqueMethodIdentifier that is not referenced by any production code. the binding dependant layer uses its own UniqueMethodIdentifier. removing a spillover from previous work.
Add a ServiceElementType parameter to ProxyEventBindingFactory::Create to avoid code duplication
0d8af99 to
c8ecc76
Compare
split LookupLolaProxyElement into two free functions in bindings/lola and rework all the callers
refactor to reduce code duplication with generic helper methods and also, SetupMethods hardcoded kUseGetIfAvailable/kUseSetIfAvailable to true and ignored the parsed useGetIfAvailable/useSetIfAvailable deployment config.
The proxy method test helper now takes a MethodType per registered entry instead of always kMethod, so field Get and Set methods can be registered too. Existing method call sites pass MethodType::kMethod.
covers field Get/Set handling in Proxy::SetupMethods
c8ecc76 to
2ac0d68
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.
Depends on: #357
Depends on: #534