SkillID.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include <SimoxUtility/algorithm/string.h>
7 
8 #include <RobotAPI/interface/skills/SkillManagerInterface.h>
9 
10 #include "ProviderID.h"
11 #include "error/Exception.h"
12 
13 namespace armarx
14 {
15  namespace skills
16  {
17  class SkillID
18  {
19  public:
20  static const constexpr char* NAME_SEPARATOR = "/";
21  static const constexpr char* UNKNOWN = "UNKNOWN";
22 
23  bool operator==(const SkillID& other) const;
24  bool operator!=(const SkillID& other) const;
25  bool operator<(const SkillID& other) const;
26  bool operator<=(const SkillID& other) const;
27 
28  bool
30  {
32  }
33 
34  bool
36  {
37  return not skillName.empty();
38  }
39 
40  bool
42  {
43  if (not providerId.has_value())
44  {
45  return false;
46  }
47  return not providerId->providerName.empty();
48  }
49 
50  manager::dto::SkillID toManagerIce() const;
51  provider::dto::SkillID toProviderIce() const;
52 
53  static SkillID FromIce(const manager::dto::SkillID&);
54  static SkillID FromIce(const provider::dto::SkillID&,
55  const std::optional<ProviderID>& providerId = std::nullopt);
56 
57  std::string toString() const;
58 
59  std::optional<ProviderID> providerId = std::nullopt;
60  std::string skillName;
61  };
62 
63  std::ostream& operator<<(std::ostream& os, const SkillID& id);
64  } // namespace skills
65 } // namespace armarx
armarx::skills::SkillID::operator!=
bool operator!=(const SkillID &other) const
Definition: SkillID.cpp:14
armarx::skills::SkillID::toString
std::string toString() const
Definition: SkillID.cpp:64
ProviderID.h
skills
This file is part of ArmarX.
Exception.h
armarx::skills::SkillID::operator==
bool operator==(const SkillID &other) const
Definition: SkillID.cpp:8
armarx::skills::SkillID::skillName
std::string skillName
Definition: SkillID.h:60
armarx::skills::SkillID::isSkillSpecified
bool isSkillSpecified() const
Definition: SkillID.h:35
armarx::skills::SkillID::providerId
std::optional< ProviderID > providerId
Definition: SkillID.h:59
armarx::skills::SkillID::operator<=
bool operator<=(const SkillID &other) const
Definition: SkillID.cpp:26
armarx::skills::SkillID::toManagerIce
manager::dto::SkillID toManagerIce() const
Definition: SkillID.cpp:51
armarx::skills::SkillID::UNKNOWN
static const constexpr char * UNKNOWN
Definition: SkillID.h:21
armarx::skills::SkillID::isProviderSpecified
bool isProviderSpecified() const
Definition: SkillID.h:41
armarx::skills::operator<<
std::ostream & operator<<(std::ostream &os, const ProviderID &id)
Definition: ProviderID.cpp:63
armarx::skills::SkillID::FromIce
static SkillID FromIce(const manager::dto::SkillID &)
Definition: SkillID.cpp:32
armarx::skills::SkillID::operator<
bool operator<(const SkillID &other) const
Definition: SkillID.cpp:20
armarx::skills::SkillID::toProviderIce
provider::dto::SkillID toProviderIce() const
Definition: SkillID.cpp:58
armarx::skills::SkillID
Definition: SkillID.h:17
armarx::skills::SkillID::isFullySpecified
bool isFullySpecified() const
Definition: SkillID.h:29
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::skills::SkillID::NAME_SEPARATOR
static const constexpr char * NAME_SEPARATOR
Definition: SkillID.h:20