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

#pragma once

#include "HybridWebSocketManagerSpec.hpp"

// Forward declaration of `HybridWebSocketManagerSpecCxx` to properly resolve imports.
namespace FastWebSocket { class HybridWebSocketManagerSpecCxx; }

// Forward declaration of `HybridWebSocketSpec` to properly resolve imports.
namespace margelo::nitro::websocket { class HybridWebSocketSpec; }

#include <memory>
#include "HybridWebSocketSpec.hpp"
#include <string>
#include <vector>

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

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

namespace margelo::nitro::websocket {

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

  public:
    // Get the Swift part
    inline FastWebSocket::HybridWebSocketManagerSpecCxx getSwiftPart() noexcept { return _swiftPart; }

  public:
    // Get memory pressure
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }

  public:
    // Properties
    

  public:
    // Methods
    inline std::shared_ptr<margelo::nitro::websocket::HybridWebSocketSpec> create(const std::string& url, const std::vector<std::string>& protocols) override {
      auto __result = _swiftPart.create(url, protocols);
      return __result;
    }

  private:
    FastWebSocket::HybridWebSocketManagerSpecCxx _swiftPart;
  };

} // namespace margelo::nitro::websocket
