InstantKill.cpp
Go to the documentation of this file.
1
2#include "InstantKill.h"
3
4#include <chrono>
5#include <cstdlib>
6#include <thread>
8
10{
11
15
18 {
19 return SkillDescription{.skillId = armarx::skills::SkillID{.skillName = "InstantKill"},
20 .description = "This skill calls Timeout and instantly aboirts it.",
21 .rootProfileDefaults = armarx::aron::make_dict(),
23 }
24
26 InstantKillSkill::main(const MainInput& in)
27 {
28
30
31 skills::SkillID skillId{.providerId = *getSkillId().providerId, .skillName = "Chaining"};
32
33 for (unsigned int i = 0; i < 25; ++i)
34 {
35 auto handle = callSubskillAsync(skillId);
36 handle->abortAsync();
37 }
38 return {TerminatedSkillStatus::Succeeded, nullptr};
39 }
40} // namespace armarx::skills::provider
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition Duration.cpp:48
std::optional< ProviderID > providerId
Definition SkillID.h:40
virtual MainResult main()
Override this method with the actual implementation.
Definition Skill.cpp:542
void throwIfSkillShouldTerminate(const std::string &abortedMessage="") const
Definition Skill.cpp:389
SkillID getSkillId() const
Get the id of the skill.
Definition Skill.cpp:587
SkillExecutionHandlePtr callSubskillAsync(const SkillID &skillId, std::function< void(aron::data::DictPtr &)> parametersFunction)
Definition Skill.cpp:148
static SkillDescription GetSkillDescription()
aron::data::DictPtr make_dict(_Args &&... args)
Definition Dict.h:107
A result struct for th main method of a skill.
Definition Skill.h:62