Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Variables
g
m
Typedefs
a
c
h
i
l
m
n
p
r
s
t
v
w
x
Enumerations
Enumerator
Classes
Class List
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
~
Variables
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
q
r
s
t
u
w
x
Typedefs
a
c
d
e
i
l
m
n
p
q
r
s
t
v
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
Macros
include
ros
service_client_options.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 Stanford University or 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_CLIENT_OPTIONS_H
29
#define ROSCPP_SERVICE_CLIENT_OPTIONS_H
30
31
#include "
ros/forwards.h
"
32
#include "common.h"
33
#include "
ros/service_traits.h
"
34
35
namespace
ros
36
{
37
41
struct
ROSCPP_DECL
ServiceClientOptions
42
{
43
ServiceClientOptions
()
44
: persistent(false)
45
{
46
}
47
48
/*
49
* \brief Constructor
50
* \param _service Name of the service to connect to
51
* \param _md5sum md5sum of the service
52
* \param _persistent Whether or not to keep the connection open to the service for future calls
53
* \param _header Any extra values to be passed along in the connection header
54
*/
55
ServiceClientOptions
(
const
std::string& _service,
const
std::string& _md5sum,
bool
_persistent,
const
M_string
& _header)
56
: service(_service)
57
,
md5sum
(_md5sum)
58
, persistent(_persistent)
59
,
header
(_header)
60
{
61
}
62
63
/*
64
* \brief Templated helper method, preventing you from needing to manually get the service md5sum
65
* \param MReq [template] Request message type
66
* \param MRes [template] Response message type
67
* \param _service Name of the service to connect to
68
* \param _persistent Whether or not to keep the connection open to the service for future calls
69
* \param _header Any extra values to be passed along in the connection header
70
*/
71
template
<
class
MReq,
class
MRes>
72
void
init
(
const
std::string& _service,
bool
_persistent,
const
M_string
& _header)
73
{
74
namespace
st = service_traits;
75
76
service = _service;
77
md5sum
= st::md5sum<MReq>();
78
persistent = _persistent;
79
header
= _header;
80
}
81
82
/*
83
* \brief Templated helper method, preventing you from needing to manually get the service md5sum
84
* \param Service [template] Service type
85
* \param _service Name of the service to connect to
86
* \param _persistent Whether or not to keep the connection open to the service for future calls
87
* \param _header Any extra values to be passed along in the connection header
88
*/
89
template
<
class
Service>
90
void
init
(
const
std::string& _service,
bool
_persistent,
const
M_string
& _header)
91
{
92
namespace
st = service_traits;
93
94
service = _service;
95
md5sum
= st::md5sum<Service>();
96
persistent = _persistent;
97
header
= _header;
98
}
99
100
std::string
service
;
101
std::string
md5sum
;
102
bool
persistent
;
103
M_string
header
;
104
};
105
106
107
}
108
109
#endif
ros::ServiceClientOptions::ServiceClientOptions
ServiceClientOptions()
Definition:
service_client_options.h:43
ros::ServiceClientOptions::init
void init(const std::string &_service, bool _persistent, const M_string &_header)
Definition:
service_client_options.h:72
ros::ServiceClientOptions::init
void init(const std::string &_service, bool _persistent, const M_string &_header)
Definition:
service_client_options.h:90
md5sum
const char * md5sum()
ros::ServiceClientOptions::persistent
bool persistent
Whether or not the connection should persist.
Definition:
service_client_options.h:102
forwards.h
ros
ros::ServiceClientOptions::header
M_string header
Extra key/value pairs to add to the connection header.
Definition:
service_client_options.h:103
ros::ServiceClientOptions
Encapsulates all options available for creating a ServiceClient.
Definition:
service_client_options.h:41
ros::ServiceClientOptions::md5sum
std::string md5sum
Service md5sum.
Definition:
service_client_options.h:101
ros::ServiceClientOptions::ServiceClientOptions
ServiceClientOptions(const std::string &_service, const std::string &_md5sum, bool _persistent, const M_string &_header)
Definition:
service_client_options.h:55
header
const std::string header
ros::ServiceClientOptions::service
std::string service
Service to connect to.
Definition:
service_client_options.h:100
ros::M_string
std::map< std::string, std::string > M_string
service_traits.h
roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:35