service_server.h
Go to the documentation of this file.
1 #include "sick_scan/sick_scan_base.h" /* Base definitions included in all header files, added by add_sick_scan_base_header.py. Do not edit this line. */
2 /*
3  * Copyright (C) 2009, Willow Garage, Inc.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the names of Stanford University or Willow Garage, Inc. nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef ROSCPP_SERVICE_HANDLE_H
30 #define ROSCPP_SERVICE_HANDLE_H
31 
32 #include "ros/forwards.h"
33 #include "common.h"
34 
35 namespace roswrap
36 {
37 
47 {
48 public:
50  ServiceServer(const ServiceServer& rhs);
51  ~ServiceServer();
52 
62  void shutdown();
63 
64  std::string getService() const;
65 
66  operator void*() const { return (impl_ && impl_->isValid()) ? (void*)1 : (void*)0; }
67 
68  bool operator<(const ServiceServer& rhs) const
69  {
70  return impl_ < rhs.impl_;
71  }
72 
73  bool operator==(const ServiceServer& rhs) const
74  {
75  return impl_ == rhs.impl_;
76  }
77 
78  bool operator!=(const ServiceServer& rhs) const
79  {
80  return impl_ != rhs.impl_;
81  }
82 
83 private:
84  ServiceServer(const std::string& service, const NodeHandle& node_handle);
85 
86  class Impl
87  {
88  public:
89  Impl();
90  ~Impl();
91 
92  void unadvertise();
93  bool isValid() const;
94 
95  std::string service_;
98  };
99  typedef std::shared_ptr<Impl> ImplPtr;
100  typedef std::weak_ptr<Impl> ImplWPtr;
101 
103 
104  friend class NodeHandle;
105  friend class NodeHandleBackingCollection;
106 };
107 typedef std::vector<ServiceServer> V_ServiceServer;
108 
109 }
110 
111 #endif // ROSCPP_SERVICE_HANDLE_H
112 
113 
roswrap::ServiceServer
Manages an service advertisement.
Definition: service_server.h:46
roswrap::NodeHandlePtr
std::shared_ptr< NodeHandle > NodeHandlePtr
Definition: forwards.h:92
roswrap::ServiceServer::impl_
ImplPtr impl_
Definition: service_server.h:102
roswrap::shutdown
ROSCPP_DECL void shutdown()
Disconnects everything and unregisters from the master. It is generally not necessary to call this fu...
Definition: rossimu.cpp:269
roswrap::V_ServiceServer
std::vector< ServiceServer > V_ServiceServer
Definition: service_server.h:107
roswrap::ServiceServer::Impl::service_
std::string service_
Definition: service_server.h:95
roswrap::ServiceServer::ServiceServer
ServiceServer()
Definition: service_server.h:49
roswrap::ServiceServer::Impl::node_handle_
NodeHandlePtr node_handle_
Definition: service_server.h:96
roswrap::ServiceServer::Impl
Definition: service_server.h:86
roswrap
Definition: param_modi.cpp:41
roswrap::ServiceServer::Impl::unadvertised_
bool unadvertised_
Definition: service_server.h:97
roswrap::NodeHandle
roscpp's interface for creating subscribers, publishers, etc.
Definition: node_handle.h:87
roswrap::ServiceServer::ImplPtr
std::shared_ptr< Impl > ImplPtr
Definition: service_server.h:99
common.h
roswrap::ServiceServer::operator<
bool operator<(const ServiceServer &rhs) const
Definition: service_server.h:68
sick_scan_base.h
roswrap::ServiceServer::ImplWPtr
std::weak_ptr< Impl > ImplWPtr
Definition: service_server.h:100
ROSCPP_DECL
#define ROSCPP_DECL
Definition: roswrap/src/cfgsimu/sick_scan/ros/common.h:63
roswrap::ServiceServer::operator==
bool operator==(const ServiceServer &rhs) const
Definition: service_server.h:73
roswrap::ServiceServer::operator!=
bool operator!=(const ServiceServer &rhs) const
Definition: service_server.h:78


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