Skip to content

Commit

Permalink
ros::MessageEvent no longer reads __connection_header from ROS message
Browse files Browse the repository at this point in the history
  • Loading branch information
kwatts committed Jan 29, 2014
1 parent daed0ca commit 2de340b
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions roscpp_traits/include/ros/message_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class MessageEvent
*/
MessageEvent(const ConstMessagePtr& message)
{
init(message, getConnectionHeader(message.get()), ros::Time::now(), true, ros::DefaultMessageCreator<Message>());
init(message, boost::shared_ptr<M_string>(), ros::Time::now(), true, ros::DefaultMessageCreator<Message>());
}

MessageEvent(const ConstMessagePtr& message, const boost::shared_ptr<M_string>& connection_header, ros::Time receipt_time)
Expand All @@ -121,7 +121,7 @@ class MessageEvent

MessageEvent(const ConstMessagePtr& message, ros::Time receipt_time)
{
init(message, getConnectionHeader(message.get()), receipt_time, true, ros::DefaultMessageCreator<Message>());
init(message, boost::shared_ptr<M_string>(), receipt_time, true, ros::DefaultMessageCreator<Message>());
}

MessageEvent(const ConstMessagePtr& message, const boost::shared_ptr<M_string>& connection_header, ros::Time receipt_time, bool nonconst_need_copy, const CreateFunction& create)
Expand Down Expand Up @@ -237,21 +237,6 @@ class MessageEvent
return boost::const_pointer_cast<Message>(message_);
}

template<typename T>
boost::shared_ptr<ros::M_string>
getConnectionHeader(T* t, typename boost::enable_if<ros::message_traits::IsMessage<T> >::type*_ = 0) const
{
return t->__connection_header;
}

template<typename T>
boost::shared_ptr<ros::M_string>
getConnectionHeader(T* t, typename boost::disable_if<ros::message_traits::IsMessage<T> >::type*_ = 0) const
{
return boost::shared_ptr<ros::M_string>();
}


ConstMessagePtr message_;
// Kind of ugly to make this mutable, but it means we can pass a const MessageEvent to a callback and not worry about other things being modified
mutable MessagePtr message_copy_;
Expand Down

0 comments on commit 2de340b

Please sign in to comment.