OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
MetadataSeries.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <map>
4#include <list>
5#include <MetadataParameter.h>
6#include <MetadataQuantity.h>
7
8class __declspec(dllexport) MetadataSeries
9{
10public:
11 MetadataSeries(const std::string& name):m_name(name){};
12
13 void addParameter(MetadataParameter& parameter) { m_parameter.push_back(parameter); }
14 void addParameter(MetadataParameter&& parameter) { m_parameter.push_back(std::move(parameter)); }
15 void addParameterReference(ot::UID _parameterUID) { m_parameterReferences.push_back(_parameterUID); m_parameterReferences.unique(); };
16
17 void addQuantity(MetadataQuantity& quantity) { m_quantity.push_back(quantity); }
18 void addQuantityReference(ot::UID _quantityUID) { m_quantityReferences.push_back(_quantityUID); m_quantityReferences.unique(); };
19
20 void addMetadata(std::shared_ptr<MetadataEntry> metadata) { m_metaData[metadata->getEntryName()] = metadata; }
21 const std::list<MetadataParameter>& getParameter() const { return m_parameter; }
22 const std::list<MetadataQuantity>& getQuantities() const { return m_quantity; }
23 const std::map <std::string, std::shared_ptr<MetadataEntry>> getMetadata()const { return m_metaData; }
24
25 const std::string getName()const { return m_name; }
26 const std::string getLabel()const { return m_label; }
27 const uint64_t getSeriesIndex() const { return m_index; }
28
31 void setIndex(uint64_t _index) { m_index = _index; };
32 static const std::string getFieldName() { return "Series"; }
33
34 void setLabel(const std::string& _label)
35 {
36 m_label = _label;
37 }
38
39private:
40 const std::string m_name;
41 std::string m_label;
42 ot::UID m_index = 0;
43
44 std::list<MetadataParameter> m_parameter;
45 ot::UIDList m_parameterReferences;
46 std::list<MetadataQuantity> m_quantity;
47 ot::UIDList m_quantityReferences;
48
49 std::map <std::string, std::shared_ptr<MetadataEntry>> m_metaData;
50};
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27
std::list< UID > UIDList
Unique identifier list.
Definition CoreTypes.h:31