Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessors use more inheritance #358

Merged
merged 3 commits into from
Sep 11, 2023

Conversation

mtao
Copy link
Collaborator

@mtao mtao commented Sep 10, 2023

Isolated the implementations of different sorts of accessor functions to increase clarity and utilize inheritance so non-const accessors can be implicitly converted to const accessors.

  • AccessorBase does raw writing into attributes
  • CachingAccessor utilizes attributes' caching abilities when available
  • TupleAccessor disables index-based access and implements tuple-based access
  • ConstAccessor enables const tuple-based access
  • MutableAccessor enables const and non-const tuple-based access

Accessor<T,IsConst> now is a typedef for ConstAccessor or MutableAccessor depending on IsConst

Also, added protectedmember functions to let accessor friends cast to lower level accessors when necessary. These should be easy to identify / avoided in general code

@mtao mtao mentioned this pull request Sep 10, 2023
@mtao mtao linked an issue Sep 10, 2023 that may be closed by this pull request
@mtao mtao merged commit 5d82826 into wildmeshing:hackathon/dev Sep 11, 2023
6 checks passed
@mtao mtao deleted the mtao/accessor_inheritance branch September 11, 2023 04:03
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.

Accessor Inheritance
1 participant