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

#pragma once

#include "HybridAudioSessionFactorySpec.hpp"

// Forward declaration of `HybridAudioSessionFactorySpec_cxx` to properly resolve imports.
namespace Aviation { class HybridAudioSessionFactorySpec_cxx; }

// Forward declaration of `HybridAudioSessionSpec` to properly resolve imports.
namespace margelo::nitro::aviation { class HybridAudioSessionSpec; }
// Forward declaration of `AudioSessionConfig` to properly resolve imports.
namespace margelo::nitro::aviation { struct AudioSessionConfig; }
// Forward declaration of `AudioSessionCategory` to properly resolve imports.
namespace margelo::nitro::aviation { enum class AudioSessionCategory; }
// Forward declaration of `AudioSessionMode` to properly resolve imports.
namespace margelo::nitro::aviation { enum class AudioSessionMode; }
// Forward declaration of `AudioCoexistence` to properly resolve imports.
namespace margelo::nitro::aviation { enum class AudioCoexistence; }

#include <memory>
#include "HybridAudioSessionSpec.hpp"
#include "AudioSessionConfig.hpp"
#include "AudioSessionCategory.hpp"
#include <optional>
#include "AudioSessionMode.hpp"
#include "AudioCoexistence.hpp"

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

namespace margelo::nitro::aviation {

  /**
   * The C++ part of HybridAudioSessionFactorySpec_cxx.swift.
   *
   * HybridAudioSessionFactorySpecSwift (C++) accesses HybridAudioSessionFactorySpec_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, HybridAudioSessionFactorySpec_cxx can directly inherit from the C++ class HybridAudioSessionFactorySpec
   * to simplify the whole structure and memory management.
   */
  class HybridAudioSessionFactorySpecSwift: public virtual HybridAudioSessionFactorySpec {
  public:
    // Constructor from a Swift instance
    explicit HybridAudioSessionFactorySpecSwift(const Aviation::HybridAudioSessionFactorySpec_cxx& swiftPart):
      HybridObject(HybridAudioSessionFactorySpec::TAG),
      _swiftPart(swiftPart) { }

  public:
    // Get the Swift part
    inline Aviation::HybridAudioSessionFactorySpec_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<HybridAudioSessionFactorySpecSwift>(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<HybridAudioSessionSpec> create(const AudioSessionConfig& config) override {
      auto __result = _swiftPart.create(std::forward<decltype(config)>(config));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<HybridAudioSessionSpec> createDefault() override {
      auto __result = _swiftPart.createDefault();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    Aviation::HybridAudioSessionFactorySpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::aviation
