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

#import "DBPrimitiveList+Private.h"
#import <Foundation/Foundation.h>
#include <utility>

static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");

@implementation DBPrimitiveList

- (id)initWithPrimitiveList:(DBPrimitiveList *)primitiveList
{
    if (self = [super init]) {
        _list = [NSMutableArray arrayWithCapacity:[primitiveList.list count]];
        for (NSNumber *currentValue_0 in primitiveList.list) {
            id copiedValue_0;
            copiedValue_0 = currentValue_0;
            [_list addObject:copiedValue_0];
        }
    }
    return self;
}

- (id)initWithList:(NSMutableArray *)list
{
    if (self = [super init]) {
        _list = list;
    }
    return self;
}

- (id)initWithCppPrimitiveList:(const PrimitiveList &)primitiveList
{
    if (self = [super init]) {
        _list = [NSMutableArray arrayWithCapacity:primitiveList.list.size()];
        for (const auto & cppValue_0 : primitiveList.list) {
            NSNumber *objcValue_0 = [NSNumber numberWithLongLong:cppValue_0];
            [_list addObject:objcValue_0];
        }
    }
    return self;
}

- (PrimitiveList)cppPrimitiveList
{
    std::vector<int64_t> list;
    list.reserve([_list count]);
    for (NSNumber *objcValue_0 in _list) {
        int64_t cppValue_0 = [objcValue_0 longLongValue];
        list.push_back(std::move(cppValue_0));
    }
    return PrimitiveList(
            std::move(list));
}

@end
