Un-overload `smtk::resource::Resource::find()`

Problem statement

There are currently 2 signatures for finding components in a resource:

class Resource
{
public:
    std::shared_ptr<Component> find(const smtk::common::UUID& id);
    std::set<std::shared_ptr<Component>> find(const std::string& query);
};

This is causing problems with python wrapping because pybind11 cannot be configured to provide both overloads (UUIDs can be constructed from strings, so the first signature always matches as far as python is concerned).

Proposal

  1. If we rename the second signature (that takes a query string and returns a set of components) from find() to filter() this problem is resolved.
  2. We should also rename the templated findAs(const std::string& query) to filterAs() for consistency.
  • Accept proposal.
  • Reject proposal.
  • Alternative suggested in discussion below.

0 voters