Thomas Psota | 0187a4e | 2020-04-30 15:12:54 +0200 | [diff] [blame] | 1 | #ifndef BASYX_SUBMODEL_MAP_V2_QUALIFIER_REFERABLE_H |
| 2 | #define BASYX_SUBMODEL_MAP_V2_QUALIFIER_REFERABLE_H |
| 3 | |
| 4 | #include <BaSyx/submodel/api_v2/qualifier/IReferable.h> |
| 5 | #include <BaSyx/submodel/map_v2/common/LangStringSet.h> |
| 6 | |
| 7 | #include <BaSyx/vab/ElementMap.h> |
| 8 | |
| 9 | namespace basyx { |
| 10 | namespace submodel { |
| 11 | namespace map { |
| 12 | |
| 13 | |
| 14 | class Referable : |
| 15 | public virtual api::IReferable, |
| 16 | public virtual vab::ElementMap |
| 17 | { |
| 18 | public: |
| 19 | struct Path { |
| 20 | static constexpr char IdShort[] = "idShort"; |
| 21 | static constexpr char Category[] = "category"; |
| 22 | static constexpr char Description[] = "description"; |
| 23 | static constexpr char Parent[] = "parent"; |
| 24 | }; |
| 25 | private: |
| 26 | map::LangStringSet description; |
Thomas Psota | de5ea07 | 2020-05-08 19:42:05 +0200 | [diff] [blame] | 27 | const IReferable * const parent = nullptr; |
Thomas Psota | 0187a4e | 2020-04-30 15:12:54 +0200 | [diff] [blame] | 28 | public: |
| 29 | virtual ~Referable() = default; |
| 30 | |
| 31 | // Constructors |
| 32 | Referable(const std::string & idShort, const Referable * parent = nullptr); |
Thomas Psota | de5ea07 | 2020-05-08 19:42:05 +0200 | [diff] [blame] | 33 | //Referable(const IReferable & other); |
Thomas Psota | 0187a4e | 2020-04-30 15:12:54 +0200 | [diff] [blame] | 34 | |
| 35 | // Inherited via IReferable |
| 36 | virtual const std::string & getIdShort() const override; |
| 37 | virtual const std::string * const getCategory() const override; |
| 38 | virtual LangStringSet & getDescription() override; |
| 39 | virtual const LangStringSet & getDescription() const override; |
| 40 | |
| 41 | virtual const IReferable * const getParent() const override; |
| 42 | |
| 43 | // not inherited |
| 44 | void setIdShort(const std::string & shortID); |
| 45 | void setCategory(const std::string & category) override; |
| 46 | |
| 47 | bool hasParent() const noexcept; |
| 48 | bool hasDescription() const noexcept; |
| 49 | bool hasCategory() const noexcept; |
| 50 | }; |
| 51 | |
| 52 | |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | #endif /* BASYX_SUBMODEL_MAP_V2_QUALIFIER_REFERABLE_H */ |