class documentation

class _TopicManager(object):

Constructor: _TopicManager()

View In Hierarchy

Tracks Topic objects See L{get_topic_manager()} for singleton access

Method __init__ ctor.
Method acquire_impl Acquire a L{_TopicImpl} for the specified topic (create one if it doesn't exist). Every L{Topic} instance has a _TopicImpl that actually controls the topic resources so that multiple Topic instances use the same underlying connections...
Method check_all Check all registered publication and subscriptions.
Method close_all Close all registered publication and subscriptions. Manager is no longer usable after close.
Method get_impl Get the L{_TopicImpl} for the specified topic. This is mainly for testing purposes. Unlike acquire_impl, it does not alter the ref count. @param resolved_name: resolved topic name @type resolved_name: str @param reg_type: L{rospy...
Method get_pub_sub_info get topic publisher and subscriber connection info for getBusInfo() api @return: [bus info stats]
Method get_pub_sub_stats get topic publisher and subscriber stats for getBusStats() api @return: [publisherStats, subscriberStats].
Method get_publications Undocumented
Method get_publisher_impl @param resolved_name: resolved topic name @type resolved_name: str @return: list of L{_PublisherImpl}s @rtype: [L{_PublisherImpl}]
Method get_subscriber_impl @param resolved_name: topic name @type resolved_name: str @return: subscriber for the specified topic. @rtype: L{_SubscriberImpl}
Method get_subscriptions Undocumented
Method get_topics @return: list of topic names this node subscribes to/publishes @rtype: [str]
Method has_publication @param resolved_name: resolved topic name @type resolved_name: str @return: True if manager has publication for specified topic @rtype: bool
Method has_subscription @param resolved_name: resolved topic name @type resolved_name: str @return: True if manager has subscription for specified topic @rtype: bool
Method release_impl Release a L_{TopicImpl} for the specified topic.
Instance Variable closed Undocumented
Instance Variable lock Undocumented
Instance Variable pubs Undocumented
Instance Variable subs Undocumented
Instance Variable topics Undocumented
Method _add Add L{_TopicImpl} instance to rmap @param ps: a pub/sub impl instance @type ps: L{_TopicImpl} @param rmap: { topic: _TopicImpl} rmap to record instance in @type rmap: dict @param reg_type: L{rospy.registration...
Method _get_list Undocumented
Method _recalculate_topics recalculate self.topics. expensive
Method _remove Remove L{_TopicImpl} instance from rmap @param ps: a pub/sub impl instance @type ps: L{_TopicImpl} @param rmap: topic->_TopicImpl rmap to remove instance in @type rmap: dict @param reg_type: L{rospy.
def __init__(self):

ctor.

def acquire_impl(self, reg_type, resolved_name, data_class):

Acquire a L{_TopicImpl} for the specified topic (create one if it doesn't exist). Every L{Topic} instance has a _TopicImpl that actually controls the topic resources so that multiple Topic instances use the same underlying connections. 'Acquiring' a topic implementation marks that another Topic instance is using the TopicImpl.

@param resolved_name: resolved topic name @type resolved_name: str

@param reg_type: L{rospy.registration.Registration.PUB} or L{rospy.registration.Registration.SUB} @type reg_type: str

@param data_class: message class for topic @type data_class: L{Message} class

def check_all(self):

Check all registered publication and subscriptions.

def close_all(self):

Close all registered publication and subscriptions. Manager is no longer usable after close.

def get_impl(self, reg_type, resolved_name):

Get the L{_TopicImpl} for the specified topic. This is mainly for testing purposes. Unlike acquire_impl, it does not alter the ref count. @param resolved_name: resolved topic name @type resolved_name: str @param reg_type: L{rospy.registration.Registration.PUB} or L{rospy.registration.Registration.SUB} @type reg_type: str

def get_pub_sub_info(self):

get topic publisher and subscriber connection info for getBusInfo() api @return: [bus info stats]

See getBusInfo() API for more data structure details.

@rtype: list

def get_pub_sub_stats(self):

get topic publisher and subscriber stats for getBusStats() api @return: [publisherStats, subscriberStats].

See getBusStats() API for more data structure details.

@rtype: list

def get_publications(self):

Undocumented

def get_publisher_impl(self, resolved_name):

@param resolved_name: resolved topic name @type resolved_name: str @return: list of L{_PublisherImpl}s @rtype: [L{_PublisherImpl}]

def get_subscriber_impl(self, resolved_name):

@param resolved_name: topic name @type resolved_name: str @return: subscriber for the specified topic. @rtype: L{_SubscriberImpl}

def get_subscriptions(self):

Undocumented

def get_topics(self):

@return: list of topic names this node subscribes to/publishes @rtype: [str]

def has_publication(self, resolved_name):

@param resolved_name: resolved topic name @type resolved_name: str @return: True if manager has publication for specified topic @rtype: bool

def has_subscription(self, resolved_name):

@param resolved_name: resolved topic name @type resolved_name: str @return: True if manager has subscription for specified topic @rtype: bool

def release_impl(self, reg_type, resolved_name):

Release a L_{TopicImpl} for the specified topic.

Every L{Topic} instance has a _TopicImpl that actually controls the topic resources so that multiple Topic instances use the same underlying connections. 'Acquiring' a topic implementation marks that another Topic instance is using the TopicImpl.

@param resolved_name: resolved topic name @type resolved_name: str @param reg_type: L{rospy.registration.Registration.PUB} or L{rospy.registration.Registration.SUB} @type reg_type: str

closed: bool =

Undocumented

lock =

Undocumented

pubs: dict =

Undocumented

subs: dict =

Undocumented

topics =

Undocumented

def _add(self, ps, rmap, reg_type):

Add L{_TopicImpl} instance to rmap @param ps: a pub/sub impl instance @type ps: L{_TopicImpl} @param rmap: { topic: _TopicImpl} rmap to record instance in @type rmap: dict @param reg_type: L{rospy.registration.Registration.PUB} or L{rospy.registration.Registration.SUB} @type reg_type: str

def _get_list(self, rmap):

Undocumented

def _recalculate_topics(self):

recalculate self.topics. expensive

def _remove(self, ps, rmap, reg_type):

Remove L{_TopicImpl} instance from rmap @param ps: a pub/sub impl instance @type ps: L{_TopicImpl} @param rmap: topic->_TopicImpl rmap to remove instance in @type rmap: dict @param reg_type: L{rospy.registration.Registration.PUB} or L{rospy.registration.Registration.SUB} @type reg_type: str