open Node/Publisher API for allowing inheritance#258
Conversation
Isn't it more accurate to say that the |
|
You're absolutely right. Corrected. |
| typename rclcpp::publisher::Publisher<MessageT, Alloc>::SharedPtr | ||
| template<typename MessageT, typename Alloc = std::allocator<void>, | ||
| typename PublisherT = ::rclcpp::publisher::Publisher<MessageT, Alloc>> | ||
| std::shared_ptr<PublisherT> |
There was a problem hiding this comment.
I slightly different indentation would be nice. Not sure what our linters will be happy with, maybe:
template<
typename MessageT, typename Alloc = std::allocator<void>,
typename PublisherT = ::rclcpp::publisher::Publisher<MessageT, Alloc>>
std::shared_ptr<PublisherT>
3d1f383 to
783169f
Compare
|
updated |
|
build succesful http://ci.ros2.org/job/ci_linux/1873/ |
|
Probably we should open service client API also for inheritance? I'm specifically interested in marking async_send_request call as virtual. Note: What's I have in mind is for the unit testing purposes. (Mocking) Correct me if it is wrong way to handle things. |
* (dev) template create_publisher with publisher type * (dev) template publisher type for dynamic publisher type instantiation * (dev) make Publisher::publish function virtual * (fix) uncrustify * different indentation of long template declaration
|
@AravindaDP sorry it took so long to get back to you on this. If you'd like to see additional methods marked virtual, or a function refactored to take one of the arguments as a template, please just open a pr to that effect or open an issue for each case so we can evaluate them there. |
|
@wjwwood no worries. Actually I wasn't sure about the correct place I should open the discussion. |
* Treat __name the same as __node This modifies the lexer so that it will accept __name and treat it exactly the same as __node. __node still works in order to preserve backwards compatibility. Fixes ros2#258 Distribution Statement A; OPSEC ros2#2893 Signed-off-by: P. J. Reed <preed@swri.org> * Update dot graph for lexer Distribution Statement A; OPSEC ros2#2893 Signed-off-by: P. J. Reed <preed@swri.org>
* Add a SequentialCompressionReader Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> Co-authored-by: Zachary Michaels <zmichaels11@users.noreply.github.com>
change:
Node::create_publisherfunction has a new template parameter for publisher type (rclcpp::publisher::Publisherby default)publishfunctions are virtual for being able to inherit from