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 
71 
75 class OMFAFLocationHint : public OMFHint
76 {
77 public:
78  OMFAFLocationHint(const std::string& name) { m_hint = name; };
79  ~OMFAFLocationHint() {};
80 };
81 
85 class OMFLegacyTypeHint : public OMFHint
86 {
87 public:
88  OMFLegacyTypeHint(const std::string& name) { m_hint = name; };
89  ~OMFLegacyTypeHint() {};
90 };
91 
95 class OMFSourceHint : public OMFHint
96 {
97 public:
98  OMFSourceHint(const std::string& name) { m_hint = name; };
99  ~OMFSourceHint() {};
100 };
101 
105 class OMFUOMHint : public OMFHint
106 {
107 public:
108  OMFUOMHint(const std::string& name) { m_hint = name; };
109  ~OMFUOMHint() {};
110 };
111 
112 
116 class OMFMinimumHint : public OMFHint
117 {
118 public:
119  OMFMinimumHint(const std::string& name) { m_hint = name; };
120  ~OMFMinimumHint() {};
121 };
122 
123 
127 class OMFMaximumHint : public OMFHint
128 {
129 public:
130  OMFMaximumHint(const std::string& name) { m_hint = name; };
131  ~OMFMaximumHint() {};
132 };
133 
138 {
139 public:
140  OMFInterpolationHint(const std::string& name) { m_hint = name; };
141  ~OMFInterpolationHint() {};
142 };
151 class OMFHints
152 {
153  public:
154  OMFHints(const std::string& hints);
155  ~OMFHints();
156  const std::vector<OMFHint *>&
157  getHints() const { return m_hints; };
158  const std::vector<OMFHint *>&
159  getHints(const std::string&) const;
160  const unsigned short getChecksum() { return m_chksum; };
161  static string getHintForChecksum(const string &hint);
162  private:
163  rapidjson::Document m_doc;
164  unsigned short m_chksum;
165  std::vector<OMFHint *> m_hints;
166  std::map<std::string, std::vector<OMFHint *> > m_datapointHints;
167 };
168 #endif
A AFLocation hint, tells use in which Asset Framework hierarchy the asset should be created...
Definition: OMFHint.h:75
A minimum hint, defines the minimum value for a property.
Definition: OMFHint.h:116
A interpolation hint, defines the interpolation value for a property.
Definition: OMFHint.h:137
A Type name hint, tells us how to name the types we use.
Definition: OMFHint.h:54
A integer hint, defines how ineteger type should be defined, int64, int32 o int16.
Definition: OMFHint.h:33
A Legacy type hint, tells the OMF plugin to send complex types for this asset.
Definition: OMFHint.h:85
A maximum hint, defines the maximum value for a property.
Definition: OMFHint.h:127
A number hint, defines how number type should be defined, float64 or float32.
Definition: OMFHint.h:22
A tag hint, used to define an existing OMF container or tag to use.
Definition: OMFHint.h:44
A set of hints for a reading.
Definition: OMFHint.h:151
Virtual base class for an OMF Hint.
Definition: OMFHint.h:9
A unit of measurement hint, defines the unit of measurement for a datapoint.
Definition: OMFHint.h:105
A tag name hint, tells us whuch tag name ot use in PI.
Definition: OMFHint.h:64
A Source hint, defines the data source for the asset or datapoint.
Definition: OMFHint.h:95