class documentation

class Registrations(object):

Constructor: Registrations(type_)

View In Hierarchy

All calls may result in access/modifications to node registrations dictionary, so be careful to guarantee appropriate thread-safeness.

Data structure for storing a set of registrations (e.g. publications, services). The underlying data storage is the same except for services, which have the constraint that only one registration may be active for a given key.

Method __bool__ @return: True if there are registrations
Method __contains__ Emulate mapping type for has_key()
Method __getitem__ @param key: registration key (e.g. topic/service/param name) @type key: str @return: (caller_id, caller_api) for registered key, empty list if registration is not valid @rtype: [(str, str),]
Method __init__ ctor. @param type_: one of [ TOPIC_SUBSCRIPTIONS, TOPIC_PUBLICATIONS, SERVICE, PARAM_SUBSCRIPTIONS ] @type type_: int
Method __nonzero__ @return: True if there are registrations
Method get_apis Only valid if self.type != SERVICE. @param key: registration key (e.g. topic/service/param name) @type key: str @return: caller_apis for registered key, empty list if registration is not valid @rtype: [str]...
Method get_service_api Lookup service API URI. NOTE: this should only be valid if type==SERVICE as service Registrations instances are the only ones that track service API URIs. @param service: service name @type service: str @return str: service_api for registered key or None if registration is no longer valid...
Method get_state @return: state in getSystemState()-friendly format [ [key, [callerId1...callerIdN]] ... ] @rtype: [str, [str]...]
Method has_key @param key: registration key (e.g. topic/service/param name) @type key: str @return: True if key is registered @rtype: bool
Method iterkeys Iterate over registration keys @return: iterator for registration keys
Method register Add caller_id into the map as a provider of the specified service (key). caller_id must not have been previously registered with a different caller_api.
Method unregister Remove caller_id from the map as a provider of the specified service (key). Subroutine for managing provider map data structure, essentially a multimap @param key: registration key (e.g. topic/service/param name) @type key: str @param caller_id: caller_id of provider @type caller_id: str @param caller_api: API URI of provider @type caller_api: str @param service_api: (keyword) ROS service API URI if registering a service @type service_api: str @return: for ease of master integration, directly returns unregister value for higher-level XMLRPC API...
Method unregister_all Remove all registrations associated with caller_id @param caller_id: caller_id of provider @type caller_id: str
Constant PARAM_SUBSCRIPTIONS Undocumented
Constant SERVICE Undocumented
Constant TOPIC_PUBLICATIONS Undocumented
Constant TOPIC_SUBSCRIPTIONS Undocumented
Instance Variable map Undocumented
Instance Variable service_api_map Undocumented
Instance Variable type Undocumented
def __bool__(self):

@return: True if there are registrations

def __contains__(self, key):

Emulate mapping type for has_key()

def __getitem__(self, key):

@param key: registration key (e.g. topic/service/param name) @type key: str @return: (caller_id, caller_api) for registered key, empty list if registration is not valid @rtype: [(str, str),]

def __init__(self, type_):

ctor. @param type_: one of [ TOPIC_SUBSCRIPTIONS, TOPIC_PUBLICATIONS, SERVICE, PARAM_SUBSCRIPTIONS ] @type type_: int

def __nonzero__(self):

@return: True if there are registrations

def get_apis(self, key):

Only valid if self.type != SERVICE. @param key: registration key (e.g. topic/service/param name) @type key: str @return: caller_apis for registered key, empty list if registration is not valid @rtype: [str]

def get_service_api(self, service):

Lookup service API URI. NOTE: this should only be valid if type==SERVICE as service Registrations instances are the only ones that track service API URIs. @param service: service name @type service: str @return str: service_api for registered key or None if registration is no longer valid. @type: str

def get_state(self):

@return: state in getSystemState()-friendly format [ [key, [callerId1...callerIdN]] ... ] @rtype: [str, [str]...]

def has_key(self, key):

@param key: registration key (e.g. topic/service/param name) @type key: str @return: True if key is registered @rtype: bool

def iterkeys(self):

Iterate over registration keys @return: iterator for registration keys

def register(self, key, caller_id, caller_api, service_api=None):

Add caller_id into the map as a provider of the specified service (key). caller_id must not have been previously registered with a different caller_api.

Subroutine for managing provider map data structure (essentially a multimap). @param key: registration key (e.g. topic/service/param name) @type key: str @param caller_id: caller_id of provider @type caller_id: str @param caller_api: API URI of provider @type caller_api: str @param service_api: (keyword) ROS service API URI if registering a service @type service_api: str

def unregister(self, key, caller_id, caller_api, service_api=None):

Remove caller_id from the map as a provider of the specified service (key). Subroutine for managing provider map data structure, essentially a multimap @param key: registration key (e.g. topic/service/param name) @type key: str @param caller_id: caller_id of provider @type caller_id: str @param caller_api: API URI of provider @type caller_api: str @param service_api: (keyword) ROS service API URI if registering a service @type service_api: str @return: for ease of master integration, directly returns unregister value for higher-level XMLRPC API. val is the number of APIs unregistered (0 or 1) @rtype: code, msg, val

def unregister_all(self, caller_id):

Remove all registrations associated with caller_id @param caller_id: caller_id of provider @type caller_id: str

PARAM_SUBSCRIPTIONS: int =

Undocumented

Value
4
SERVICE: int =

Undocumented

Value
3
TOPIC_PUBLICATIONS: int =

Undocumented

Value
2
TOPIC_SUBSCRIPTIONS: int =

Undocumented

Value
1
map: dict =

Undocumented

service_api_map: dict =

Undocumented

type =

Undocumented