diff options
| author | James Feist <james.feist@linux.intel.com> | 2018-03-23 14:15:56 -0700 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-04-10 15:58:28 +0000 |
| commit | f7509067e6d6dd0188d7ce84612161cc5d7a45cb (patch) | |
| tree | c95d5608e744d496de9dbc039bc6b50ae211a90f | |
| parent | a4b4a0be8b3529112dbb26b0ae941186ae667666 (diff) | |
| download | sdbusplus-f7509067e6d6dd0188d7ce84612161cc5d7a45cb.tar.gz sdbusplus-f7509067e6d6dd0188d7ce84612161cc5d7a45cb.zip | |
Allow property called 'name' in interface
Currently if a property named 'name' is added, it collides
with the parameter name. Rename the parameter to _name so
this won't happen.
Tested: Added a property named name to interface and
bitbake phosphor-dbus-interfaces
Change-Id: Iee685612276e1bf2515bcb32c41e21487f344471
Signed-off-by: James Feist <james.feist@linux.intel.com>
| -rw-r--r-- | tools/sdbusplus/templates/interface.mako.server.cpp.in | 8 | ||||
| -rw-r--r-- | tools/sdbusplus/templates/interface.mako.server.hpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tools/sdbusplus/templates/interface.mako.server.cpp.in b/tools/sdbusplus/templates/interface.mako.server.cpp.in index 821f42a..7a2a798 100644 --- a/tools/sdbusplus/templates/interface.mako.server.cpp.in +++ b/tools/sdbusplus/templates/interface.mako.server.cpp.in @@ -146,11 +146,11 @@ static const auto _property_${p.name} = % endfor % if interface.properties: -void ${classname}::setPropertyByName(const std::string& name, +void ${classname}::setPropertyByName(const std::string& _name, const PropertiesVariant& val) { % for p in interface.properties: - if (name == "${p.name}") + if (_name == "${p.name}") { auto& v = message::variant_ns::get<${p.cppTypeParam(interface.name)}>(\ val); @@ -160,11 +160,11 @@ val); % endfor } -auto ${classname}::getPropertyByName(const std::string& name) -> +auto ${classname}::getPropertyByName(const std::string& _name) -> PropertiesVariant { % for p in interface.properties: - if (name == "${p.name}") + if (_name == "${p.name}") { return ${p.camelCase}(); } diff --git a/tools/sdbusplus/templates/interface.mako.server.hpp b/tools/sdbusplus/templates/interface.mako.server.hpp index d9fec9d..9ca67e0 100644 --- a/tools/sdbusplus/templates/interface.mako.server.hpp +++ b/tools/sdbusplus/templates/interface.mako.server.hpp @@ -86,17 +86,17 @@ ${p.camelCase}(${p.cppTypeParam(interface.name)} value); % if interface.properties: /** @brief Sets a property by name. - * @param[in] name - A string representation of the property name. + * @param[in] _name - A string representation of the property name. * @param[in] val - A variant containing the value to set. */ - void setPropertyByName(const std::string& name, + void setPropertyByName(const std::string& _name, const PropertiesVariant& val); /** @brief Gets a property by name. - * @param[in] name - A string representation of the property name. + * @param[in] _name - A string representation of the property name. * @return - A variant containing the value of the property. */ - PropertiesVariant getPropertyByName(const std::string& name); + PropertiesVariant getPropertyByName(const std::string& _name); % endif % for e in interface.enums: |

