Chaining.cpp
Go to the documentation of this file.
1 
2 
3 #include "Chaining.h"
4 
6 {
7 
8  ChainingSkill::ChainingSkill() : SimpleSkill(GetSkillDescription())
9  {
10  }
11 
14  {
16  .description =
17  "This skill calls the Timeout skill three times. The last "
18  "execution is aborted due to a timeout of this skill.",
20  }
21 
23  ChainingSkill::main(const MainInput& in)
24  {
25  SkillProxy prx(
26  manager,
27  skills::SkillID{.providerId = *getSkillId().providerId, .skillName = "Timeout"});
28 
29  ARMARX_INFO << "CALL PROXY FIRST TIME";
30  callSubskill(prx);
31  ARMARX_INFO << "CALL PROXY SECOND TIME";
32  callSubskill(prx);
33  ARMARX_INFO << "CALL PROXY THIRD TIME";
34  callSubskill(prx);
35 
37 
38  return {TerminatedSkillStatus::Succeeded, nullptr};
39  }
40 } // namespace armarx::skills::provider
armarx::skills::Skill::manager
manager::dti::SkillManagerInterfacePrx manager
Definition: Skill.h:327
armarx::skills::TerminatedSkillStatus::Succeeded
@ Succeeded
armarx::skills::SkillID::skillName
std::string skillName
Definition: SkillID.h:60
armarx::skills::SkillDescription
Definition: SkillDescription.h:18
armarx::skills::provider::ChainingSkill::ChainingSkill
ChainingSkill()
Definition: Chaining.cpp:8
armarx::skills::SkillID::providerId
std::optional< ProviderID > providerId
Definition: SkillID.h:59
armarx::skills::Skill::callSubskill
std::optional< TerminatedSkillStatusUpdate > callSubskill(const skills::SkillProxy &proxy)
Call a subskill with default parameters and block until the subskill terminates.
Definition: Skill.cpp:22
armarx::skills::SkillProxy
Definition: SkillProxy.h:11
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition: SkillDescription.h:20
armarx::skills::provider::ChainingSkill::GetSkillDescription
static SkillDescription GetSkillDescription()
Definition: Chaining.cpp:13
armarx::skills::provider
Definition: BusyWaiting.cpp:6
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition: Skill.h:48
armarx::skills::SimpleSkill
Definition: SimpleSkill.h:9
armarx::skills::SimpleSkill::main
MainResult main() final
Override this method with the actual implementation. The callback is for status updates to the callin...
Definition: SimpleSkill.cpp:15
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::skills::Skill::throwIfSkillShouldTerminate
void throwIfSkillShouldTerminate(const std::string &abortedMessage="")
Definition: Skill.cpp:291
armarx::skills::SkillID
Definition: SkillID.h:17
armarx::skills::Skill::getSkillId
SkillID getSkillId() const
Get the id of the skill.
Definition: Skill.h:74
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition: Duration.cpp:55
Chaining.h