Gazebo Transport

API Reference

11.4.1
gz/transport/parameters/Registry.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_REGISTRY_HH_
19 #define GZ_TRANSPORT_PARAMETERS_REGISTRY_HH_
20 
21 #include <functional>
22 #include <memory>
23 #include <string>
24 
25 #include <google/protobuf/message.h>
26 
27 #include <ignition/msgs/parameter_declarations.pb.h>
28 
29 #include "gz/transport/config.hh"
31 #include "gz/transport/parameters/Export.hh"
33 
35 {
36  // Inline bracket to help doxygen filtering.
37  inline namespace IGNITION_TRANSPORT_VERSION_NAMESPACE {
38 
39  struct ParametersRegistryPrivate;
40 
51  class IGNITION_TRANSPORT_PARAMETERS_VISIBLE ParametersRegistry
52  : public ParametersInterface
53  {
57  public: explicit ParametersRegistry(
58  const std::string & _parametersServicesNamespace);
59 
61  public: ~ParametersRegistry();
62 
64  public: ParametersRegistry(const ParametersRegistry &) = delete;
66  public: ParametersRegistry &operator=(const ParametersRegistry &) = delete;
70  public: ParametersRegistry &operator=(ParametersRegistry &&);
71 
74  public: ParameterResult DeclareParameter(
75  const std::string & _parameterName,
76  const google::protobuf::Message & _msg) final;
77 
80  public: ParameterResult Parameter(
81  const std::string & _parameterName,
82  google::protobuf::Message & _parameter) const final;
83 
84  public: ParameterResult Parameter(
85  const std::string & _parameterName,
86  std::unique_ptr<google::protobuf::Message> & _parameter) const final;
87 
90  public: ParameterResult SetParameter(
91  const std::string & _parameterName,
92  const google::protobuf::Message & _msg) final;
93 
97  public: ignition::msgs::ParameterDeclarations ListParameters() const final;
98 
106  public: ParameterResult DeclareParameter(
107  const std::string & _parameterName,
109 
117  public: ParameterResult SetParameter(
118  const std::string & _parameterName,
120 
121 #ifdef _WIN32
122 // Disable warning C4251 which is triggered by
123 // std::unique_ptr
124 #pragma warning(push)
125 #pragma warning(disable: 4251)
126 #endif
129 #ifdef _WIN32
130 #pragma warning(pop)
131 #endif
132  };
133  }
134 }
135 
136 #endif
STL class.
The return type used in all falible parameters methods.
Definition: gz/transport/parameters/result.hh:43
Common interface, implemented by ParametersRegistry (local updates) and by ParametersClients (remote ...
Definition: gz/transport/parameters/Interface.hh:41
Provides a parameter registry. Parameters can be declared, get or set in the registry....
Definition: gz/transport/parameters/Registry.hh:51
Definition: gz/transport/parameters/Client.hh:33
STL class.