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

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

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]) {
        std::vector<NSNumber *> _listTempVector;
        _listTempVector.reserve([primitiveList.list count]);
        for (NSNumber *currentValue_0 in primitiveList.list) {
            NSNumber *copiedValue_0;
            copiedValue_0 = currentValue_0;
            _listTempVector.push_back(copiedValue_0);
        }
        _list = [NSArray arrayWithObjects:&_listTempVector[0] count:_listTempVector.size()];
    }
    return self;
}

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

- (id)initWithCppPrimitiveList:(const PrimitiveList &)primitiveList
{
    if (self = [super init]) {
        std::vector<NSNumber *> _listTempVector;
        _listTempVector.reserve(primitiveList.list.size());
        for (const auto & cppValue_0 : primitiveList.list) {
            NSNumber *objcValue_0 = [NSNumber numberWithLongLong:cppValue_0];
            _listTempVector.push_back(objcValue_0);
        }
        _list = [NSArray arrayWithObjects:&_listTempVector[0] count:_listTempVector.size()];
    }
    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
