$search

ros::ServiceManager Class Reference

#include <service_manager.h>

List of all members.

Public Member Functions

bool advertiseService (const AdvertiseServiceOptions &ops)
ServiceServerLinkPtr createServiceServerLink (const std::string &service, bool persistent, const std::string &request_md5sum, const std::string &response_md5sum, const M_string &header_values)
 Create a new client to the specified service. If a client to that service already exists, returns the existing one.
bool lookupService (const std::string &name, std::string &serv_host, uint32_t &serv_port)
 Lookup the host/port of a service.
ServicePublicationPtr lookupServicePublication (const std::string &service)
 Lookup an advertised service.
void removeServiceServerLink (const ServiceServerLinkPtr &client)
 Remove the specified service client from our list.
 ServiceManager ()
void shutdown ()
void start ()
bool unadvertiseService (const std::string &serv_name)
 Unadvertise a service.
 ~ServiceManager ()

Static Public Member Functions

static const ServiceManagerPtr & instance ()

Private Member Functions

bool isServiceAdvertised (const std::string &serv_name)
bool isShuttingDown ()
bool unregisterService (const std::string &service)

Private Attributes

ConnectionManagerPtr connection_manager_
PollManagerPtr poll_manager_
L_ServicePublication service_publications_
boost::mutex service_publications_mutex_
L_ServiceServerLink service_server_links_
boost::mutex service_server_links_mutex_
volatile bool shutting_down_
boost::recursive_mutex shutting_down_mutex_
XMLRPCManagerPtr xmlrpc_manager_

Detailed Description

Definition at line 49 of file service_manager.h.


Constructor & Destructor Documentation

ros::ServiceManager::ServiceManager (  ) 

Definition at line 71 of file service_manager.cpp.

ros::ServiceManager::~ServiceManager (  ) 

Definition at line 76 of file service_manager.cpp.


Member Function Documentation

bool ros::ServiceManager::advertiseService ( const AdvertiseServiceOptions ops  ) 

Definition at line 134 of file service_manager.cpp.

ServiceServerLinkPtr ros::ServiceManager::createServiceServerLink ( const std::string &  service,
bool  persistent,
const std::string &  request_md5sum,
const std::string &  response_md5sum,
const M_string header_values 
)

Create a new client to the specified service. If a client to that service already exists, returns the existing one.

Parameters:
service The service to connect to
persistent Whether to keep this connection alive for more than one service call
request_md5sum The md5sum of the request message
response_md5sum The md5sum of the response message
Returns:
Shared pointer to the ServiceServerLink, empty shared pointer if none is found.

Definition at line 247 of file service_manager.cpp.

const ServiceManagerPtr & ros::ServiceManager::instance (  )  [static]

Definition at line 57 of file service_manager.cpp.

bool ros::ServiceManager::isServiceAdvertised ( const std::string &  serv_name  )  [private]
bool ros::ServiceManager::isShuttingDown (  )  [inline, private]

Definition at line 122 of file service_manager.h.

bool ros::ServiceManager::lookupService ( const std::string &  name,
std::string &  serv_host,
uint32_t &  serv_port 
)

Lookup the host/port of a service.

Parameters:
name The name of the service
serv_host OUT -- The host of the service
serv_port OUT -- The port of the service
ServicePublicationPtr ros::ServiceManager::lookupServicePublication ( const std::string &  service  ) 

Lookup an advertised service.

This method iterates over advertised_services, looking for one with name matching the given topic name. The advertised_services_mutex is locked during this search. This method is only used internally.

Parameters:
service The service name to look for.
Returns:
Pointer to the matching ServicePublication, NULL if none is found.

Definition at line 231 of file service_manager.cpp.

void ros::ServiceManager::removeServiceServerLink ( const ServiceServerLinkPtr &  client  ) 

Remove the specified service client from our list.

Parameters:
client The client to remove

Definition at line 289 of file service_manager.cpp.

void ros::ServiceManager::shutdown (  ) 

Definition at line 91 of file service_manager.cpp.

void ros::ServiceManager::start (  ) 

Definition at line 81 of file service_manager.cpp.

bool ros::ServiceManager::unadvertiseService ( const std::string &  serv_name  ) 

Unadvertise a service.

This call unadvertises a service, which must have been previously advertised, using advertiseService().

After this call completes, it is guaranteed that no further callbacks will be invoked for this service.

This method can be safely called from within a service callback.

Parameters:
serv_name The service to be unadvertised.
Returns:
true on successful unadvertisement, false otherwise.
bool ros::ServiceManager::unregisterService ( const std::string &  service  )  [private]

Definition at line 203 of file service_manager.cpp.


Member Data Documentation

ConnectionManagerPtr ros::ServiceManager::connection_manager_ [private]

Definition at line 134 of file service_manager.h.

PollManagerPtr ros::ServiceManager::poll_manager_ [private]

Definition at line 133 of file service_manager.h.

L_ServicePublication ros::ServiceManager::service_publications_ [private]

Definition at line 124 of file service_manager.h.

Definition at line 125 of file service_manager.h.

L_ServiceServerLink ros::ServiceManager::service_server_links_ [private]

Definition at line 127 of file service_manager.h.

Definition at line 128 of file service_manager.h.

volatile bool ros::ServiceManager::shutting_down_ [private]

Definition at line 130 of file service_manager.h.

boost::recursive_mutex ros::ServiceManager::shutting_down_mutex_ [private]

Definition at line 131 of file service_manager.h.

XMLRPCManagerPtr ros::ServiceManager::xmlrpc_manager_ [private]

Definition at line 135 of file service_manager.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


roscpp
Author(s): Morgan Quigley mquigley@cs.stanford.edu, Josh Faust jfaust@willowgarage.com, Brian Gerkey gerkey@willowgarage.com, Troy Straszheim straszheim@willowgarage.com
autogenerated on Sat Mar 2 13:23:32 2013