add a publish method with the const MessageT * signature (#307)

This commit is contained in:
William Woodall 2017-02-27 18:48:01 -08:00 committed by GitHub
parent dc6b15983a
commit ce146cfdba
2 changed files with 18 additions and 0 deletions

View file

@ -125,6 +125,15 @@ public:
rclcpp::publisher::Publisher<MessageT, Alloc>::publish(msg);
}
virtual void
publish(const MessageT * msg)
{
if (!msg) {
throw std::runtime_error("msg argument is nullptr");
}
this->publish(*msg);
}
/// LifecyclePublisher pulish function
/**
* The publish function checks whether the communication