blob: ad73e2c672652de28638d3aadb1e6d3a5dd0a050 [file] [log] [blame]
jwendelil4ee5bf282020-05-25 16:20:07 +02001#include <BaSyx/submodel/map_v2/dataspecification/DataSpecification.h>
2#include <BaSyx/vab/ElementMap.h>
3
4namespace basyx {
5namespace submodel {
6namespace map{
7
8using namespace basyx::submodel::api;
9
Constantin Ziesche02817f12020-08-04 21:40:43 +020010DataSpecification::DataSpecification(const std::string & idShort, const simple::Identifier & identifier, std::unique_ptr<DataSpecificationContent> content)
jwendelil4ee5bf282020-05-25 16:20:07 +020011 : Identifiable(idShort, identifier)
12 , vab::ElementMap()
13{
14 this->setContent(std::move(content));
15}
16
Constantin Ziesche02817f12020-08-04 21:40:43 +020017DataSpecification::DataSpecification(const std::string &idShort, const simple::Identifier &identifier)
18 : Identifiable(idShort, identifier)
19 , vab::ElementMap{}
20{}
21
22void DataSpecification::setContent(std::unique_ptr<DataSpecificationContent> dataSpecificationContent)
jwendelil4ee5bf282020-05-25 16:20:07 +020023{
Constantin Ziesche02817f12020-08-04 21:40:43 +020024 this->content = std::move(dataSpecificationContent);
25 auto element_map = dynamic_cast<vab::ElementMap*>(this->content.get());
26 this->map.insertKey("dataSpecificationContent", element_map->getMap());
jwendelil4ee5bf282020-05-25 16:20:07 +020027}
28
29api::IDataSpecificationContent& DataSpecification::getContent()
30{
31 return *this->content;
32}
33
34}
35}
36}