Fledge
An open source edge computing platform for industrial users
OMFHint.h
1 #ifndef _OMF_HINT_H
2 #define _OMF_HINT_H
3 
4 #include <rapidjson/document.h>
5 
9 class OMFHint
10 {
11  public:
12  virtual ~OMFHint() = default;
13  const std::string& getHint() const { return m_hint; };
14  protected:
15  std::string m_hint;
16 };
17 
22 class OMFNumberHint : public OMFHint
23 {
24  public:
25  OMFNumberHint(const std::string& type) { m_hint = type; };
26  ~OMFNumberHint() {};
27 };
28 
33 class OMFIntegerHint : public OMFHint
34 {
35 public:
36  OMFIntegerHint(const std::string& type) { m_hint = type; };
37  ~OMFIntegerHint() {};
38 };
39 
40 
44 class OMFTagHint : public OMFHint
45 {
46  public:
47  OMFTagHint(const std::string& tag) { m_hint = tag; };
48  ~OMFTagHint() {};
49 };
50 
54 class OMFTypeNameHint : public OMFHint
55 {
56  public:
57  OMFTypeNameHint(const std::string& name) { m_hint = name; };
58  ~OMFTypeNameHint() {};
59 };
60 
64 class OMFTagNameHint : public OMFHint
65 {
66  public:
67  OMFTagNameHint(const std::string& name) { m_hint = name; };
68  ~OMFTagNameHint() {};
69 };
70 
75 {
76  public:
77  OMFTagNameDatapointHint(const std::string &name) { m_hint = name; };
79 };
80 
84 class OMFAFLocationHint : public OMFHint
85 {
86 public:
87  OMFAFLocationHint(const std::string& name) { m_hint = name; };
88  ~OMFAFLocationHint() {};
89 };
90 
94 class OMFLegacyTypeHint : public OMFHint
95 {
96 public:
97  OMFLegacyTypeHint(const std::string& name) { m_hint = name; };
98  ~OMFLegacyTypeHint() {};
99 };
100 
104 class OMFSourceHint : public OMFHint
105 {
106 public:
107  OMFSourceHint(const std::string& name) { m_hint = name; };
108  ~OMFSourceHint() {};
109 };
110 
114 class OMFUOMHint : public OMFHint
115 {
116 public:
117  OMFUOMHint(const std::string& name) { m_hint = name; };
118  ~OMFUOMHint() {};
119 };
120 
121 
125 class OMFMinimumHint : public OMFHint
126 {
127 public:
128  OMFMinimumHint(const std::string& name) { m_hint = name; };
129  ~OMFMinimumHint() {};
130 };
131 
132 
136 class OMFMaximumHint : public OMFHint
137 {
138 public:
139  OMFMaximumHint(const std::string& name) { m_hint = name; };
140  ~OMFMaximumHint() {};
141 };
142 
147 {
148 public:
149  OMFInterpolationHint(const std::string& name) { m_hint = name; };
150  ~OMFInterpolationHint() {};
151 };
160 class OMFHints
161 {
162  public:
163  OMFHints(const std::string& hints);
164  ~OMFHints();
165  const std::vector<OMFHint *>&
166  getHints() const { return m_hints; };
167  const std::vector<OMFHint *>&
168  getHints(const std::string&) const;
169  const unsigned short getChecksum() { return m_chksum; };
170  static string getHintForChecksum(const string &hint);
171  private:
172  rapidjson::Document m_doc;
173  unsigned short m_chksum;
174  std::vector<OMFHint *> m_hints;
175  std::map<std::string, std::vector<OMFHint *> > m_datapointHints;
176 };
177 #endif
OMFTypeNameHint
A Type name hint, tells us how to name the types we use.
Definition: OMFHint.h:54
OMFAFLocationHint
A AFLocation hint, tells us in which Asset Framework hierarchy the asset should be created.
Definition: OMFHint.h:84
OMFSourceHint
A Source hint, defines the data source for the asset or datapoint.
Definition: OMFHint.h:104
OMFUOMHint
A unit of measurement hint, defines the unit of measurement for a datapoint.
Definition: OMFHint.h:114
OMFHints::getHintForChecksum
static string getHintForChecksum(const string &hint)
Extracts from a complete OMF hint the part on which the checksum should be generated,...
Definition: omfhints.cpp:39
OMFTagNameHint
A tag name hint, tells us which Container name to use in PI.
Definition: OMFHint.h:64
OMFLegacyTypeHint
A Legacy type hint, tells the OMF plugin to send complex types for this asset.
Definition: OMFHint.h:94
OMFNumberHint
A number hint, defines how number type should be defined, float64 or float32.
Definition: OMFHint.h:22
OMFMinimumHint
A minimum hint, defines the minimum value for a property.
Definition: OMFHint.h:125
OMFMaximumHint
A maximum hint, defines the maximum value for a property.
Definition: OMFHint.h:136
OMFIntegerHint
A integer hint, defines how integer type should be defined, int64, int32 or int16.
Definition: OMFHint.h:33
OMFInterpolationHint
A interpolation hint, defines the interpolation value for a property.
Definition: OMFHint.h:146
OMFHints::OMFHints
OMFHints(const std::string &hints)
Decodes the OMFhint in JSON format assigning the values to the memory structures: m_chksum,...
Definition: omfhints.cpp:82
OMFTagNameDatapointHint
A tag name hint, defines which PI Tag to use for a Datapoint.
Definition: OMFHint.h:74
OMFTagHint
A tag hint, used to define an existing OMF container or tag to use.
Definition: OMFHint.h:44
OMFHint
Virtual base class for an OMF Hint.
Definition: OMFHint.h:9
OMFHints
A set of hints for a reading.
Definition: OMFHint.h:160
OMFHints::~OMFHints
~OMFHints()
Destructor for Hints class.
Definition: omfhints.cpp:309