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

Make attach_indices work for both primitives and predicates #1036

Merged
merged 6 commits into from
Feb 13, 2024

Conversation

aprokop
Copy link
Contributor

@aprokop aprokop commented Feb 7, 2024

Right now, attach_indices only works for primitives. For predicates, there is no convenient way to attach indices to predicates. The attach only works on a single predicate and not limited to indices.

Attaching indices to primitives and predicates result in different types and access methods. Primitives result in PairValueIndex<Value, Index>, while predicates result in an unspecified type that the index can be accessed by getData().

I'm not sure how how much of a problem returning different types is. The function serves the same role for both primitives and predicates: conveniently adjust passed in data in some easy way for the hierarchy. Both types should really be undefined. The difference is that in the first case the argument appears in the hierarchy template specialization.

The two types should be different, though. The predicate attachment inherits from the predicate and may provide distance() function; the access to the data is also done on the user side, thus getData() function. The primitive attachment is a simple storage and will only be used internally.

@aprokop aprokop added the refactoring Code reorganization label Feb 7, 2024
@aprokop aprokop requested a review from dalg24 February 7, 2024 17:13
@aprokop aprokop added the API User visible interface modifications label Feb 7, 2024
Copy link
Contributor

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

Please do provide a description.

Discuss whether you think that it is a problem that

  • when attaching indices to primitives, one get PairValueIndex and access the index via the named data member, while
  • when attaching indices to predicates, one get an unspecified type and access the index via getData

test/tstAttachIndices.cpp Outdated Show resolved Hide resolved
test/tstAttachIndices.cpp Show resolved Hide resolved
test/tstCompileOnlyAccessTraits.cpp Show resolved Hide resolved
@aprokop
Copy link
Contributor Author

aprokop commented Feb 13, 2024

@dalg24 Do you still have concerns about this PR, or can we proceed as is?

@aprokop aprokop merged commit ef95952 into arborx:master Feb 13, 2024
2 checks passed
@aprokop aprokop deleted the attach_indices branch February 13, 2024 20:35
@aprokop aprokop mentioned this pull request Feb 14, 2024
@aprokop aprokop mentioned this pull request Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API User visible interface modifications refactoring Code reorganization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants