SkillExecutionID.cpp
Go to the documentation of this file.
1#include "SkillExecutionID.h"
2
4
5namespace armarx
6{
7 namespace skills
8 {
9
10 skills::manager::dto::SkillExecutionID
12 {
13 skills::manager::dto::SkillExecutionID ret;
14 ret.skillId = skillId.toManagerIce();
15 ret.executorName = executorName;
16 armarx::core::time::toIce(ret.executionStartedTime, executionStartedTime);
17 return ret;
18 }
19
20 skills::provider::dto::SkillExecutionID
22 {
23 skills::provider::dto::SkillExecutionID ret;
24 ret.skillId = skillId.toProviderIce();
25 ret.executorName = executorName;
26 armarx::core::time::toIce(ret.executionStartedTime, executionStartedTime);
27 return ret;
28 }
29
31 SkillExecutionID::FromIce(const skills::manager::dto::SkillExecutionID& i)
32 {
34 armarx::core::time::fromIce(i.executionStartedTime, t);
35 return {.skillId = skills::SkillID::FromIce(i.skillId),
36 .executorName = i.executorName,
37 .executionStartedTime = t};
38 }
39
41 SkillExecutionID::FromIce(const skills::provider::dto::SkillExecutionID& i,
42 const std::optional<skills::ProviderID>& providerName)
43 {
45 armarx::core::time::fromIce(i.executionStartedTime, t);
46 return {skills::SkillID::FromIce(i.skillId, providerName), i.executorName, t};
47 }
48
49 std::string
51 {
52 return skillId.toString() + ENTER_SEPARATOR + executorName + SEPARATOR +
53 executionStartedTime.toDateTimeString() + EXIT_SEPARATOR;
54 }
55
56 bool
58 {
59 return this->executionStartedTime <= other.executionStartedTime;
60 }
61
62 bool
64 {
65 return this->executionStartedTime < other.executionStartedTime;
66 }
67
68 bool
70 {
71 return this->toString() == other.toString();
72 }
73 } // namespace skills
74} // namespace armarx
Represents a point in time.
Definition DateTime.h:25
static SkillID FromIce(const manager::dto::SkillID &)
Definition SkillID.cpp:36
void toIce(dto::ClockType::ClockTypeEnum &dto, const ClockType &bo)
void fromIce(const dto::ClockType::ClockTypeEnum &dto, ClockType &bo)
This file is part of ArmarX.
This file offers overloads of toIce() and fromIce() functions for STL container types.
skills::provider::dto::SkillExecutionID toProviderIce() const
armarx::core::time::DateTime executionStartedTime
bool operator==(const SkillExecutionID &other) const
bool operator<(const SkillExecutionID &other) const
static const constexpr char * SEPARATOR
bool operator<=(const SkillExecutionID &other) const
static SkillExecutionID FromIce(const skills::manager::dto::SkillExecutionID &)
static const constexpr char * ENTER_SEPARATOR
skills::manager::dto::SkillExecutionID toManagerIce() const
static const constexpr char * EXIT_SEPARATOR