Skip to content

manual port of unique ptr pr - #58

Merged
mikaelarguedas merged 5 commits into
ros2from
port_pr38
Oct 31, 2017
Merged

mikaelarguedas merged 5 commits into
ros2from
port_pr38

Conversation

@wjwwood

@wjwwood wjwwood commented Oct 26, 2017 •

Copy link
Copy Markdown
Member

manual port of #38

This was painful 😄. I think class_loader needs to be brought closer to the ROS 1 version as I've been trying to do with pluginlib, but for now this lets me move forward.

@wjwwood wjwwood self-assigned this Oct 26, 2017
@wjwwood wjwwood changed the title manual port of https://github.com/ros/class_loader/pull/38 manual port of unique ptr pr Oct 26, 2017
@wjwwood

wjwwood commented Oct 26, 2017

Copy link
Copy Markdown
Member Author

Travis is failing due to poco not building with an error about the c++14 flag. I'll run ci.ros2.org CI instead.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@wjwwood

wjwwood commented Oct 27, 2017

Copy link
Copy Markdown
Member Author

Finally figured out the issue on Windows (I think).

@wjwwood

wjwwood commented Oct 27, 2017

Copy link
Copy Markdown
Member Author
  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@wjwwood

wjwwood commented Oct 28, 2017

Copy link
Copy Markdown
Member Author

@mikaelarguedas I still don't know about the travis ci, but the other CI is green. Can you re-review?

@mikaelarguedas

Copy link
Copy Markdown
Member

Yep will do, not sure I'll have time to look at it today though.

I still don't know about the travis ci

Yeah it appeared on other PRs too (some discussion here), I didnt have time to look into it but it's not due to this change 👍

@mikaelarguedas mikaelarguedas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @wjwwood for the painful port! (I feel you), I may have one or two comments so I'll wait until tomorrow to finish reviewing and merging.

return *i;
}
}
return nullptr;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks like sometime you use NULL to match the ROS1 version and sometimes nullptr. Any reason this ones uses another one than the one from upstream?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's just habit (to use nullptr). It's better to use than NULL, but also C++11 only:

http://en.cppreference.com/w/cpp/language/nullptr

I'll replace this with NULL for now, so it's closer to the ROS 1 style.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I left two which are within a c++11 block and so they can use nullptr safely.

@mikaelarguedas mikaelarguedas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @wjwwood for iterating. Change looks good to me, I have one question inline about some mismatch in documentation.
I don't mind fixing the nitpicks myself

* @param derived_class_name The name of the class we want to create (@see getAvailableClasses())
* It is not necessary for the user to call loadLibrary() as it will be
* invoked automatically if the library is not yet loaded (which typically
* happens when in "On Demand Load/Unload" mode).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looking at the upstream PR, some comment content has not been propagated:

     * Creating an unmanaged instance disables dynamically unloading libraries when
     * managed pointers go out of scope for all class loaders in this process.

}

/**
* @brief Creates an instance of an object of given class name with ancestor class Base

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: all other functions in this PR have the brief outside of the commented block with ///

Comment thread include/class_loader/class_loader.h Outdated
/**
* It is not necessary for the user to call loadLibrary() as it will be
* invoked automatically.
* If the library is not yet loaded (which typically happens when in

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: I think this is the continuation of the previous sentence and not a new one (same below)

Comment thread include/class_loader/class_loader.h Outdated
/**
* It is not necessary for the user to call loadLibrary() as it will be
* invoked automatically.
* if the library is not yet loaded (which typically happens when in

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: I think this is the continuation of the previous sentence and not a new one

@wjwwood

wjwwood commented Oct 31, 2017

Copy link
Copy Markdown
Member Author

No worries, I think I addressed all the nitpicks.

@mikaelarguedas

Copy link
Copy Markdown
Member

No worries, I think I addressed all the nitpicks.

👍 looks good to me, merging

@mikaelarguedas
mikaelarguedas merged commit adcb526 into ros2 Oct 31, 2017
@mikaelarguedas
mikaelarguedas deleted the port_pr38 branch October 31, 2017 23:05
@mikaelarguedas

Copy link
Copy Markdown
Member

@wjwwood FYI: Big oversight on my side, I mostly compared the changes to the ported ROS1 PR but didnt take into account the ROS2 context. This new test require both catkin and boost so we will need to change this to get them to run in ROS2.
But first we'll need to reenable previous tests and make them pass before focusing on this one.
I'll track this on #59

@wjwwood

wjwwood commented Nov 2, 2017

Copy link
Copy Markdown
Member Author

Oops, my bad too. I didn't even think about it after it compiled and ran some tests which passed :/

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.

2 participants