// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni

#import "DBClientInterfaceObjcProxy+Private.h"
#import "DBClientInterface.h"
#import "DBClientReturnedRecord+Private.h"

namespace djinni_generated
{
    ClientInterfaceObjcProxy::ClientInterfaceObjcProxy (id objcRef)
    {
        assert([[objcRef class] conformsToProtocol:@protocol(DBClientInterface)]);
        this->objcRef = objcRef;
    }

    ClientInterfaceObjcProxy::~ClientInterfaceObjcProxy ()
    {
        djinni::DbxObjcWrapperCache<ClientInterfaceObjcProxy> & cache = djinni::DbxObjcWrapperCache<ClientInterfaceObjcProxy>::getInstance();
        cache.remove(objcRef);
    }

    std::shared_ptr<ClientInterface> ClientInterfaceObjcProxy::client_interface_with_objc (id objcRef)
    {
        djinni::DbxObjcWrapperCache<ClientInterfaceObjcProxy> & cache = djinni::DbxObjcWrapperCache<ClientInterfaceObjcProxy>::getInstance();
        return static_cast<std::shared_ptr<ClientInterface>>(cache.get(objcRef));
    }

    ClientReturnedRecord ClientInterfaceObjcProxy::get_record (const std::string & utf8string)
    {
        @autoreleasepool {
            NSString *cpp_utf8string = [[NSString alloc] initWithBytes:utf8string.data()
                    length:utf8string.length()
                    encoding:NSUTF8StringEncoding];
            DBClientReturnedRecord *objcRet = [objcRef getRecord:cpp_utf8string];
            ClientReturnedRecord cppRet = std::move([objcRet cppClientReturnedRecord]);
            return cppRet;
        }
    }
}
