New IntraProcessManager capable of storing shared_ptr<const T> (#690)
* Changed mapped_ring_buffer class to store both shared_ptr or unique_ptr Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Changed the IPM store and take methods Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Changed publish methods to take advantage of the new IPM Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Change how subscriptions handle intraprocess messages Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Modified publish method signatures Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Renamed 'publisher.cpp' and 'subscription.cpp' to 'publisher_base.cpp' and 'subscription_base.cpp' Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Updated lifecycle_publisher publish methods Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
This commit is contained in:
parent
d34fa607a2
commit
98f610c114
18 changed files with 1115 additions and 787 deletions
|
@ -97,7 +97,7 @@ public:
|
|||
* to the actual rclcpp Publisher base class
|
||||
*/
|
||||
virtual void
|
||||
publish(const std::shared_ptr<MessageT> & msg)
|
||||
publish(const std::shared_ptr<const MessageT> & msg)
|
||||
{
|
||||
if (!enabled_) {
|
||||
RCLCPP_WARN(logger_,
|
||||
|
@ -106,26 +106,7 @@ public:
|
|||
|
||||
return;
|
||||
}
|
||||
rclcpp::Publisher<MessageT, Alloc>::publish(msg);
|
||||
}
|
||||
|
||||
/// LifecyclePublisher publish function
|
||||
/**
|
||||
* The publish function checks whether the communication
|
||||
* was enabled or disabled and forwards the message
|
||||
* to the actual rclcpp Publisher base class
|
||||
*/
|
||||
virtual void
|
||||
publish(std::shared_ptr<const MessageT> msg)
|
||||
{
|
||||
if (!enabled_) {
|
||||
RCLCPP_WARN(logger_,
|
||||
"Trying to publish message on the topic '%s', but the publisher is not activated",
|
||||
this->get_topic_name());
|
||||
|
||||
return;
|
||||
}
|
||||
rclcpp::Publisher<MessageT, Alloc>::publish(msg);
|
||||
rclcpp::Publisher<MessageT, Alloc>::publish(*msg);
|
||||
}
|
||||
|
||||
/// LifecyclePublisher publish function
|
||||
|
@ -156,25 +137,6 @@ public:
|
|||
this->publish(*msg);
|
||||
}
|
||||
|
||||
/// LifecyclePublisher publish function
|
||||
/**
|
||||
* The publish function checks whether the communication
|
||||
* was enabled or disabled and forwards the message
|
||||
* to the actual rclcpp Publisher base class
|
||||
*/
|
||||
virtual void
|
||||
publish(std::shared_ptr<const MessageT> & msg)
|
||||
{
|
||||
if (!enabled_) {
|
||||
RCLCPP_WARN(logger_,
|
||||
"Trying to publish message on the topic '%s', but the publisher is not activated",
|
||||
this->get_topic_name());
|
||||
|
||||
return;
|
||||
}
|
||||
rclcpp::Publisher<MessageT, Alloc>::publish(msg);
|
||||
}
|
||||
|
||||
virtual void
|
||||
on_activate()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue