BusyWaiting.cpp
Go to the documentation of this file.
1 #include "BusyWaiting.h"
2 
3 #include <chrono>
4 #include <thread>
5 
7 {
8 
10  {
11  }
12 
15  {
16  return SkillDescription{.skillId = SkillID{.skillName = "BusyWaiting"},
17  .description = "This skill takes two seconds",
19  }
20 
22  BusyWaitingSkill::main(const MainInput& in)
23  {
24  for (unsigned int i = 0; i < 10; i++)
25  {
27  std::this_thread::sleep_for(std::chrono::milliseconds(200));
28  }
29 
30  return {TerminatedSkillStatus::Succeeded, nullptr};
31  }
32 } // namespace armarx::skills::provider
BusyWaiting.h
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::BusyWaitingSkill::BusyWaitingSkill
BusyWaitingSkill()
Definition: BusyWaiting.cpp:9
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition: SkillDescription.h:20
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::skills::provider::BusyWaitingSkill::GetSkillDescription
static SkillDescription GetSkillDescription()
Definition: BusyWaiting.cpp:14
armarx::skills::Skill::throwIfSkillShouldTerminate
void throwIfSkillShouldTerminate(const std::string &abortedMessage="")
Definition: Skill.cpp:291
armarx::skills::SkillID
Definition: SkillID.h:17
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition: Duration.cpp:55