Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
roswrap::MessageEvent< M > Class Template Reference

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

#include <message_event.h>

Public Types

typedef std::add_const< M >::type ConstMessage
 
typedef std::shared_ptr< ConstMessageConstMessagePtr
 
typedef std::function< MessagePtr()> CreateFunction
 
typedef std::remove_const< M >::type Message
 
typedef std::shared_ptr< MessageMessagePtr
 

Public Member Functions

M_stringgetConnectionHeader () const
 Retrieve the connection header. More...
 
const std::shared_ptr< M_string > & getConnectionHeaderPtr () const
 
const std::shared_ptr< ConstMessage > & getConstMessage () const
 Retrieve a const version of the message. More...
 
std::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. More...
 
const CreateFunctiongetMessageFactory () const
 
bool getMessageWillCopy () const
 
const std::string & getPublisherName () const
 Returns the name of the node which published this message. More...
 
ros::Time getReceiptTime () const
 Returns the time at which this message was received. More...
 
void init (const ConstMessagePtr &message, const std::shared_ptr< M_string > &connection_header, ros::Time receipt_time, bool nonconst_need_copy, const CreateFunction &create)
 
 MessageEvent ()
 
 MessageEvent (const ConstMessagePtr &message)
 
 MessageEvent (const ConstMessagePtr &message, const std::shared_ptr< M_string > &connection_header, ros::Time receipt_time)
 
 MessageEvent (const ConstMessagePtr &message, const std::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 MessageEvent< ConstMessage > &rhs)
 
 MessageEvent (const MessageEvent< ConstMessage > &rhs, bool nonconst_need_copy)
 
 MessageEvent (const MessageEvent< Message > &rhs)
 
 MessageEvent (const MessageEvent< Message > &rhs, bool nonconst_need_copy)
 
 MessageEvent (const MessageEvent< void const > &rhs, const CreateFunction &create)
 
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 >
std::enable_if<!std::is_void< M2 >::value, std::shared_ptr< M > >::type copyMessageIfNecessary () const
 
template<typename M2 >
std::enable_if< std::is_void< M2 >::value, std::shared_ptr< M > >::type copyMessageIfNecessary () const
 

Private Attributes

std::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 roswrap::MessageEvent< M >

Event type for subscriptions, const ros::MessageEvent<M const>& can be used in your callback instead of const std::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

◆ ConstMessage

template<typename M >
typedef std::add_const<M>::type roswrap::MessageEvent< M >::ConstMessage

Definition at line 73 of file message_event.h.

◆ ConstMessagePtr

template<typename M >
typedef std::shared_ptr<ConstMessage> roswrap::MessageEvent< M >::ConstMessagePtr

Definition at line 76 of file message_event.h.

◆ CreateFunction

template<typename M >
typedef std::function<MessagePtr()> roswrap::MessageEvent< M >::CreateFunction

Definition at line 77 of file message_event.h.

◆ Message

template<typename M >
typedef std::remove_const<M>::type roswrap::MessageEvent< M >::Message

Definition at line 74 of file message_event.h.

◆ MessagePtr

template<typename M >
typedef std::shared_ptr<Message> roswrap::MessageEvent< M >::MessagePtr

Definition at line 75 of file message_event.h.

Constructor & Destructor Documentation

◆ MessageEvent() [1/10]

template<typename M >
roswrap::MessageEvent< M >::MessageEvent ( )
inline

Definition at line 79 of file message_event.h.

◆ MessageEvent() [2/10]

template<typename M >
roswrap::MessageEvent< M >::MessageEvent ( const MessageEvent< Message > &  rhs)
inline

Definition at line 83 of file message_event.h.

◆ MessageEvent() [3/10]

template<typename M >
roswrap::MessageEvent< M >::MessageEvent ( const MessageEvent< ConstMessage > &  rhs)
inline

Definition at line 88 of file message_event.h.

◆ MessageEvent() [4/10]

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

Definition at line 93 of file message_event.h.

◆ MessageEvent() [5/10]

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

Definition at line 99 of file message_event.h.

◆ MessageEvent() [6/10]

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

Definition at line 105 of file message_event.h.

◆ MessageEvent() [7/10]

template<typename M >
roswrap::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.

◆ MessageEvent() [8/10]

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

Definition at line 118 of file message_event.h.

◆ MessageEvent() [9/10]

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

