Skip to content

Commit

Permalink
Merge pull request #57 from Aclardgm/master
Browse files Browse the repository at this point in the history
Add editInput on Queries to allow query reusability betweeen different request
  • Loading branch information
nmellado authored Apr 25, 2022
2 parents 78a1aca + 7b81b2b commit 7bc9d4e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Ponca/src/SpatialPartitioning/query.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ struct OUT_TYPE##PointQuery : Query<QueryInputIsPosition<DataPoint>, \
inline QueryInput(InputType input) : m_input(input) {}

inline const InputType &input() const { return m_input; }

protected:
/// \brief Edit the input
/// Need to be used carefully. Modifying a query input while iterating on the query will result in undefined behavior.
/// Simplest way to avoid this is to restart the iteration on the query.
/// Usefull to avoid query reallocation between different requests
inline void editInput(const InputType& input) { m_input = input; }

private:
/// Index of the queried point
const InputType m_input;
Expand Down

0 comments on commit 7bc9d4e

Please sign in to comment.