From aafcc64b321b2ac539baf771afe82436c29e5709 Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Thu, 23 Jun 2022 16:06:16 -0700 Subject: [PATCH] Update return types for Plugin's Name and Filename (#1055) Signed-off-by: Nate Koenig Co-authored-by: Nate Koenig --- include/sdf/Plugin.hh | 4 ++-- src/Plugin.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sdf/Plugin.hh b/include/sdf/Plugin.hh index c2cbaec25..05fbc8a52 100644 --- a/include/sdf/Plugin.hh +++ b/include/sdf/Plugin.hh @@ -80,7 +80,7 @@ namespace sdf /// The name of the plugin should be unique within the scope of its /// parent. /// \return Name of the plugin. - public: std::string Name() const; + public: const std::string &Name() const; /// \brief Set the name of the plugin. /// The name of the plugin should be unique within the scope of its @@ -90,7 +90,7 @@ namespace sdf /// \brief Get the filename of the shared library. /// \return Filename of the shared library associated with the plugin. - public: std::string Filename() const; + public: const std::string &Filename() const; /// \brief Remove the contents of the plugin, this is everything that /// is a child element of the ``. diff --git a/src/Plugin.cc b/src/Plugin.cc index 36ac812fe..9bbafc4f0 100644 --- a/src/Plugin.cc +++ b/src/Plugin.cc @@ -125,7 +125,7 @@ Errors Plugin::Load(ElementPtr _sdf) } ///////////////////////////////////////////////// -std::string Plugin::Name() const +const std::string &Plugin::Name() const { return this->dataPtr->name; } @@ -137,7 +137,7 @@ void Plugin::SetName(const std::string &_name) } ///////////////////////////////////////////////// -std::string Plugin::Filename() const +const std::string &Plugin::Filename() const { return this->dataPtr->filename; }