ros::MessageEvent< M > Class Template Reference

Event type for subscriptions, const ros::MessageEvent<M const>& can be used in your callback instead of const boost::shared_ptr<M const>&. More...

#include <message_event.h>

List of all members.

Public Types

typedef boost::add_const< M >::type ConstMessage
typedef boost::shared_ptr
< ConstMessage
ConstMessagePtr
typedef boost::function
< MessagePtr()> 
CreateFunction
typedef boost::remove_const< M >
::type 
Message
typedef boost::shared_ptr
< Message
MessagePtr

Public Member Functions

M_stringgetConnectionHeader () const
 Retrieve the connection header.
const boost::shared_ptr
< M_string > & 
getConnectionHeaderPtr () const
const boost::shared_ptr
< ConstMessage > & 
getConstMessage () const
 Retrieve a const version of the message.
boost::shared_ptr< M > getMessage () const
 Retrieve the message. If M is const, this returns a reference to it. If M is non const and this event requires it, returns a copy. Note that it caches this copy for later use, so it will only every make the copy once.
const CreateFunctiongetMessageFactory () const
bool getMessageWillCopy () const
const std::string & getPublisherName () const
 Returns the name of the node which published this message.
ros::Time getReceiptTime () const
 Returns the time at which this message was received.
void init (const ConstMessagePtr &message, const boost::shared_ptr< M_string > &connection_header, ros::Time receipt_time, bool nonconst_need_copy, const CreateFunction &create)
 MessageEvent (const ConstMessagePtr &message, const boost::shared_ptr< M_string > &connection_header, ros::Time receipt_time, bool nonconst_need_copy, const CreateFunction &create)
 MessageEvent (const ConstMessagePtr &message, ros::Time receipt_time)
 MessageEvent (const ConstMessagePtr &message, const boost::shared_ptr< M_string > &connection_header, ros::Time receipt_time)
 MessageEvent (const ConstMessagePtr &message)
 MessageEvent (const MessageEvent< void const > &rhs, const CreateFunction &create)
 MessageEvent (const MessageEvent< ConstMessage > &rhs, bool nonconst_need_copy)
 MessageEvent (const MessageEvent< Message > &rhs, bool nonconst_need_copy)
 MessageEvent (const MessageEvent< ConstMessage > &rhs)
 MessageEvent (const MessageEvent< Message > &rhs)
 MessageEvent ()
bool nonConstWillCopy () const
bool operator!= (const MessageEvent< M > &rhs)
bool operator< (const MessageEvent< M > &rhs)
void operator= (const MessageEvent< ConstMessage > &rhs)
void operator= (const MessageEvent< Message > &rhs)
bool operator== (const MessageEvent< M > &rhs)

Private Member Functions

template<typename M2 >
boost::enable_if
< boost::is_void< M2 >
, boost::shared_ptr< M >
>::type 
copyMessageIfNecessary () const
template<typename M2 >
boost::disable_if
< boost::is_void< M2 >
, boost::shared_ptr< M >
>::type 
copyMessageIfNecessary () const
template<typename T >
boost::disable_if
< boost::is_base_of
< ros::Message, T >
, boost::shared_ptr
< ros::M_string > >::type 
getConnectionHeader (T *t) const
template<typename T >
boost::enable_if
< boost::is_base_of
< ros::Message, T >
, boost::shared_ptr
< ros::M_string > >::type 
getConnectionHeader (T *t) const

Private Attributes

boost::shared_ptr< M_stringconnection_header_
CreateFunction create_
ConstMessagePtr message_
MessagePtr message_copy_
bool nonconst_need_copy_
ros::Time receipt_time_

Static Private Attributes

static const std::string s_unknown_publisher_string_

Detailed Description

template<typename M>
class ros::MessageEvent< M >

Event type for subscriptions, const ros::MessageEvent<M const>& can be used in your callback instead of const boost::shared_ptr<M const>&.

Useful if you need to retrieve meta-data about the message, such as the full connection header, or the publisher's node name

Definition at line 70 of file message_event.h.


Member Typedef Documentation

template<typename M>
typedef boost::add_const<M>::type ros::MessageEvent< M >::ConstMessage

Definition at line 73 of file message_event.h.

template<typename M>
typedef boost::shared_ptr<ConstMessage> ros::MessageEvent< M >::ConstMessagePtr

Definition at line 76 of file message_event.h.

template<typename M>
typedef boost::function<MessagePtr()> ros::MessageEvent< M >::CreateFunction

Definition at line 77 of file message_event.h.

template<typename M>
typedef boost::remove_const<M>::type ros::MessageEvent< M >::Message

Definition at line 74 of file message_event.h.

template<typename M>
typedef boost::shared_ptr<Message> ros::MessageEvent< M >::MessagePtr

Definition at line 75 of file message_event.h.


Constructor & Destructor Documentation

template<typename M>
ros::MessageEvent< M >::MessageEvent (  )  [inline]

Definition at line 79 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const MessageEvent< Message > &  rhs  )  [inline]

Definition at line 83 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const MessageEvent< ConstMessage > &  rhs  )  [inline]

Definition at line 88 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const MessageEvent< Message > &  rhs,
bool  nonconst_need_copy 
) [inline]

Definition at line 93 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const MessageEvent< ConstMessage > &  rhs,
bool  nonconst_need_copy 
) [inline]

Definition at line 99 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const MessageEvent< void const > &  rhs,
const CreateFunction create 
) [inline]

Definition at line 105 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const ConstMessagePtr message  )  [inline]
Todo:
Make this explicit in ROS 2.0. Keep as auto-converting for now to maintain backwards compatibility in some places (message_filters)

Definition at line 113 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const ConstMessagePtr message,
const boost::shared_ptr< M_string > &  connection_header,
ros::Time  receipt_time 
) [inline]

