OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
MetadataEntityInterface.h
Go to the documentation of this file.
1#pragma once
2#include "MetadataCampaign.h"
6#include "MetadataEntry.h"
7
8#include <stdint.h>
9
10class __declspec(dllexport) MetadataEntityInterface
11{
12public:
13 MetadataEntityInterface(const std::string& _ownerServiceName);
14 MetadataEntityInterface();
15 MetadataCampaign createCampaign(std::shared_ptr<EntityMetadataCampaign> _rmd, std::list<std::shared_ptr<EntityMetadataSeries>> _msmds);
16 MetadataSeries createSeries(std::shared_ptr<EntityMetadataSeries> _seriesMetadataEntity);
17 void storeCampaign(ot::components::ModelComponent& _modelComponent, MetadataCampaign& _metaDataCampaign);
18 void storeCampaign(ot::components::ModelComponent& _modelComponent, std::list<const MetadataSeries*>& _seriesMetadata, bool _saveModel);
19 void storeCampaign(ot::components::ModelComponent& _modelComponent, MetadataCampaign& _metaDataCampaign, std::list<const MetadataSeries*>& _seriesMetadata, bool _saveModel);
20
21private:
22 const std::string& m_ownerServiceName;
23
24 const std::string m_dataDimensionsField = "DataDimensions";
25 const std::string m_dependingParameterField = "ParameterDependencies";
26 const std::string m_valueDescriptionsField = "ValueDescriptions";
27
28 const std::string m_nameField = "Name";
29 const std::string m_labelField = "Label";
30 const std::string m_unitField = "Unit";
31 const std::string m_dataTypeNameField = "DataTypeName";
32
33 const std::string m_valuesField = "Values";
34
35 std::list<ot::UID> m_newEntityIDs;
36 std::list<ot::UID> m_newEntityVersions;
37
38 void extractCampaignMetadata(MetadataCampaign& _measurementCampaign, std::shared_ptr<EntityMetadataCampaign> _rmd);
39 void extractSeriesMetadata(MetadataCampaign& _measurementCampaign, std::list<std::shared_ptr<EntityMetadataSeries>> _msmds);
40
41 void insertMetadata(EntityWithDynamicFields* _entity, MetadataEntry* _metadata, const std::string _documentName = "");
42
43 std::vector<std::string> convertToStringVector(const MetadataEntry* _metaData)const;
44 std::vector<uint32_t> convertToUInt32Vector(const MetadataEntry* _metaData) const;
45 std::vector<uint64_t> convertToUInt64Vector(const MetadataEntry* _metaData) const;
46 std::string convertToString(const MetadataEntry* _metaData) const;
47 std::list<ot::Variable> convertToVariableList(const MetadataEntry* _metaData)const;
48
49 std::list<ot::Variable> convertFromStringVector(const std::vector<std::string> _values) const;
50 std::list<ot::Variable> convertFromUInt32Vector(const std::vector<uint32_t> _values) const;
51 std::list<ot::Variable> convertFromUInt64Vector(const std::vector<uint64_t> _values) const;
52
53
54 std::list<std::shared_ptr<MetadataEntry>> extractMetadataObjects(const GenericDocument& _document);
55 std::list<std::shared_ptr<MetadataEntry>> extractMetadataFields(const GenericDocument& document);
56};
57
Definition MetadataEntry.h:5
Definition ModelComponent.h:42