jwendelil4 | ee5bf28 | 2020-05-25 16:20:07 +0200 | [diff] [blame] | 1 | #include <BaSyx/submodel/map_v2/dataspecification/DataSpecification.h> |
| 2 | #include <BaSyx/vab/ElementMap.h> |
| 3 | |
| 4 | namespace basyx { |
| 5 | namespace submodel { |
| 6 | namespace map{ |
| 7 | |
| 8 | using namespace basyx::submodel::api; |
| 9 | |
Constantin Ziesche | 02817f1 | 2020-08-04 21:40:43 +0200 | [diff] [blame^] | 10 | DataSpecification::DataSpecification(const std::string & idShort, const simple::Identifier & identifier, std::unique_ptr<DataSpecificationContent> content) |
jwendelil4 | ee5bf28 | 2020-05-25 16:20:07 +0200 | [diff] [blame] | 11 | : Identifiable(idShort, identifier) |
| 12 | , vab::ElementMap() |
| 13 | { |
| 14 | this->setContent(std::move(content)); |
| 15 | } |
| 16 | |
Constantin Ziesche | 02817f1 | 2020-08-04 21:40:43 +0200 | [diff] [blame^] | 17 | DataSpecification::DataSpecification(const std::string &idShort, const simple::Identifier &identifier) |
| 18 | : Identifiable(idShort, identifier) |
| 19 | , vab::ElementMap{} |
| 20 | {} |
| 21 | |
| 22 | void DataSpecification::setContent(std::unique_ptr<DataSpecificationContent> dataSpecificationContent) |
jwendelil4 | ee5bf28 | 2020-05-25 16:20:07 +0200 | [diff] [blame] | 23 | { |
Constantin Ziesche | 02817f1 | 2020-08-04 21:40:43 +0200 | [diff] [blame^] | 24 | this->content = std::move(dataSpecificationContent); |
| 25 | auto element_map = dynamic_cast<vab::ElementMap*>(this->content.get()); |
| 26 | this->map.insertKey("dataSpecificationContent", element_map->getMap()); |
jwendelil4 | ee5bf28 | 2020-05-25 16:20:07 +0200 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | api::IDataSpecificationContent& DataSpecification::getContent() |
| 30 | { |
| 31 | return *this->content; |
| 32 | } |
| 33 | |
| 34 | } |
| 35 | } |
| 36 | } |