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

#import "DBDateRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>

namespace djinni_generated {

auto DateRecord::toCpp(ObjcType obj) -> CppType
{
    assert(obj);
    std::chrono::system_clock::time_point created_at = ::djinni::convert_date([obj.createdAt timeIntervalSince1970]);
    return ::DateRecord(
        created_at);
}

auto DateRecord::fromCpp(const CppType& cpp) -> ObjcType
{
    NSDate *createdAt = [NSDate dateWithTimeIntervalSince1970:
            std::chrono::duration_cast<std::chrono::duration<double>>(cpp.created_at.time_since_epoch()).count()];
    return [[DBDateRecord alloc]
        initWithCreatedAt:createdAt];
}

}  // namespace djinni_generated
