Added discrete threshold trigger support

Implemented discrete threshold logic
Discrete trigger with empty threshold array is handled as 'onChange'
Added unit tests coverage for discrete trigger

Supported scenarios:
-discrete threshold with value and dwell time
-discrete threshold with value, without dwell time
-discrete trigger without threshold ('onChange')

Tests:
-Unit tests passed

Change-Id: Id60a48f4113bd955d97e154888c00d1b6e5490af
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
diff --git a/src/on_change_threshold.hpp b/src/on_change_threshold.hpp
new file mode 100644
index 0000000..0d0f841
--- /dev/null
+++ b/src/on_change_threshold.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "interfaces/sensor.hpp"
+#include "interfaces/sensor_listener.hpp"
+#include "interfaces/threshold.hpp"
+#include "interfaces/trigger_action.hpp"
+#include "interfaces/trigger_types.hpp"
+
+#include <boost/asio/steady_timer.hpp>
+
+#include <chrono>
+#include <memory>
+#include <vector>
+
+class OnChangeThreshold :
+    public interfaces::Threshold,
+    public interfaces::SensorListener,
+    public std::enable_shared_from_this<OnChangeThreshold>
+{
+  public:
+    OnChangeThreshold(
+        std::vector<std::shared_ptr<interfaces::Sensor>> sensors,
+        std::vector<std::string> sensorNames,
+        std::vector<std::unique_ptr<interfaces::TriggerAction>> actions);
+    ~OnChangeThreshold()
+    {}
+
+    void initialize() override;
+    void sensorUpdated(interfaces::Sensor&, uint64_t) override;
+    void sensorUpdated(interfaces::Sensor&, uint64_t, double) override;
+
+  private:
+    const std::vector<std::shared_ptr<interfaces::Sensor>> sensors;
+    const std::vector<std::string> sensorNames;
+    const std::vector<std::unique_ptr<interfaces::TriggerAction>> actions;
+
+    void commit(const std::string&, uint64_t, double);
+};