Skip to content

Commit

Permalink
more fixup after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodall <william@osrfoundation.org>
  • Loading branch information
wjwwood committed Jan 30, 2019
1 parent e114481 commit 4aab3fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions rclcpp/include/rclcpp/parameter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ namespace rclcpp

class Parameter;

namespace node_interfaces{
struct ParameterInfo;
} // namespace node_interfaces

namespace detail
{

Expand Down Expand Up @@ -58,6 +62,9 @@ class Parameter
{
}

RCLCPP_PUBLIC
explicit Parameter(const rclcpp::node_interfaces::ParameterInfo & parameter_info);

RCLCPP_PUBLIC
ParameterType
get_type() const;
Expand Down
2 changes: 1 addition & 1 deletion rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ NodeParameters::get_parameters_by_prefix(
for (const auto & param : parameters_) {
if (param.first.find(prefix_with_dot) == 0 && param.first.length() > prefix_with_dot.length()) {
// Found one!
parameters[param.first.substr(prefix_with_dot.length())] = param.second;
parameters[param.first.substr(prefix_with_dot.length())] = rclcpp::Parameter(param.second);
ret = true;
}
}
Expand Down
9 changes: 8 additions & 1 deletion rclcpp/src/rclcpp/parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "rclcpp/parameter.hpp"

#include <ostream>
#include <sstream>
#include <string>
#include <vector>

#include "rclcpp/parameter.hpp"
#include "rclcpp/node_interfaces/node_parameters.hpp"
#include "rclcpp/utilities.hpp"

using rclcpp::ParameterType;
Expand All @@ -33,6 +35,11 @@ Parameter::Parameter(const std::string & name, const rclcpp::ParameterValue & va
{
}

Parameter::Parameter(const rclcpp::node_interfaces::ParameterInfo & parameter_info)
: Parameter(parameter_info.descriptor.name, parameter_info.value)
{
}

ParameterType
Parameter::get_type() const
{
Expand Down

0 comments on commit 4aab3fe

Please sign in to comment.