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

Add a plugin mechanism to resource_retriever #103

Open
wants to merge 7 commits into
base: rolling
Choose a base branch
from

Conversation

mjcarroll
Copy link
Member

The idea behind this is to make resource_retriever pluggable. That is that downstream users of the library can choose the mechanisms that they want to back the calls to "get".

This will allow for things like retrieving over ROS services or parameters.

@mjcarroll mjcarroll requested review from wjwwood and sloretz August 16, 2024 19:54
@mjcarroll mjcarroll self-assigned this Aug 16, 2024
Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

This makes sense to me, it's the best way to avoid resource retriever from being dependent on large things like ROS, while also keeping it somewhat easy to integrate into other non-ROS projects for relatively simple things like file:/// and package:/// urls.

@ahcorde ahcorde added the ros2 label Aug 20, 2024
@mjcarroll mjcarroll marked this pull request as ready for review December 3, 2024 16:07
resource_retriever/src/plugins/curl_retriever.cpp Outdated Show resolved Hide resolved
resource_retriever/src/plugins/curl_retriever.cpp Outdated Show resolved Hide resolved
resource_retriever/src/plugins/curl_retriever.cpp Outdated Show resolved Hide resolved
resource_retriever/src/plugins/filesystem_retriever.cpp Outdated Show resolved Hide resolved
resource_retriever/src/plugins/retriever_plugin.cpp Outdated Show resolved Hide resolved
resource_retriever/src/retriever.cpp Outdated Show resolved Hide resolved
resource_retriever/test/test.cpp Show resolved Hide resolved
@wjwwood
Copy link
Member

wjwwood commented Dec 14, 2024

I fixed up the DCO and addressed review comments in 8a30432, @clalancette could you have another quick look?

mjcarroll and others added 6 commits December 17, 2024 07:56
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: William Woodall <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: William Woodall <[email protected]>
Signed-off-by: Voldivh <[email protected]>
Signed-off-by: William Woodall <[email protected]>
Signed-off-by: William Woodall <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: William Woodall <[email protected]>
Signed-off-by: William Woodall <[email protected]>
@@ -33,30 +33,18 @@
#include <memory>
#include <stdexcept>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#include <stdexcept>

/**
* \brief Get a file and store it in memory
* \param url The url to retrieve. package://package/file will be turned into the correct file:// invocation
* \return The file, loaded into memory
* \throws resource_retriever::Exception if anything goes wrong.
*/
MemoryResource get(const std::string & url);
MemoryResourcePtr get(const std::string & url);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an important change to the API, going from returning a structure to returning a shared_ptr. Given that we usually tick-tock this stuff, can we add back the old API and mark it as deprecated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants