Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
roswrap::ServiceManager Class Reference

#include <service_manager.h>

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. More...
 
bool lookupService (const std::string &name, std::string &serv_host, uint32_t &serv_port)
 Lookup the host/port of a service. More...
 
ServicePublicationPtr lookupServicePublication (const std::string &service)
 Lookup an advertised service. More...
 
void removeServiceServerLink (const ServiceServerLinkPtr &client)
 Remove the specified service client from our list. More...
 
 ServiceManager ()
 
void shutdown ()
 
void start ()
 
bool unadvertiseService (const std::string &serv_name)
 Unadvertise a service. More...
 
 ~ServiceManager ()
 

Static Public Member Functions

static const ServiceManagerPtrinstance ()
 

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_
 
std::mutex service_publications_mutex_
 
L_ServiceServerLink service_server_links_
 
std::mutex service_server_links_mutex_
 
volatile bool shutting_down_
 
boost::recursive_mutex shutting_down_mutex_
 
XMLRPCManagerPtr xmlrpc_manager_
 

Detailed Description

Definition at line 55 of file service_manager.h.

Constructor & Destructor Documentation

◆ ServiceManager()

roswrap::ServiceManager::ServiceManager ( )

◆ ~ServiceManager()

roswrap::ServiceManager::~ServiceManager ( )

Member Function Documentation

◆ advertiseService()

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

◆ createServiceServerLink()

ServiceServerLinkPtr roswrap::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
serviceThe service to connect to
persistentWhether to keep this connection alive for more than one service call
request_md5sumThe md5sum of the request message
response_md5sumThe md5sum of the response message
Returns
Shared pointer to the ServiceServerLink, empty shared pointer if none is found.

◆ instance()

static const ServiceManagerPtr& roswrap::ServiceManager::instance ( )
static

◆ isServiceAdvertised()

bool roswrap::ServiceManager::isServiceAdvertised ( const std::string &  serv_name)
private

◆ isShuttingDown()

bool roswrap::ServiceManager::isShuttingDown ( )
inlineprivate

Definition at line 128 of file service_manager.h.

◆ lookupService()

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

Lookup the host/port of a service.

Parameters
nameThe name of the service
serv_hostOUT – The host of the service
serv_portOUT – The port of the service

◆ lookupServicePublication()

ServicePublicationPtr roswrap::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
serviceThe service name to look for.
Returns
Pointer to the matching ServicePublication, NULL if none is found.

◆ removeServiceServerLink()

void roswrap::ServiceManager::removeServiceServerLink ( const ServiceServerLinkPtr client)

Remove the specified service client from our list.

Parameters
clientThe client to remove

◆ shutdown()

void roswrap::ServiceManager::shutdown ( )

◆ start()

void roswrap::ServiceManager::start ( )

◆ unadvertiseService()

bool roswrap::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_nameThe service to be unadvertised.
Returns
true on successful unadvertisement, false otherwise.

◆ unregisterService()

bool roswrap::ServiceManager::unregisterService ( const std::string &  service)
private

Member Data Documentation

◆ connection_manager_

ConnectionManagerPtr roswrap::ServiceManager::connection_manager_
private

Definition at line 140 of file service_manager.h.

◆ poll_manager_

PollManagerPtr roswrap::ServiceManager::poll_manager_
private

Definition at line 139 of file service_manager.h.

◆ service_publications_

L_ServicePublication roswrap::ServiceManager::service_publications_
private

Definition at line 130 of file service_manager.h.

◆ service_publications_mutex_

std::mutex roswrap::ServiceManager::service_publications_mutex_
private

Definition at line 131 of file service_manager.h.

◆ service_server_links_

L_ServiceServerLink roswrap::ServiceManager::service_server_links_
private

Definition at line 133 of file service_manager.h.

◆ service_server_links_mutex_

std::mutex roswrap::ServiceManager::service_server_links_mutex_
private

Definition at line 134 of file service_manager.h.

◆ shutting_down_

volatile bool roswrap::ServiceManager::shutting_down_
private

Definition at line 136 of file service_manager.h.

◆ shutting_down_mutex_

boost::recursive_mutex roswrap::ServiceManager::shutting_down_mutex_
private

Definition at line 137 of file service_manager.h.

◆ xmlrpc_manager_

XMLRPCManagerPtr roswrap::ServiceManager::xmlrpc_manager_
private

Definition at line 141 of file service_manager.h.


The documentation for this class was generated from the following file:


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:15