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

#import <Foundation/Foundation.h>
#import <NitroModules/HybridObjectRegistry.hpp>
#import "FastIO-Swift-Cxx-Umbrella.hpp"
#import <type_traits>

#include "HybridWebSocketManagerSpecSwift.hpp"
#include "HybridFileSystemSpecSwift.hpp"
#include "HybridNetworkSpecSwift.hpp"
#include "HybridDuplexStreamSpecSwift.hpp"
#include "HybridCompressorFactory.hpp"
#include "HybridStreamFactorySpecSwift.hpp"

@interface FastIOAutolinking : NSObject
@end

@implementation FastIOAutolinking

+ (void) load {
  using namespace margelo::nitro;
  using namespace margelo::nitro::fastio;

  HybridObjectRegistry::registerHybridObjectConstructor(
    "WebSocketManager",
    []() -> std::shared_ptr<HybridObject> {
      std::shared_ptr<margelo::nitro::fastio::HybridWebSocketManagerSpec> hybridObject = FastIO::FastIOAutolinking::createWebSocketManager();
      return hybridObject;
    }
  );
  HybridObjectRegistry::registerHybridObjectConstructor(
    "FileSystem",
    []() -> std::shared_ptr<HybridObject> {
      std::shared_ptr<margelo::nitro::fastio::HybridFileSystemSpec> hybridObject = FastIO::FastIOAutolinking::createFileSystem();
      return hybridObject;
    }
  );
  HybridObjectRegistry::registerHybridObjectConstructor(
    "Network",
    []() -> std::shared_ptr<HybridObject> {
      std::shared_ptr<margelo::nitro::fastio::HybridNetworkSpec> hybridObject = FastIO::FastIOAutolinking::createNetwork();
      return hybridObject;
    }
  );
  HybridObjectRegistry::registerHybridObjectConstructor(
    "DuplexStream",
    []() -> std::shared_ptr<HybridObject> {
      std::shared_ptr<margelo::nitro::fastio::HybridDuplexStreamSpec> hybridObject = FastIO::FastIOAutolinking::createDuplexStream();
      return hybridObject;
    }
  );
  HybridObjectRegistry::registerHybridObjectConstructor(
    "CompressorFactory",
    []() -> std::shared_ptr<HybridObject> {
      static_assert(std::is_default_constructible_v<HybridCompressorFactory>,
                    "The HybridObject \"HybridCompressorFactory\" is not default-constructible! "
                    "Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
      return std::make_shared<HybridCompressorFactory>();
    }
  );
  HybridObjectRegistry::registerHybridObjectConstructor(
    "StreamFactory",
    []() -> std::shared_ptr<HybridObject> {
      std::shared_ptr<margelo::nitro::fastio::HybridStreamFactorySpec> hybridObject = FastIO::FastIOAutolinking::createStreamFactory();
      return hybridObject;
    }
  );
}

@end
