Gazebo Transport

API Reference

11.4.1
gz/transport/parameters/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 "ignition/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 
34 {
35  // Inline bracket to help doxygen filtering.
36  inline namespace IGNITION_TRANSPORT_VERSION_NAMESPACE {
37 
38  struct ParametersClientPrivate;
39 
42  class IGNITION_TRANSPORT_PARAMETERS_VISIBLE ParametersClient
43  : public ParametersInterface
44  {
53  public: ParametersClient(
54  const std::string & _serverNamespace = "",
55  unsigned int _timeoutMs = kDefaultTimeoutMs);
56 
58  public: ~ParametersClient();
59 
61  public: ParametersClient(const ParametersClient &) = delete;
63  public: ParametersClient & operator=(const ParametersClient &) = delete;
67  public: ParametersClient & operator=(ParametersClient &&);
68 
71  public: ParameterResult DeclareParameter(
72  const std::string & _parameterName,
73  const google::protobuf::Message & _msg) final;
74 
77  public: ParameterResult Parameter(
78  const std::string & _parameterName,
79  google::protobuf::Message & _parameter) const final;
80 
81  public: ParameterResult Parameter(
82  const std::string & _parameterName,
83  std::unique_ptr<google::protobuf::Message> & _parameter) const final;
84 
87  public: ParameterResult SetParameter(
88  const std::string & _parameterName,
89  const google::protobuf::Message & _msg) final;
90 
94  public: ignition::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
STL class.
The return type used in all falible parameters methods.
Definition: gz/transport/parameters/result.hh:43
Allow to get, set, declare or list parameters.
Definition: gz/transport/parameters/Client.hh:42
Common interface, implemented by ParametersRegistry (local updates) and by ParametersClients (remote ...
Definition: gz/transport/parameters/Interface.hh:41
Definition: gz/transport/parameters/Client.hh:33
STL class.