Gazebo Transport

API Reference

14.1.0
Client.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef GZ_TRANSPORT_PARAMETERS_CLIENT_HH_
19#define GZ_TRANSPORT_PARAMETERS_CLIENT_HH_
20
21#include <memory>
22#include <string>
23
24#include "google/protobuf/message.h"
25
26#include "gz/msgs/parameter_declarations.pb.h"
27
28#include "gz/transport/config.hh"
29#include "gz/transport/Node.hh"
30#include "gz/transport/parameters/Export.hh"
32
33namespace gz::transport::parameters
34{
35 // Inline bracket to help doxygen filtering.
36 inline namespace GZ_TRANSPORT_VERSION_NAMESPACE {
37
38 struct ParametersClientPrivate;
39
42 class GZ_TRANSPORT_PARAMETERS_VISIBLE ParametersClient
43 : public ParametersInterface
44 {
54 const std::string & _serverNamespace = "",
55 unsigned int _timeoutMs = kDefaultTimeoutMs);
56
59
61 public: ParametersClient(const ParametersClient &) = delete;
63 public: ParametersClient & operator=(const ParametersClient &) = delete;
68
72 const std::string & _parameterName,
73 const google::protobuf::Message & _msg) final;
74
78 const std::string & _parameterName,
79 google::protobuf::Message & _parameter) const final;
80
82 const std::string & _parameterName,
83 std::unique_ptr<google::protobuf::Message> & _parameter) const final;
84
88 const std::string & _parameterName,
89 const google::protobuf::Message & _msg) final;
90
94 public: gz::msgs::ParameterDeclarations ListParameters() const final;
95
96#ifdef _WIN32
97// Disable warning C4251 which is triggered by
98// std::unique_ptr
99#pragma warning(push)
100#pragma warning(disable: 4251)
101#endif
104#ifdef _WIN32
105#pragma warning(pop)
106#endif
107
108 private: constexpr static inline unsigned int kDefaultTimeoutMs = 5000;
109 };
110 }
111}
112
113#endif