Apollo 10.0
自动驾驶开放平台
parameter_client.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
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#ifndef CYBER_PARAMETER_PARAMETER_CLIENT_H_
18#define CYBER_PARAMETER_PARAMETER_CLIENT_H_
19
20#include <memory>
21#include <string>
22#include <vector>
23
24#include "cyber/proto/parameter.pb.h"
25
28
29namespace apollo {
30namespace cyber {
31
32class Node;
33
40 public:
55 ParameterClient(const std::shared_ptr<Node>& node,
56 const std::string& service_node_name);
57
66 bool GetParameter(const std::string& param_name, Parameter* parameter);
67
77 bool SetParameter(const Parameter& parameter);
78
86 bool ListParameters(std::vector<Parameter>* parameters);
87
88 private:
89 std::shared_ptr<Node> node_;
90 std::shared_ptr<GetParameterClient> get_parameter_client_;
91 std::shared_ptr<SetParameterClient> set_parameter_client_;
92 std::shared_ptr<ListParametersClient> list_parameters_client_;
93};
94
95} // namespace cyber
96} // namespace apollo
97
98#endif // CYBER_PARAMETER_PARAMETER_CLIENT_H_
Definition node.h:31
Client get Response from a responding Service by sending a Request
Definition client.h:47
Parameter Client is used to set/get/list parameter(s) by sending a request to ParameterServer
bool ListParameters(std::vector< Parameter > *parameters)
Get all the Parameter objects
Client< Param, BoolResult > SetParameterClient
Client< NodeName, Params > ListParametersClient
bool SetParameter(const Parameter &parameter)
Set the Parameter object
bool GetParameter(const std::string &param_name, Parameter *parameter)
Get the Parameter object
Client< ParamName, Param > GetParameterClient
A Parameter holds an apollo::cyber::proto::Param, It's more human-readable, you can use basic-value t...
Definition parameter.h:42
class register implement
Definition arena_queue.h:37