Definition at line 118 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const ConstMessagePtr message,
ros::Time  receipt_time 
) [inline]

Definition at line 123 of file message_event.h.

template<typename M>
ros::MessageEvent< M >::MessageEvent ( const ConstMessagePtr message,
const boost::shared_ptr< M_string > &  connection_header,
ros::Time  receipt_time,
bool  nonconst_need_copy,
const CreateFunction create 
) [inline]

Definition at line 128 of file message_event.h.


Member Function Documentation

template<typename M>
template<typename M2 >
boost::enable_if<boost::is_void<M2>, boost::shared_ptr<M> >::type ros::MessageEvent< M >::copyMessageIfNecessary (  )  const [inline, private]

Definition at line 236 of file message_event.h.

template<typename M>
template<typename M2 >
boost::disable_if<boost::is_void<M2>, boost::shared_ptr<M> >::type ros::MessageEvent< M >::copyMessageIfNecessary (  )  const [inline, private]

Definition at line 216 of file message_event.h.

template<typename M>
template<typename T >
boost::disable_if<boost::is_base_of<ros::Message, T>, boost::shared_ptr<ros::M_string> >::type ros::MessageEvent< M >::getConnectionHeader ( T *  t  )  const [inline, private]

Definition at line 248 of file message_event.h.

template<typename M>
template<typename T >
boost::enable_if<boost::is_base_of<ros::Message, T>, boost::shared_ptr<ros::M_string> >::type ros::MessageEvent< M >::getConnectionHeader ( T *  t  )  const [inline, private]

Definition at line 242 of file message_event.h.

template<typename M>
M_string& ros::MessageEvent< M >::getConnectionHeader (  )  const [inline]

Retrieve the connection header.

Definition at line 171 of file message_event.h.

template<typename M>
const boost::shared_ptr<M_string>& ros::MessageEvent< M >::getConnectionHeaderPtr (  )  const [inline]

Definition at line 172 of file message_event.h.

template<typename M>
const boost::shared_ptr<ConstMessage>& ros::MessageEvent< M >::getConstMessage (  )  const [inline]

Retrieve a const version of the message.

Definition at line 167 of file message_event.h.

template<typename M>
boost::shared_ptr<M> ros::MessageEvent< M >::getMessage (  )  const [inline]

Retrieve the message. If M is const, this returns a reference to it. If M is non const and this event requires it, returns a copy. Note that it caches this copy for later use, so it will only every make the copy once.

Definition at line 159 of file message_event.h.

template<typename M>
const CreateFunction& ros::MessageEvent< M >::getMessageFactory (  )  const [inline]

Definition at line 212 of file message_event.h.

template<typename M>
bool ros::MessageEvent< M >::getMessageWillCopy (  )  const [inline]

Definition at line 185 of file message_event.h.

template<typename M>
const std::string& ros::MessageEvent< M >::getPublisherName (  )  const [inline]

Returns the name of the node which published this message.

Definition at line 177 of file message_event.h.

template<typename M>
ros::Time ros::MessageEvent< M >::getReceiptTime (  )  const [inline]

Returns the time at which this message was received.

Definition at line 182 of file message_event.h.

template<typename M>
void ros::MessageEvent< M >::init ( const ConstMessagePtr message,
const boost::shared_ptr< M_string > &  connection_header,
ros::Time  receipt_time,
bool  nonconst_need_copy,
const CreateFunction create 
) [inline]

Definition at line 133 of file message_event.h.

template<typename M>
bool ros::MessageEvent< M >::nonConstWillCopy (  )  const [inline]

Definition at line 184 of file message_event.h.

template<typename M>
bool ros::MessageEvent< M >::operator!= ( const MessageEvent< M > &  rhs  )  [inline]

Definition at line 207 of file message_event.h.

template<typename M>
bool ros::MessageEvent< M >::operator< ( const MessageEvent< M > &  rhs  )  [inline]

Definition at line 187 of file message_event.h.

template<typename M>
void ros::MessageEvent< M >::operator= ( const MessageEvent< ConstMessage > &  rhs  )  [inline]

Definition at line 148 of file message_event.h.

template<typename M>
void ros::MessageEvent< M >::operator= ( const MessageEvent< Message > &  rhs  )  [inline]

Definition at line 142 of file message_event.h.

template<typename M>
bool ros::MessageEvent< M >::operator== ( const MessageEvent< M > &  rhs  )  [inline]

Definition at line 202 of file message_event.h.


Member Data Documentation

template<typename M>
boost::shared_ptr<M_string> ros::MessageEvent< M >::connection_header_ [private]

Definition at line 257 of file message_event.h.

template<typename M>
CreateFunction ros::MessageEvent< M >::create_ [private]

Definition at line 260 of file message_event.h.

template<typename M>
ConstMessagePtr ros::MessageEvent< M >::message_ [private]

Definition at line 254 of file message_event.h.

template<typename M>
MessagePtr ros::MessageEvent< M >::message_copy_ [mutable, private]

Definition at line 256 of file message_event.h.

template<typename M>
bool ros::MessageEvent< M >::nonconst_need_copy_ [private]

Definition at line 259 of file message_event.h.

template<typename M>
ros::Time ros::MessageEvent< M >::receipt_time_ [private]

Definition at line 258 of file message_event.h.

template<typename M>
const std::string ros::MessageEvent< M >::s_unknown_publisher_string_ [inline, static, private]

Definition at line 262 of file message_event.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


roscpp
Author(s): Morgan Quigley mquigley@cs.stanford.edu, Josh Faust jfaust@willowgarage.com, Brian Gerkey gerkey@willowgarage.com
autogenerated on Fri Jan 11 10:08:40 2013