Skip to content

Add field tags#357

Draft
KrishaDeshkool wants to merge 3 commits intoeclipse-score:mainfrom
KrishaDeshkool:add_field_tags
Draft

Add field tags#357
KrishaDeshkool wants to merge 3 commits intoeclipse-score:mainfrom
KrishaDeshkool:add_field_tags

Conversation

@KrishaDeshkool
Copy link
Copy Markdown
Contributor

No description provided.

@KrishaDeshkool KrishaDeshkool force-pushed the add_field_tags branch 5 times, most recently from 64ca029 to 323edba Compare April 24, 2026 16:01
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).
Replaces the EnableGet/EnableSet/EnableNotifier bool template parameters
on ProxyField and SkeletonField with a variadic pack of tags (WithGetter,
WithSetter) declared in field_tags.h. Presence of a tag enables the
matching API. The notifier surface stays unconditional on both sides,
since a field without a notifier cannot propagate value changes.

Also updates friend/forward declarations in ProxyEvent, ProxyMethod,
SkeletonEvent and SkeletonMethod, the Trait::Field aliases plus the
traits example doc, and the skeleton_field_test.cpp call sites.
@KrishaDeshkool
Copy link
Copy Markdown
Contributor Author

Once the CI is green, i will make this PR open and can we reviewed.

@KrishaDeshkool KrishaDeshkool marked this pull request as ready for review April 27, 2026 09:40
@KrishaDeshkool KrishaDeshkool marked this pull request as draft April 28, 2026 07:34
template <bool ES = EnableSet, typename std::enable_if<ES, int>::type = 0, typename CallableType>
/// Registers a handler invoked when a proxy issues the field setter.
/// The handler receives the proxy-requested value by reference and may modify it in-place;
/// the (possibly modified) value is then broadcast via Update().
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.

See teams-chat:

the (possibly modified) value is then broadcast via Update().

-> the (possibly modified) value is then stored as the "latest value" via call to SkeletonField::Update().

IsSetHandlerRegisteredType is_set_handler_registered_{};

// EnableSet=true: checks the flag; EnableSet=false: no setter, no handler required.
bool IsSetHandlerRegistered() const noexcept override
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.

SFINAE out if no WithSetter tag exists. -> RegisterSetHandler()

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.

2 participants