parameter_reader.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Amazon.com, Inc. or its affiliates. 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  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <aws/core/client/ClientConfiguration.h>
19 #include <aws/core/utils/StringUtils.h>
21 
22 #include <utility>
23 
24 
25 namespace Aws {
26 namespace Client {
27 
29 {
30 public:
40  explicit ParameterPath(const std::vector<std::string> & node_namespaces,
41  const std::vector<std::string> & parameter_path_keys) :
42  node_namespaces_(node_namespaces), parameter_path_keys_(parameter_path_keys) {}
43 
50  template<typename ...Args>
51  explicit ParameterPath(Args... parameter_path_keys) :
52  parameter_path_keys_(std::vector<std::string> {(parameter_path_keys)...}) {}
53 
59  const ParameterPath operator+(const std::string & addend) const;
60 
66  ParameterPath & operator+=(const std::string & addend);
67 
73  bool operator==(const ParameterPath & other) const
74  {
76  }
77 
89  std::string get_resolved_path(char node_namespace_separator,
90  char parameter_namespace_separator) const;
91 
92 private:
98  std::string get_node_path(char node_namespace_separator) const;
99 
105  std::string get_local_path(char parameter_namespace_separator) const;
106 
112  std::vector<std::string> node_namespaces_;
113  std::vector<std::string> parameter_path_keys_;
114 };
115 
116 
118 {
119 public:
120  virtual ~ParameterReaderInterface() = default;
121 
129  virtual AwsError ReadParam(const ParameterPath & param_path, std::vector<std::string> & out) const = 0;
130 
138  virtual AwsError ReadParam(const ParameterPath & param_path, double & out) const = 0;
139 
147  virtual AwsError ReadParam(const ParameterPath & param_path, int & out) const = 0;
148 
156  virtual AwsError ReadParam(const ParameterPath & param_path, bool & out) const = 0;
157 
165  virtual AwsError ReadParam(const ParameterPath & param_path, Aws::String & out) const = 0;
166 
174  virtual AwsError ReadParam(const ParameterPath & param_path, std::string & out) const = 0;
175 
183  virtual AwsError ReadParam(const ParameterPath & param_path, std::map<std::string, std::string> & out) const = 0;
184 };
185 
186 } // namespace Client
187 } // namespace Aws
ParameterPath & operator+=(const std::string &addend)
const ParameterPath operator+(const std::string &addend) const
bool operator==(const ParameterPath &other) const
std::string get_local_path(char parameter_namespace_separator) const
AwsError
Defines error return codes for functions This enum defines standard error codes that will be returned...
Definition: aws_error.h:29
std::string get_resolved_path(char node_namespace_separator, char parameter_namespace_separator) const
std::vector< std::string > node_namespaces_
std::string get_node_path(char node_namespace_separator) const
ParameterPath(const std::vector< std::string > &node_namespaces, const std::vector< std::string > &parameter_path_keys)
Contains common Error handling functionality for AWS ROS libraries.
ParameterPath(Args...parameter_path_keys)
std::vector< std::string > parameter_path_keys_


aws_common
Author(s): AWS RoboMaker
autogenerated on Sat Mar 6 2021 03:11:38