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 std::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 std::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 std::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_ |
| std::mutex | callbacks_mutex_ |
| std::string | datatype_ |
| bool | dropped_ |
| M_PublisherLinkToLatchInfo | latched_messages_ |
| std::string | md5sum_ |
| std::mutex | md5sum_mutex_ |
| std::string | name_ |
| uint32_t | nonconst_callbacks_ |
| S_PendingConnection | pending_connections_ |
| std::mutex | pending_connections_mutex_ |
| V_PublisherLink | publisher_links_ |
| std::mutex | publisher_links_mutex_ |
| std::mutex | shutdown_mutex_ |
| bool | shutting_down_ |
| StatisticsLogger | statistics_ |
| TransportHints | transport_hints_ |
Manages a subscription on a single topic.
Definition at line 66 of file subscription.h.
|
private |
Definition at line 205 of file subscription.h.
|
private |
Definition at line 240 of file subscription.h.
| typedef std::map<std::string, std::string> roswrap::Subscription::M_string |
Definition at line 103 of file subscription.h.
| typedef std::shared_ptr<PendingConnection> roswrap::Subscription::PendingConnectionPtr |
Definition at line 179 of file subscription.h.
|
private |
Definition at line 220 of file subscription.h.
|
private |
Definition at line 206 of file subscription.h.
|
private |
Definition at line 224 of file subscription.h.
|
private |
Definition at line 243 of file subscription.h.
| roswrap::Subscription::Subscription | ( | const std::string & | name, |
| const std::string & | md5sum, | ||
| const std::string & | datatype, | ||
| const TransportHints & | transport_hints | ||
| ) |
|
virtual |
|
private |
| bool roswrap::Subscription::addCallback | ( | const SubscriptionCallbackHelperPtr & | helper, |
| const std::string & | md5sum, | ||
| CallbackQueueInterface * | queue, | ||
| int32_t | queue_size, | ||
| const VoidConstPtr & | tracked_object, | ||
| bool | allow_concurrent_callbacks | ||
| ) |
| void roswrap::Subscription::addLocalConnection | ( | const PublicationPtr & | pub | ) |
|
private |
| const std::string roswrap::Subscription::datatype | ( | ) |
| void roswrap::Subscription::drop | ( | ) |
Terminate all our PublisherLinks.
|
private |
| void roswrap::Subscription::getInfo | ( | XmlRpc::XmlRpcValue & | info | ) |
|
inline |
Definition at line 119 of file subscription.h.
|
inline |
Definition at line 120 of file subscription.h.
| uint32_t roswrap::Subscription::getNumPublishers | ( | ) |
| void roswrap::Subscription::getPublishTypes | ( | bool & | ser, |
| bool & | nocopy, | ||
| const std::type_info & | ti | ||
| ) |
| XmlRpc::XmlRpcValue roswrap::Subscription::getStats | ( | ) |
| uint32_t roswrap::Subscription::handleMessage | ( | const SerializedMessage & | m, |
| bool | ser, | ||
| bool | nocopy, | ||
| const std::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.
| void roswrap::Subscription::headerReceived | ( | const PublisherLinkPtr & | link, |
| const Header & | h | ||
| ) |
|
inline |
Returns whether this Subscription has been dropped or not.
Definition at line 96 of file subscription.h.
| const std::string roswrap::Subscription::md5sum | ( | ) |
| bool roswrap::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 |
|
private |
| void roswrap::Subscription::pendingConnectionDone | ( | const PendingConnectionPtr & | pending_conn, |
| XmlRpc::XmlRpcValue & | result | ||
| ) |
| bool roswrap::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.
| void roswrap::Subscription::removeCallback | ( | const SubscriptionCallbackHelperPtr & | helper | ) |
| void roswrap::Subscription::removePublisherLink | ( | const PublisherLinkPtr & | pub_link | ) |
Removes a subscriber from our list.
| void roswrap::Subscription::shutdown | ( | ) |
Terminate all our PublisherLinks and join our callback thread if it exists.
|
private |
Definition at line 244 of file subscription.h.
|
private |
Definition at line 213 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 216 of file subscription.h.
|
private |
Definition at line 241 of file subscription.h.
|
private |
Definition at line 210 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 214 of file subscription.h.
|
private |
Definition at line 221 of file subscription.h.
|
private |
Definition at line 222 of file subscription.h.
|
private |
Definition at line 225 of file subscription.h.
|
private |
Definition at line 226 of file subscription.h.
|
private |
Definition at line 218 of file subscription.h.
|
private |
Definition at line 217 of file subscription.h.
|
private |
Definition at line 230 of file subscription.h.
|
private |
Definition at line 228 of file subscription.h.