From 4876b0e3a9022a8dd1490b14c3942eeaaab4b83e Mon Sep 17 00:00:00 2001 From: Julian Tusch <urhrf@student.kit.edu> Date: Sun, 7 Apr 2024 19:08:29 +0200 Subject: [PATCH] create profile now has a return value --- source/RobotAPI/interface/skills/SkillManagerInterface.ice | 2 +- .../skills/manager/SkillManagerComponentPlugin.cpp | 6 ++++-- .../libraries/skills/manager/SkillManagerComponentPlugin.h | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/RobotAPI/interface/skills/SkillManagerInterface.ice b/source/RobotAPI/interface/skills/SkillManagerInterface.ice index 93549e6bb..c2f8e3d81 100644 --- a/source/RobotAPI/interface/skills/SkillManagerInterface.ice +++ b/source/RobotAPI/interface/skills/SkillManagerInterface.ice @@ -220,7 +220,7 @@ module armarx optional(3) dto::FluxioProfile getProfile(string id); - void createProfile(dto::FluxioProfile profile); + dto::FluxioProfile createProfile(dto::FluxioProfile profile); void updateProfile(dto::FluxioProfile profile); dto::FluxioProviderList diff --git a/source/RobotAPI/libraries/skills/manager/SkillManagerComponentPlugin.cpp b/source/RobotAPI/libraries/skills/manager/SkillManagerComponentPlugin.cpp index e0f3de2ec..da4772517 100644 --- a/source/RobotAPI/libraries/skills/manager/SkillManagerComponentPlugin.cpp +++ b/source/RobotAPI/libraries/skills/manager/SkillManagerComponentPlugin.cpp @@ -554,8 +554,9 @@ namespace armarx::plugins return std::nullopt; } - void SkillManagerComponentPlugin::createProfile(skills::FluxioProfile profile){ + skills::FluxioProfile SkillManagerComponentPlugin::createProfile(skills::FluxioProfile profile){ fluxioProfilesMap[profile.id] = profile; + return profile; } void SkillManagerComponentPlugin::updateProfile(skills::FluxioProfile profile){ @@ -914,9 +915,10 @@ namespace armarx return {}; } - void SkillManagerComponentPluginUser::createProfile(skills::manager::dto::FluxioProfile profile,const Ice::Current& current){ + skills::manager::dto::FluxioProfile SkillManagerComponentPluginUser::createProfile(skills::manager::dto::FluxioProfile profile,const Ice::Current& current){ profile.id = IceUtil::generateUUID(); this->plugin->createProfile(skills::FluxioProfile::FromIce(profile)); + return profile; } void SkillManagerComponentPluginUser::updateProfile(skills::manager::dto::FluxioProfile profile,const Ice::Current& current){ diff --git a/source/RobotAPI/libraries/skills/manager/SkillManagerComponentPlugin.h b/source/RobotAPI/libraries/skills/manager/SkillManagerComponentPlugin.h index 90f80519c..b4fc10dd5 100644 --- a/source/RobotAPI/libraries/skills/manager/SkillManagerComponentPlugin.h +++ b/source/RobotAPI/libraries/skills/manager/SkillManagerComponentPlugin.h @@ -71,6 +71,7 @@ namespace armarx::plugins void removeSkill(const std::string& id); bool getSkillMutex(const std::string& skillId, const std::string& userId); + void deleteSkillMutex(const std::string& skillId, const std::string& userId); void removeSkillParameter(const std::string& skillId, const std::string& parameterId); @@ -79,7 +80,7 @@ namespace armarx::plugins std::optional<skills::FluxioProfile> getProfile(const std::string& id); - void createProfile(skills::FluxioProfile profile); + skills::FluxioProfile createProfile(skills::FluxioProfile profile); void updateProfile(skills::FluxioProfile profile); std::vector<skills::FluxioProvider> getProviderList(); @@ -186,7 +187,8 @@ namespace armarx IceUtil::Optional<skills::manager::dto::FluxioProfile> getProfile(const std::string& id,const Ice::Current& current) override; - void createProfile(skills::manager::dto::FluxioProfile profile,const Ice::Current& current) override; + skills::manager::dto::FluxioProfile + createProfile(skills::manager::dto::FluxioProfile profile,const Ice::Current& current) override; void updateProfile(skills::manager::dto::FluxioProfile profile,const Ice::Current& current) override; -- GitLab