#include <topic_manager.h>
Public Member Functions | |
bool | advertise (const AdvertiseOptions &ops, const SubscriberCallbacksPtr &callbacks) |
void | getAdvertisedTopics (V_string &topics) |
Get the list of topics advertised by this node. | |
size_t | getNumPublishers (const std::string &_topic) |
Return the number of publishers connected to this node on a particular topic. | |
size_t | getNumSubscribers (const std::string &_topic) |
Return the number of subscribers a node has for a particular topic: | |
size_t | getNumSubscriptions () |
void | getSubscribedTopics (V_string &topics) |
Get the list of topics subscribed to by this node. | |
void | incrementSequence (const std::string &_topic) |
bool | isLatched (const std::string &topic) |
PublicationPtr | lookupPublication (const std::string &topic) |
Lookup an advertised topic. | |
template<typename M > | |
void | publish (const std::string &topic, const M &message) |
void | publish (const std::string &_topic, const boost::function< SerializedMessage(void)> &serfunc, SerializedMessage &m) |
void | shutdown () |
void | start () |
bool | subscribe (const SubscribeOptions &ops) |
TopicManager () | |
bool | unadvertise (const std::string &topic, const SubscriberCallbacksPtr &callbacks) |
bool | unsubscribe (const std::string &_topic, const SubscriptionCallbackHelperPtr &helper) |
~TopicManager () | |
Static Public Member Functions | |
static const TopicManagerPtr & | instance () |
Private Member Functions | |
bool | addSubCallback (const SubscribeOptions &ops) |
void | getBusInfo (XmlRpc::XmlRpcValue &info) |
Compute the info for the node's connectivity. | |
void | getBusInfoCallback (XmlRpc::XmlRpcValue ¶ms, XmlRpc::XmlRpcValue &result) |
void | getBusStats (XmlRpc::XmlRpcValue &stats) |
Compute the statistics for the node's connectivity. | |
void | getBusStatsCallback (XmlRpc::XmlRpcValue ¶ms, XmlRpc::XmlRpcValue &result) |
void | getPublications (XmlRpc::XmlRpcValue &publications) |
Return the list of advertised topics for the node. | |
void | getPublicationsCallback (XmlRpc::XmlRpcValue ¶ms, XmlRpc::XmlRpcValue &result) |
void | getSubscriptions (XmlRpc::XmlRpcValue &subscriptions) |
Return the list of subcriptions for the node. | |
void | getSubscriptionsCallback (XmlRpc::XmlRpcValue ¶ms, XmlRpc::XmlRpcValue &result) |
bool | isShuttingDown () |
bool | isTopicAdvertised (const std::string &topic) |
PublicationPtr | lookupPublicationWithoutLock (const std::string &topic) |
void | processPublishQueues () |
bool | pubUpdate (const std::string &topic, const std::vector< std::string > &pubs) |
Update local publisher lists. | |
void | pubUpdateCallback (XmlRpc::XmlRpcValue ¶ms, XmlRpc::XmlRpcValue &result) |
bool | registerSubscriber (const SubscriptionPtr &s, const std::string &datatype) |
bool | requestTopic (const std::string &topic, XmlRpc::XmlRpcValue &protos, XmlRpc::XmlRpcValue &ret) |
Request a topic. | |
void | requestTopicCallback (XmlRpc::XmlRpcValue ¶ms, XmlRpc::XmlRpcValue &result) |
bool | unregisterPublisher (const std::string &topic) |
bool | unregisterSubscriber (const std::string &topic) |
Private Attributes | |
std::list< std::string > | advertised_topic_names_ |
boost::mutex | advertised_topic_names_mutex_ |
V_Publication | advertised_topics_ |
boost::recursive_mutex | advertised_topics_mutex_ |
ConnectionManagerPtr | connection_manager_ |
PollManagerPtr | poll_manager_ |
volatile bool | shutting_down_ |
boost::mutex | shutting_down_mutex_ |
boost::mutex | subs_mutex_ |
L_Subscription | subscriptions_ |
XMLRPCManagerPtr | xmlrpc_manager_ |
Definition at line 63 of file topic_manager.h.
Definition at line 72 of file topic_manager.cpp.
Definition at line 77 of file topic_manager.cpp.
bool ros::TopicManager::addSubCallback | ( | const SubscribeOptions & | ops | ) | [private] |
if it finds a pre-existing subscription to the same topic and of the same message type, it appends the Functor to the callback vector for that subscription. otherwise, it returns false, indicating that a new subscription needs to be created.
Definition at line 204 of file topic_manager.cpp.
bool ros::TopicManager::advertise | ( | const AdvertiseOptions & | ops, |
const SubscriberCallbacksPtr & | callbacks | ||
) |
Definition at line 299 of file topic_manager.cpp.
void ros::TopicManager::getAdvertisedTopics | ( | V_string & | topics | ) |
Get the list of topics advertised by this node.
[out] | topics | The advertised topics |
Definition at line 168 of file topic_manager.cpp.
void ros::TopicManager::getBusInfo | ( | XmlRpc::XmlRpcValue & | info | ) | [private] |
Compute the info for the node's connectivity.
This is the implementation of the xml-rpc getBusInfo function; it populates the XmlRpcValue object sent to it with various info about the node's connectivity.
Definition at line 938 of file topic_manager.cpp.
void ros::TopicManager::getBusInfoCallback | ( | XmlRpc::XmlRpcValue & | params, |
XmlRpc::XmlRpcValue & | result | ||
) | [private] |
Definition at line 1041 of file topic_manager.cpp.
void ros::TopicManager::getBusStats | ( | XmlRpc::XmlRpcValue & | stats | ) | [private] |
Compute the statistics for the node's connectivity.
This is the implementation of the xml-rpc getBusStats function; it populates the XmlRpcValue object sent to it with various statistics about the node's connectivity, bandwidth utilization, etc.
Definition at line 905 of file topic_manager.cpp.
void ros::TopicManager::getBusStatsCallback | ( | XmlRpc::XmlRpcValue & | params, |
XmlRpc::XmlRpcValue & | result | ||
) | [private] |
Definition at line 1032 of file topic_manager.cpp.
size_t ros::TopicManager::getNumPublishers | ( | const std::string & | _topic | ) |
Return the number of publishers connected to this node on a particular topic.
_topic | the topic name to check |
Definition at line 884 of file topic_manager.cpp.
size_t ros::TopicManager::getNumSubscribers | ( | const std::string & | _topic | ) |
Return the number of subscribers a node has for a particular topic:
_topic | The topic name to check |
Definition at line 860 of file topic_manager.cpp.
size_t ros::TopicManager::getNumSubscriptions | ( | ) |
Definition at line 878 of file topic_manager.cpp.
void ros::TopicManager::getPublications | ( | XmlRpc::XmlRpcValue & | publications | ) | [private] |
Return the list of advertised topics for the node.
This is the implementation of the xml-rpc getPublications function; it populates the XmlRpcValue object sent to it with the list of advertised topics and their datatypes.
Definition at line 983 of file topic_manager.cpp.
void ros::TopicManager::getPublicationsCallback | ( | XmlRpc::XmlRpcValue & | params, |
XmlRpc::XmlRpcValue & | result | ||
) | [private] |
Definition at line 1059 of file topic_manager.cpp.
void ros::TopicManager::getSubscribedTopics | ( | V_string & | topics | ) |
Get the list of topics subscribed to by this node.
[out] | The | subscribed topics |
Definition at line 178 of file topic_manager.cpp.
void ros::TopicManager::getSubscriptions | ( | XmlRpc::XmlRpcValue & | subscriptions | ) | [private] |
Return the list of subcriptions for the node.
This is the implementation of the xml-rpc getSubscriptions function; it populates the XmlRpcValue object sent to it with the list of subscribed topics and their datatypes.
Definition at line 963 of file topic_manager.cpp.
void ros::TopicManager::getSubscriptionsCallback | ( | XmlRpc::XmlRpcValue & | params, |
XmlRpc::XmlRpcValue & | result | ||
) | [private] |
Definition at line 1050 of file topic_manager.cpp.
void ros::TopicManager::incrementSequence | ( | const std::string & | _topic | ) |
Definition at line 763 of file topic_manager.cpp.
const TopicManagerPtr & ros::TopicManager::instance | ( | ) | [static] |
Definition at line 58 of file topic_manager.cpp.
bool ros::TopicManager::isLatched | ( | const std::string & | topic | ) |
Definition at line 772 of file topic_manager.cpp.
bool ros::TopicManager::isShuttingDown | ( | ) | [inline, private] |
Definition at line 219 of file topic_manager.h.
bool ros::TopicManager::isTopicAdvertised | ( | const std::string & | topic | ) | [private] |
Definition at line 468 of file topic_manager.cpp.
PublicationPtr ros::TopicManager::lookupPublication | ( | const std::string & | topic | ) |
Lookup an advertised topic.
This method iterates over advertised_topics, looking for one with name matching the given topic name. The advertised_topics_mutex is locked during this search. This method is only used internally.
topic | The topic name to look for. |
Definition at line 192 of file topic_manager.cpp.
PublicationPtr ros::TopicManager::lookupPublicationWithoutLock | ( | const std::string & | topic | ) | [private] |
Definition at line 783 of file topic_manager.cpp.
void ros::TopicManager::processPublishQueues | ( | ) | [private] |
Definition at line 155 of file topic_manager.cpp.
void ros::TopicManager::publish | ( | const std::string & | topic, |
const M & | message | ||
) | [inline] |
Definition at line 122 of file topic_manager.h.
void ros::TopicManager::publish | ( | const std::string & | _topic, |
const boost::function< SerializedMessage(void)> & | serfunc, | ||
SerializedMessage & | m | ||
) |
Definition at line 705 of file topic_manager.cpp.
bool ros::TopicManager::pubUpdate | ( | const std::string & | topic, |
const std::vector< std::string > & | pubs | ||
) | [private] |
Update local publisher lists.
Use this method to update address information for publishers on a given topic.
topic | The topic of interest |
pubs | The list of publishers to update. |
Definition at line 556 of file topic_manager.cpp.
void ros::TopicManager::pubUpdateCallback | ( | XmlRpc::XmlRpcValue & | params, |
XmlRpc::XmlRpcValue & | result | ||
) | [private] |
Definition at line 1007 of file topic_manager.cpp.
bool ros::TopicManager::registerSubscriber | ( | const SubscriptionPtr & | s, |
const std::string & | datatype | ||
) | [private] |
Definition at line 481 of file topic_manager.cpp.
bool ros::TopicManager::requestTopic | ( | const std::string & | topic, |
XmlRpc::XmlRpcValue & | protos, | ||
XmlRpc::XmlRpcValue & | ret | ||
) | [private] |
Request a topic.
Negotiate a subscriber connection on a topic.
topic | The topic of interest. |
protos | List of transport protocols, in preference order |
ret | Return value |
Definition at line 594 of file topic_manager.cpp.
void ros::TopicManager::requestTopicCallback | ( | XmlRpc::XmlRpcValue & | params, |
XmlRpc::XmlRpcValue & | result | ||
) | [private] |
Definition at line 1024 of file topic_manager.cpp.
void ros::TopicManager::shutdown | ( | ) |
Definition at line 101 of file topic_manager.cpp.
void ros::TopicManager::start | ( | ) |
Definition at line 82 of file topic_manager.cpp.
bool ros::TopicManager::subscribe | ( | const SubscribeOptions & | ops | ) |
Definition at line 252 of file topic_manager.cpp.
bool ros::TopicManager::unadvertise | ( | const std::string & | topic, |
const SubscriberCallbacksPtr & | callbacks | ||
) |
Definition at line 408 of file topic_manager.cpp.
bool ros::TopicManager::unregisterPublisher | ( | const std::string & | topic | ) | [private] |
Definition at line 457 of file topic_manager.cpp.
bool ros::TopicManager::unregisterSubscriber | ( | const std::string & | topic | ) | [private] |
Definition at line 544 of file topic_manager.cpp.
bool ros::TopicManager::unsubscribe | ( | const std::string & | _topic, |
const SubscriptionCallbackHelperPtr & | helper | ||
) |
Definition at line 799 of file topic_manager.cpp.
std::list<std::string> ros::TopicManager::advertised_topic_names_ [private] |
Definition at line 226 of file topic_manager.h.
boost::mutex ros::TopicManager::advertised_topic_names_mutex_ [private] |
Definition at line 227 of file topic_manager.h.
V_Publication ros::TopicManager::advertised_topics_ [private] |
Definition at line 225 of file topic_manager.h.
boost::recursive_mutex ros::TopicManager::advertised_topics_mutex_ [private] |
Definition at line 224 of file topic_manager.h.
ConnectionManagerPtr ros::TopicManager::connection_manager_ [private] |
Definition at line 233 of file topic_manager.h.
PollManagerPtr ros::TopicManager::poll_manager_ [private] |
Definition at line 232 of file topic_manager.h.
volatile bool ros::TopicManager::shutting_down_ [private] |
Definition at line 229 of file topic_manager.h.
boost::mutex ros::TopicManager::shutting_down_mutex_ [private] |
Definition at line 230 of file topic_manager.h.
boost::mutex ros::TopicManager::subs_mutex_ [private] |
Definition at line 221 of file topic_manager.h.
L_Subscription ros::TopicManager::subscriptions_ [private] |
Definition at line 222 of file topic_manager.h.
XMLRPCManagerPtr ros::TopicManager::xmlrpc_manager_ [private] |
Definition at line 234 of file topic_manager.h.