///
/// HybridTfliteModelSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `TensorflowModelDelegate` to properly resolve imports.
namespace margelo::nitro::tflite { enum class TensorflowModelDelegate; }
// Forward declaration of `Tensor` to properly resolve imports.
namespace margelo::nitro::tflite { struct Tensor; }

#include "TensorflowModelDelegate.hpp"
#include <vector>
#include "Tensor.hpp"
#include <NitroModules/ArrayBuffer.hpp>
#include <NitroModules/Promise.hpp>

namespace margelo::nitro::tflite {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `TfliteModel`
   * Inherit this class to create instances of `HybridTfliteModelSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridTfliteModel: public HybridTfliteModelSpec {
   * public:
   *   HybridTfliteModel(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridTfliteModelSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridTfliteModelSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridTfliteModelSpec() override = default;

    public:
      // Properties
      virtual std::vector<TensorflowModelDelegate> getDelegates() = 0;
      virtual std::vector<Tensor> getInputs() = 0;
      virtual std::vector<Tensor> getOutputs() = 0;

    public:
      // Methods
      virtual std::vector<std::shared_ptr<ArrayBuffer>> runSync(const std::vector<std::shared_ptr<ArrayBuffer>>& input) = 0;
      virtual std::shared_ptr<Promise<std::vector<std::shared_ptr<ArrayBuffer>>>> run(const std::vector<std::shared_ptr<ArrayBuffer>>& input) = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "TfliteModel";
  };

} // namespace margelo::nitro::tflite