Definition at line 123 of file message_event.h.

◆ MessageEvent() [10/10]

template<typename M >
roswrap::MessageEvent< M >::MessageEvent ( const ConstMessagePtr message,
const std::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

◆ copyMessageIfNecessary() [1/2]

template<typename M >
template<typename M2 >
std::enable_if<!std::is_void<M2>::value, std::shared_ptr<M> >::type roswrap::MessageEvent< M >::copyMessageIfNecessary ( ) const
inlineprivate

Definition at line 216 of file message_event.h.

◆ copyMessageIfNecessary() [2/2]

template<typename M >
template<typename M2 >
std::enable_if<std::is_void<M2>::value, std::shared_ptr<M> >::type roswrap::MessageEvent< M >::copyMessageIfNecessary ( ) const
inlineprivate

Definition at line 236 of file message_event.h.

◆ getConnectionHeader()

template<typename M >
M_string& roswrap::MessageEvent< M >::getConnectionHeader ( ) const
inline

Retrieve the connection header.

Definition at line 171 of file message_event.h.

◆ getConnectionHeaderPtr()

template<typename M >
const std::shared_ptr<M_string>& roswrap::MessageEvent< M >::getConnectionHeaderPtr ( ) const
inline

Definition at line 172 of file message_event.h.

◆ getConstMessage()

template<typename M >
const std::shared_ptr<ConstMessage>& roswrap::MessageEvent< M >::getConstMessage ( ) const
inline

Retrieve a const version of the message.

Definition at line 167 of file message_event.h.

◆ getMessage()

template<typename M >
std::shared_ptr<M> roswrap::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.

◆ getMessageFactory()

template<typename M >
const CreateFunction& roswrap::MessageEvent< M >::getMessageFactory ( ) const
inline

Definition at line 212 of file message_event.h.

◆ getMessageWillCopy()

template<typename M >
bool roswrap::MessageEvent< M >::getMessageWillCopy ( ) const
inline

Definition at line 185 of file message_event.h.

◆ getPublisherName()

template<typename M >
const std::string& roswrap::MessageEvent< M >::getPublisherName ( ) const
inline

Returns the name of the node which published this message.

Definition at line 177 of file message_event.h.

◆ getReceiptTime()

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

Returns the time at which this message was received.

Definition at line 182 of file message_event.h.

◆ init()

template<typename M >
void roswrap::MessageEvent< M >::init ( const ConstMessagePtr message,
const std::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.

◆ nonConstWillCopy()

template<typename M >
bool roswrap::MessageEvent< M >::nonConstWillCopy ( ) const
inline

Definition at line 184 of file message_event.h.

◆ operator!=()

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

Definition at line 207 of file message_event.h.

◆ operator<()

template<typename M >
bool roswrap::MessageEvent< M >::operator< ( const MessageEvent< M > &  rhs)
inline

Definition at line 187 of file message_event.h.

◆ operator=() [1/2]

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

Definition at line 148 of file message_event.h.

◆ operator=() [2/2]

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

Definition at line 142 of file message_event.h.

◆ operator==()

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

Definition at line 202 of file message_event.h.

Member Data Documentation

◆ connection_header_

template<typename M >
std::shared_ptr<M_string> roswrap::MessageEvent< M >::connection_header_
private

Definition at line 244 of file message_event.h.

◆ create_

template<typename M >
CreateFunction roswrap::MessageEvent< M >::create_
private

Definition at line 247 of file message_event.h.

◆ message_

template<typename M >
ConstMessagePtr roswrap::MessageEvent< M >::message_
private

Definition at line 241 of file message_event.h.

◆ message_copy_

template<typename M >
MessagePtr roswrap::MessageEvent< M >::message_copy_
mutableprivate

Definition at line 243 of file message_event.h.

◆ nonconst_need_copy_

template<typename M >
bool roswrap::MessageEvent< M >::nonconst_need_copy_
private

Definition at line 246 of file message_event.h.

◆ receipt_time_

template<typename M >
ros::Time roswrap::MessageEvent< M >::receipt_time_
private

Definition at line 245 of file message_event.h.

◆ s_unknown_publisher_string_

template<typename M >
const std::string roswrap::MessageEvent< M >::s_unknown_publisher_string_
staticprivate

Definition at line 249 of file message_event.h.


The documentation for this class was generated from the following file:


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:15