This commit is contained in:
2024-10-31 17:17:16 +03:00
parent 222691d2e9
commit 3b1a318ee7
3 changed files with 56 additions and 41 deletions

View File

@@ -122,7 +122,7 @@ public:
AdcGenericDevice& addCommand(CommandT&& cmd)
{
_deviceCommands.insert(std::move(cmd));
_deviceCommands.insert({cmd.ident(), std::move(cmd)});
return *this;
}
@@ -131,9 +131,10 @@ public:
template <typename... CtorArgTs>
AdcGenericDevice& addCommand(CtorArgTs&&... ctor_args)
{
_deviceCommands.emplace(std::forward<CtorArgTs>(ctor_args)...);
// _deviceCommands.emplace(std::forward<CtorArgTs>(ctor_args)...);
return addCommand({std::forward<CtorArgTs>(ctor_args)...});
return *this;
// return *this;
}
AdcGenericDevice& delCommand(const cmd_ident_t& cmd_ident)
@@ -146,7 +147,7 @@ public:
AdcGenericDevice& addAttribute(AttributeT&& attr)
{
_deviceAttributes.insert(std::move(attr));
_deviceAttributes.insert({attr.ident(), std::move(attr)});
return *this;
}
@@ -154,9 +155,11 @@ public:
template <typename... CtorArgTs>
AdcGenericDevice& addAttribute(CtorArgTs&&... ctor_args)
{
_deviceAttributes.emplace(std::forward<CtorArgTs>(ctor_args)...);
// _deviceAttributes.emplace(std::forward<CtorArgTs>(ctor_args)...);
return *this;
return addAttribute({std::forward<CtorArgTs>(ctor_args)...});
// return *this;
}