Skip to content

mw/com: Make ProxyBase::AreBindingsValid symmetrical with Skeleton side#414

Open
bemerybmw wants to merge 2 commits into
mainfrom
brem_fix_event_registration_impl
Open

mw/com: Make ProxyBase::AreBindingsValid symmetrical with Skeleton side#414
bemerybmw wants to merge 2 commits into
mainfrom
brem_fix_event_registration_impl

Conversation

@bemerybmw
Copy link
Copy Markdown
Contributor

Previously, ProxyBase::AreBindingsValid was implemented differently to avoid have to store a map of service elements (which also requires updating the map when moving a Proxy) in ProxyBase. However, we have since added these maps so there's no longer any reason to have the asymmetry in the implementations of AreBindingsValid.

@bemerybmw bemerybmw marked this pull request as ready for review May 13, 2026 08:21
@KrishaDeshkool
Copy link
Copy Markdown
Contributor

The removal of EventBindingRegistrationGuard would happen later?
other than the changes are fine as we discussed.

@bemerybmw
Copy link
Copy Markdown
Contributor Author

The removal of EventBindingRegistrationGuard would happen later? other than the changes are fine as we discussed.

Yep, that's happening in the next change that I'm working on.

@bemerybmw bemerybmw enabled auto-merge May 13, 2026 09:37
bemerybmw added 2 commits May 13, 2026 15:37
Previously, ProxyBase::AreBindingsValid was implemented differently to
avoid have to store a map of service elements (which also requires
updating the map when moving a Proxy) in ProxyBase. However, we have
since added these maps so there's no longer any reason to have the
asymmetry in the implementations of AreBindingsValid.
Previously, the event binding was registered from the binding
independent level via a function in the bindings interface. We change
this so that the registration is done completely on the binding level to
simplify the interface and also to allow each binding to decide whether
it needs to register events with the parent proxy. This is now inline
with how we handle registration for methods.

This also fixes an issue that the EventRegistrationGuard was accessing
the Proxy binding from the context of a ProxyEvent's destructor. When
move assigning a skeleton, the ProxyBase move assignment operator will
be called before that of the ProxyEvent, so the pointer to the Proxy
binding would be invalid when calling UnregisterEventBinding.
@bemerybmw bemerybmw force-pushed the brem_fix_event_registration_impl branch from fe22c01 to d496d88 Compare May 13, 2026 13:37
Instead, they only set once (see above) the `ProxyBase::are_service_element_bindings_valid_` member variable of their
parent during construction as this is currently the only feedback needed between proxy and its proxy events on binding
independent level.
Similarly to the skeleton side, the `impl::SkeletonBase` doesn't "know" its event/field/method children. Therefore,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impl::SkeletonBase

impl::ProxyBase


#### Binding level Registration of proxy events/fields at their parent proxy

On the binding **specific** level things look different!
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this sentence now make sense anymore? So there is no difference between binding-specific/binding-unspecific level anymore? In both cases the proxy knows its childs, because on both levels this registration process takes place ...


// Expecting that StartFindService is called and synchronously calls handler since provider exists
EXPECT_CALL(service_discovery_mock_, StartFindService(_, EnrichedInstanceIdentifier{identifier_}))
.WillOnce(WithArg<0>(Invoke([valid_find_service_handle, this](auto find_service_handler) noexcept {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicky:

.WillOnce(InvokeArgument<0>([valid_find_service_handle, this](auto find_service_handler) noexcept {
is a lot clearer ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants