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

#pragma once

#include "HybridElectrocardiogramModuleSpec.hpp"

// Forward declaration of `HybridElectrocardiogramModuleSpec_cxx` to properly resolve imports.
namespace ReactNativeHealthkit { class HybridElectrocardiogramModuleSpec_cxx; }

// Forward declaration of `ElectrocardiogramSample` to properly resolve imports.
namespace margelo::nitro::healthkit { struct ElectrocardiogramSample; }
// Forward declaration of `ElectrocardiogramClassification` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class ElectrocardiogramClassification; }
// Forward declaration of `ElectrocardiogramSymptomsStatus` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class ElectrocardiogramSymptomsStatus; }
// Forward declaration of `ElectrocardiogramVoltage` to properly resolve imports.
namespace margelo::nitro::healthkit { struct ElectrocardiogramVoltage; }
// Forward declaration of `ElectrocardiogramLead` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class ElectrocardiogramLead; }
// Forward declaration of `SampleType` to properly resolve imports.
namespace margelo::nitro::healthkit { struct SampleType; }
// Forward declaration of `SourceRevision` to properly resolve imports.
namespace margelo::nitro::healthkit { struct SourceRevision; }
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
// Forward declaration of `Device` to properly resolve imports.
namespace margelo::nitro::healthkit { struct Device; }
// Forward declaration of `ECGQueryOptionsWithSortOrder` to properly resolve imports.
namespace margelo::nitro::healthkit { struct ECGQueryOptionsWithSortOrder; }
// Forward declaration of `FilterForSamples` to properly resolve imports.
namespace margelo::nitro::healthkit { struct FilterForSamples; }
// Forward declaration of `FilterForSamplesBase` to properly resolve imports.
namespace margelo::nitro::healthkit { struct FilterForSamplesBase; }
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
// Forward declaration of `ComparisonPredicateOperator` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class ComparisonPredicateOperator; }
// Forward declaration of `DateFilter` to properly resolve imports.
namespace margelo::nitro::healthkit { struct DateFilter; }
// Forward declaration of `HybridWorkoutProxySpec` to properly resolve imports.
namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
// Forward declaration of `ElectrocardiogramSamplesWithAnchorResponse` to properly resolve imports.
namespace margelo::nitro::healthkit { struct ElectrocardiogramSamplesWithAnchorResponse; }
// Forward declaration of `DeletedSample` to properly resolve imports.
namespace margelo::nitro::healthkit { struct DeletedSample; }
// Forward declaration of `ECGQueryOptionsWithAnchor` to properly resolve imports.
namespace margelo::nitro::healthkit { struct ECGQueryOptionsWithAnchor; }

#include "ElectrocardiogramSample.hpp"
#include <vector>
#include <NitroModules/Promise.hpp>
#include "ElectrocardiogramClassification.hpp"
#include "ElectrocardiogramSymptomsStatus.hpp"
#include <optional>
#include "ElectrocardiogramVoltage.hpp"
#include "ElectrocardiogramLead.hpp"
#include "SampleType.hpp"
#include <string>
#include <chrono>
#include <NitroModules/AnyMap.hpp>
#include "SourceRevision.hpp"
#include <memory>
#include "HybridSourceProxySpec.hpp"
#include "Device.hpp"
#include "ECGQueryOptionsWithSortOrder.hpp"
#include "FilterForSamples.hpp"
#include "FilterForSamplesBase.hpp"
#include "PredicateWithMetadataKey.hpp"
#include "ComparisonPredicateOperator.hpp"
#include <variant>
#include "DateFilter.hpp"
#include "HybridWorkoutProxySpec.hpp"
#include "ElectrocardiogramSamplesWithAnchorResponse.hpp"
#include "DeletedSample.hpp"
#include "ECGQueryOptionsWithAnchor.hpp"

#include "ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp"

namespace margelo::nitro::healthkit {

  /**
   * The C++ part of HybridElectrocardiogramModuleSpec_cxx.swift.
   *
   * HybridElectrocardiogramModuleSpecSwift (C++) accesses HybridElectrocardiogramModuleSpec_cxx (Swift), and might
   * contain some additional bridging code for C++ <> Swift interop.
   *
   * Since this obviously introduces an overhead, I hope at some point in
   * the future, HybridElectrocardiogramModuleSpec_cxx can directly inherit from the C++ class HybridElectrocardiogramModuleSpec
   * to simplify the whole structure and memory management.
   */
  class HybridElectrocardiogramModuleSpecSwift: public virtual HybridElectrocardiogramModuleSpec {
  public:
    // Constructor from a Swift instance
    explicit HybridElectrocardiogramModuleSpecSwift(const ReactNativeHealthkit::HybridElectrocardiogramModuleSpec_cxx& swiftPart):
      HybridObject(HybridElectrocardiogramModuleSpec::TAG),
      _swiftPart(swiftPart) { }

  public:
    // Get the Swift part
    inline ReactNativeHealthkit::HybridElectrocardiogramModuleSpec_cxx& getSwiftPart() noexcept {
      return _swiftPart;
    }

  public:
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }
    bool equals(const std::shared_ptr<HybridObject>& other) override {
      if (auto otherCast = std::dynamic_pointer_cast<HybridElectrocardiogramModuleSpecSwift>(other)) {
        return _swiftPart.equals(otherCast->_swiftPart);
      }
      return false;
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }
    std::string toString() override {
      return _swiftPart.toString();
    }

  public:
    // Properties
    

  public:
    // Methods
    inline std::shared_ptr<Promise<std::vector<ElectrocardiogramSample>>> queryElectrocardiogramSamples(const ECGQueryOptionsWithSortOrder& options) override {
      auto __result = _swiftPart.queryElectrocardiogramSamples(std::forward<decltype(options)>(options));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<ElectrocardiogramSamplesWithAnchorResponse>> queryElectrocardiogramSamplesWithAnchor(const ECGQueryOptionsWithAnchor& options) override {
      auto __result = _swiftPart.queryElectrocardiogramSamplesWithAnchor(std::forward<decltype(options)>(options));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    ReactNativeHealthkit::HybridElectrocardiogramModuleSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::healthkit
