Manages a subscription on a single topic. More...
#include <subscription.h>
Classes | |
struct | CallbackInfo |
struct | LatchInfo |
class | PendingConnection |
Public Types | |
typedef std::map< std::string, std::string > | M_string |
typedef boost::shared_ptr< PendingConnection > | PendingConnectionPtr |
Public Member Functions | |
bool | addCallback (const SubscriptionCallbackHelperPtr &helper, const std::string &md5sum, CallbackQueueInterface *queue, int32_t queue_size, const VoidConstPtr &tracked_object, bool allow_concurrent_callbacks) |
void | addLocalConnection (const PublicationPtr &pub) |
const std::string | datatype () |
void | drop () |
Terminate all our PublisherLinks. More... | |
void | getInfo (XmlRpc::XmlRpcValue &info) |
const std::string & | getName () const |
uint32_t | getNumCallbacks () const |
uint32_t | getNumPublishers () |
void | getPublishTypes (bool &ser, bool &nocopy, const std::type_info &ti) |
XmlRpc::XmlRpcValue | getStats () |
uint32_t | handleMessage (const SerializedMessage &m, bool ser, bool nocopy, const boost::shared_ptr< M_string > &connection_header, const PublisherLinkPtr &link) |
Called to notify that a new message has arrived from a publisher. Schedules the callback for invokation with the callback queue. More... | |
void | headerReceived (const PublisherLinkPtr &link, const Header &h) |
bool | isDropped () |
Returns whether this Subscription has been dropped or not. More... | |
const std::string | md5sum () |
bool | negotiateConnection (const std::string &xmlrpc_uri) |
Negotiates a connection with a publisher. More... | |
void | pendingConnectionDone (const PendingConnectionPtr &pending_conn, XmlRpc::XmlRpcValue &result) |
bool | pubUpdate (const std::vector< std::string > &pubs) |
Handle a publisher update list received from the master. Creates/drops PublisherLinks based on the list. Never handles new self-subscriptions. More... | |
void | removeCallback (const SubscriptionCallbackHelperPtr &helper) |
void | removePublisherLink (const PublisherLinkPtr &pub_link) |
Removes a subscriber from our list. More... | |
void | shutdown () |
Terminate all our PublisherLinks and join our callback thread if it exists. More... | |
Subscription (const std::string &name, const std::string &md5sum, const std::string &datatype, const TransportHints &transport_hints) | |
virtual | ~Subscription () |
Private Types | |
typedef boost::shared_ptr< CallbackInfo > | CallbackInfoPtr |
typedef std::map< PublisherLinkPtr, LatchInfo > | M_PublisherLinkToLatchInfo |
typedef std::set< PendingConnectionPtr > | S_PendingConnection |
typedef std::vector< CallbackInfoPtr > | V_CallbackInfo |
typedef std::vector< PublisherLinkPtr > | V_PublisherLink |
typedef std::vector< std::pair< const std::type_info *, MessageDeserializerPtr > > | V_TypeAndDeserializer |
Private Member Functions | |
void | addPublisherLink (const PublisherLinkPtr &link) |
void | dropAllConnections () |
Subscription & | operator= (const Subscription &) |
Subscription (const Subscription &) | |
Private Attributes | |
V_TypeAndDeserializer | cached_deserializers_ |
V_CallbackInfo | callbacks_ |
boost::mutex | callbacks_mutex_ |
std::string | datatype_ |
bool | dropped_ |
M_PublisherLinkToLatchInfo | latched_messages_ |
std::string | md5sum_ |
boost::mutex | md5sum_mutex_ |
std::string | name_ |
uint32_t | nonconst_callbacks_ |
S_PendingConnection | pending_connections_ |
boost::mutex | pending_connections_mutex_ |
V_PublisherLink | publisher_links_ |
boost::mutex | publisher_links_mutex_ |
boost::mutex | shutdown_mutex_ |
bool | shutting_down_ |
StatisticsLogger | statistics_ |
TransportHints | transport_hints_ |
Manages a subscription on a single topic.
Definition at line 65 of file subscription.h.
|
private |
Definition at line 204 of file subscription.h.
|
private |
Definition at line 239 of file subscription.h.
typedef std::map<std::string, std::string> ros::Subscription::M_string |
Definition at line 102 of file subscription.h.
Definition at line 178 of file subscription.h.
|
private |
Definition at line 219 of file subscription.h.
|
private |
Definition at line 205 of file subscription.h.
|
private |
Definition at line 223 of file subscription.h.
|
private |
Definition at line 242 of file subscription.h.
ros::Subscription::Subscription | ( | const std::string & | name, |
const std::string & | md5sum, | ||
const std::string & | datatype, | ||
const TransportHints & | transport_hints | ||
) |
Definition at line 69 of file subscription.cpp.
|
virtual |
Definition at line 80 of file subscription.cpp.
|
private |
bool ros::Subscription::addCallback | ( | const SubscriptionCallbackHelperPtr & | helper, |
const std::string & | md5sum, | ||
CallbackQueueInterface * | queue, | ||
int32_t | queue_size, | ||
const VoidConstPtr & | tracked_object, | ||
bool | allow_concurrent_callbacks | ||
) |
Definition at line 681 of file subscription.cpp.
void ros::Subscription::addLocalConnection | ( | const PublicationPtr & | pub | ) |
Definition at line 178 of file subscription.cpp.
|
private |
Definition at line 798 of file subscription.cpp.
const std::string ros::Subscription::datatype | ( | ) |
Definition at line 842 of file subscription.cpp.
void ros::Subscription::drop | ( | ) |
Terminate all our PublisherLinks.
Definition at line 148 of file subscription.cpp.
|
private |
Definition at line 158 of file subscription.cpp.
void ros::Subscription::getInfo | ( | XmlRpc::XmlRpcValue & | info | ) |
Definition at line 123 of file subscription.cpp.
|
inline |
Definition at line 118 of file subscription.h.
|
inline |
Definition at line 119 of file subscription.h.
uint32_t ros::Subscription::getNumPublishers | ( | ) |
Definition at line 142 of file subscription.cpp.
void ros::Subscription::getPublishTypes | ( | bool & | ser, |
bool & | nocopy, | ||
const std::type_info & | ti | ||
) |
Definition at line 819 of file subscription.cpp.
XmlRpcValue ros::Subscription::getStats | ( | ) |
Definition at line 96 of file subscription.cpp.
uint32_t ros::Subscription::handleMessage | ( | const SerializedMessage & | m, |
bool | ser, | ||
bool | nocopy, | ||
const boost::shared_ptr< M_string > & | connection_header, | ||
const PublisherLinkPtr & | link | ||
) |
Called to notify that a new message has arrived from a publisher. Schedules the callback for invokation with the callback queue.
Definition at line 599 of file subscription.cpp.
void ros::Subscription::headerReceived | ( | const PublisherLinkPtr & | link, |
const Header & | h | ||
) |
Definition at line 788 of file subscription.cpp.
|
inline |
Returns whether this Subscription has been dropped or not.
Definition at line 95 of file subscription.h.
const std::string ros::Subscription::md5sum | ( | ) |
Definition at line 847 of file subscription.cpp.
bool ros::Subscription::negotiateConnection | ( | const std::string & | xmlrpc_uri | ) |
Negotiates a connection with a publisher.
xmlrpc_uri | The XMLRPC URI to connect to to negotiate the connection |
Definition at line 342 of file subscription.cpp.
|
private |
void ros::Subscription::pendingConnectionDone | ( | const PendingConnectionPtr & | pending_conn, |
XmlRpc::XmlRpcValue & | result | ||
) |
Definition at line 445 of file subscription.cpp.
bool ros::Subscription::pubUpdate | ( | const std::vector< std::string > & | pubs | ) |
Handle a publisher update list received from the master. Creates/drops PublisherLinks based on the list. Never handles new self-subscriptions.
Definition at line 206 of file subscription.cpp.
void ros::Subscription::removeCallback | ( | const SubscriptionCallbackHelperPtr & | helper | ) |
Definition at line 758 of file subscription.cpp.
void ros::Subscription::removePublisherLink | ( | const PublisherLinkPtr & | pub_link | ) |
Removes a subscriber from our list.
Definition at line 803 of file subscription.cpp.
void ros::Subscription::shutdown | ( | ) |
Terminate all our PublisherLinks and join our callback thread if it exists.
Definition at line 86 of file subscription.cpp.
|
private |
Definition at line 243 of file subscription.h.
|
private |
Definition at line 212 of file subscription.h.
|
private |
Definition at line 211 of file subscription.h.
|
private |
Definition at line 210 of file subscription.h.
|
private |
Definition at line 215 of file subscription.h.
|
private |
Definition at line 240 of file subscription.h.
|
private |
Definition at line 209 of file subscription.h.
|
private |
Definition at line 208 of file subscription.h.
|
private |
Definition at line 207 of file subscription.h.
|
private |
Definition at line 213 of file subscription.h.
|
private |
Definition at line 220 of file subscription.h.
|
private |
Definition at line 221 of file subscription.h.
|
private |
Definition at line 224 of file subscription.h.
|
private |
Definition at line 225 of file subscription.h.
|
private |
Definition at line 217 of file subscription.h.
|
private |
Definition at line 216 of file subscription.h.
|
private |
Definition at line 229 of file subscription.h.
|
private |
Definition at line 227 of file subscription.h.