IVGCVSW-7722 Add ArmNNSettings to Opaque Delegate

* Fix order for reading options to read backend first independently of the order given

Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: Ia87b5920c7cd79b3e66bb6e5779e2355b21a7ec6
diff --git a/delegate/opaque/include/armnn_delegate.hpp b/delegate/opaque/include/armnn_delegate.hpp
index b07d96f..ae85556 100644
--- a/delegate/opaque/include/armnn_delegate.hpp
+++ b/delegate/opaque/include/armnn_delegate.hpp
@@ -36,7 +36,7 @@
 /// Forward declaration for functions initializing the ArmNN Delegate
 ::armnnDelegate::DelegateOptions TfLiteArmnnDelegateOptionsDefault();
 
-TfLiteOpaqueDelegate* TfLiteArmnnOpaqueDelegateCreate(const void* settings);
+TfLiteOpaqueDelegate* TfLiteArmnnOpaqueDelegateCreate(armnnDelegate::DelegateOptions options);
 
 void TfLiteArmnnOpaqueDelegateDelete(TfLiteOpaqueDelegate* tfLiteDelegate);
 
@@ -96,16 +96,15 @@
 class ArmnnDelegatePlugin : public DelegatePluginInterface
 {
 public:
-    static std::unique_ptr<ArmnnDelegatePlugin> New(const tflite::TFLiteSettings& tflite_settings)
+    static std::unique_ptr<ArmnnDelegatePlugin> New(const tflite::TFLiteSettings& tfliteSettings)
     {
-        return std::make_unique<ArmnnDelegatePlugin>(tflite_settings);
+        return std::make_unique<ArmnnDelegatePlugin>(tfliteSettings);
     }
 
     tflite::delegates::TfLiteDelegatePtr Create() override
     {
-        // Use default settings until options have been enabled.
-        return tflite::delegates::TfLiteDelegatePtr(
-            TfLiteArmnnOpaqueDelegateCreate(nullptr), TfLiteArmnnOpaqueDelegateDelete);
+        return tflite::delegates::TfLiteDelegatePtr(TfLiteArmnnOpaqueDelegateCreate(m_delegateOptions),
+                                                    TfLiteArmnnOpaqueDelegateDelete);
     }
 
     int GetDelegateErrno(TfLiteOpaqueDelegate* from_delegate) override
@@ -114,9 +113,11 @@
     }
 
     explicit ArmnnDelegatePlugin(const tflite::TFLiteSettings& tfliteSettings)
-    {
-        // Use default settings until options have been enabled.
-    }
+            : m_delegateOptions(ParseArmNNSettings(&tfliteSettings))
+    {}
+
+private:
+    armnnDelegate::DelegateOptions m_delegateOptions;
 };
 
 /// ArmnnSubgraph class where parsing the nodes to ArmNN format and creating the ArmNN Graph