service_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009, Willow Garage, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice,
7  * this list of conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution.
11  * * Neither the names of Willow Garage, Inc. nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef ROSCPP_SERVICE_MANAGER_H
29 #define ROSCPP_SERVICE_MANAGER_H
30 
31 #include "forwards.h"
32 #include "common.h"
34 #include "service_client_options.h"
35 
36 #include <boost/thread/mutex.hpp>
37 #include <boost/thread/recursive_mutex.hpp>
38 
39 namespace ros
40 {
41 
42 class ServiceManager;
44 
45 class PollManager;
47 
48 class XMLRPCManager;
50 
51 class ConnectionManager;
53 
54 class ROSCPP_DECL ServiceManager
55 {
56 public:
57  static const ServiceManagerPtr& instance();
58 
60  ~ServiceManager();
61 
72  ServicePublicationPtr lookupServicePublication(const std::string& service);
73 
83  ServiceServerLinkPtr createServiceServerLink(const std::string& service,
84  bool persistent,
85  const std::string& request_md5sum, const std::string& response_md5sum,
86  const M_string& header_values);
87 
92  void removeServiceServerLink(const ServiceServerLinkPtr& client);
93 
100  bool lookupService(const std::string& name, std::string& serv_host, uint32_t& serv_port);
101 
116  bool unadvertiseService(const std::string& serv_name);
117 
118  bool advertiseService(const AdvertiseServiceOptions& ops);
119 
120  void start();
121  void shutdown();
122 private:
123 
124  bool isServiceAdvertised(const std::string& serv_name);
125  bool unregisterService(const std::string& service);
126 
127  bool isShuttingDown() { return shutting_down_; }
128 
131 
134 
135  volatile bool shutting_down_;
136  boost::recursive_mutex shutting_down_mutex_;
137 
141 };
142 
143 } // namespace ros
144 
145 #endif // ROSCPP_SERVICE_MANAGER_H
service_client_options.h
boost::shared_ptr< ServiceManager >
forwards.h
ros::ServiceManager
Definition: service_manager.h:54
ros
ros::ServiceManager::service_publications_mutex_
boost::mutex service_publications_mutex_
Definition: service_manager.h:130
ros::ServiceManagerPtr
boost::shared_ptr< ServiceManager > ServiceManagerPtr
Definition: forwards.h:189
ros::shutdown
ROSCPP_DECL void shutdown()
Disconnects everything and unregisters from the master. It is generally not necessary to call this fu...
Definition: init.cpp:605
ros::L_ServiceServerLink
std::list< ServiceServerLinkPtr > L_ServiceServerLink
Definition: forwards.h:87
ros::ServiceManager::service_server_links_mutex_
boost::mutex service_server_links_mutex_
Definition: service_manager.h:133
ros::ServiceManager::shutting_down_mutex_
boost::recursive_mutex shutting_down_mutex_
Definition: service_manager.h:136
advertise_service_options.h
ros::ServiceManager::xmlrpc_manager_
XMLRPCManagerPtr xmlrpc_manager_
Definition: service_manager.h:140
ros::ServiceManager::service_publications_
L_ServicePublication service_publications_
Definition: service_manager.h:129
ros::ServiceManager::isShuttingDown
bool isShuttingDown()
Definition: service_manager.h:127
ros::AdvertiseServiceOptions
Encapsulates all options available for creating a ServiceServer.
Definition: advertise_service_options.h:43
ros::start
ROSCPP_DECL void start()
Actually starts the internals of the node (spins up threads, starts the network polling and xmlrpc lo...
Definition: init.cpp:294
ros::ConnectionManagerPtr
boost::shared_ptr< ConnectionManager > ConnectionManagerPtr
Definition: connection_manager.h:41
ros::PollManagerPtr
boost::shared_ptr< PollManager > PollManagerPtr
Definition: connection_manager.h:38
ros::XMLRPCManagerPtr
boost::shared_ptr< XMLRPCManager > XMLRPCManagerPtr
Definition: forwards.h:195
ros::ServiceManager::connection_manager_
ConnectionManagerPtr connection_manager_
Definition: service_manager.h:139
ros::L_ServicePublication
std::list< ServicePublicationPtr > L_ServicePublication
Definition: forwards.h:83
ros::ServiceManager::service_server_links_
L_ServiceServerLink service_server_links_
Definition: service_manager.h:132
ros::M_string
std::map< std::string, std::string > M_string
ros::ServiceManager::poll_manager_
PollManagerPtr poll_manager_
Definition: service_manager.h:138
ros::ServiceManager::shutting_down_
volatile bool shutting_down_
Definition: service_manager.h:135


roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas , Jacob Perron
autogenerated on Thu Nov 23 2023 04:01:44