3 #include <experimental/memory>
6 #include <shared_mutex>
14 #include <RobotAPI/interface/skills/SkillManagerInterface.h>
33 class SkillProviderComponentPluginUser;
41 using ComponentPlugin::ComponentPlugin;
57 template <
class SkillT,
typename... Args>
62 auto fac = skills::SkillBlueprint::ForSkill<SkillT>(std::forward<Args>(args)...);
63 auto* facPtr = fac.get();
68 template <
typename FactoryT,
typename... Args>
70 requires skills::isSkillBlueprint<FactoryT> FactoryT*
73 auto fac = std::make_unique<FactoryT>(std::forward<Args>(args)...);
74 auto* facPtr = fac.get();
76 return static_cast<FactoryT*
>(facPtr);
80 std::optional<skills::SkillStatusUpdate>
82 std::map<skills::SkillExecutionID, skills::SkillStatusUpdate>
104 skills::manager::dti::SkillManagerInterfacePrx manager;
105 skills::provider::dti::SkillProviderInterfacePrx myPrx;
107 mutable std::shared_mutex skillFactoriesMutex;
108 std::map<skills::SkillID, std::unique_ptr<skills::SkillBlueprint>> skillFactories;
110 mutable std::shared_mutex skillExecutionsMutex;
111 std::map<skills::SkillExecutionID, skills::detail::SkillRuntime> skillExecutions;
122 virtual public skills::provider::dti::SkillProviderInterface
128 IceUtil::Optional<skills::provider::dto::SkillDescription>
130 const Ice::Current& current = Ice::Current())
override;
132 skills::provider::dto::SkillDescriptionMap
135 IceUtil::Optional<skills::provider::dto::SkillStatusUpdate>
137 const Ice::Current& current = Ice::Current())
override;
139 skills::provider::dto::SkillStatusUpdateMap
142 skills::provider::dto::SkillStatusUpdate
143 executeSkill(
const skills::provider::dto::SkillExecutionRequest& executionInfo,
144 const Ice::Current& current = Ice::Current())
override;
146 skills::provider::dto::SkillExecutionID
147 executeSkillAsync(
const skills::provider::dto::SkillExecutionRequest& executionInfo,
148 const Ice::Current& current = Ice::Current())
override;
150 skills::provider::dto::ParameterUpdateResult
153 const Ice::Current& current = Ice::Current())
override;
155 skills::provider::dto::AbortSkillResult
156 abortSkill(
const skills::provider::dto::SkillExecutionID& skill,
157 const Ice::Current& current = Ice::Current())
override;
159 skills::provider::dto::AbortSkillResult
161 const Ice::Current& current = Ice::Current())
override;
175 auto ret = plugin->addSkillFactory(desc, f);
179 template <
class SkillT,
typename... Args>
184 return plugin->addSkillFactory<SkillT>(std::forward<Args>(args)...);
187 template <
typename FacT,
typename... Args>
189 requires skills::isSkillBlueprint<FacT> FacT*
192 return plugin->addCustomSkillFactory<FacT>(std::forward<Args>(args)...);