Commit 5aabdc7e authored by Miro Knejp's avatar Miro Knejp Committed by Jacob Potter

Refactored interface code generation to utilize translation types like JNI does

parent 0807100b
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSSortItems.h"
#include "sort_items.hpp"
#import <Foundation/Foundation.h>
#include <memory>
@interface TXSSortItems ()
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@property (nonatomic, readonly) std::shared_ptr<::textsort::SortItems> cppRef;
@class TXSSortItems;
+ (id)sortItemsWithCpp:(const std::shared_ptr<::textsort::SortItems> &)cppRef;
namespace djinni_generated {
struct SortItems
{
using CppType = std::shared_ptr<::textsort::SortItems>;
using ObjcType = TXSSortItems*;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
@end
......@@ -2,15 +2,14 @@
// This file generated by Djinni from example.djinni
#import "TXSSortItems+Private.h"
#import "TXSSortItems.h"
#import "DJICppWrapperCache+Private.h"
#import "DJIDate.h"
#import "DJIError.h"
#import "DJIMarshal+Private.h"
#import "TXSItemList+Private.h"
#import "TXSSortItems+Private.h"
#import "TXSSortItems.h"
#import "TXSSortOrder.h"
#import "TXSTextboxListenerObjcProxy+Private.h"
#import "TXSTextboxListener+Private.h"
#include <exception>
#include <utility>
#include <vector>
......@@ -18,44 +17,53 @@
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@interface TXSSortItems ()
@property (nonatomic, readonly) std::shared_ptr<djinni::DbxCppWrapperCache<::textsort::SortItems>> cache;
@property (nonatomic, readonly) djinni::DbxCppWrapperCache<::textsort::SortItems>::Handle cppRef;
- (id)initWithCpp:(const std::shared_ptr<::textsort::SortItems>&)cppRef;
@end
@implementation TXSSortItems
namespace djinni_generated {
- (id)initWithCpp:(const std::shared_ptr<::textsort::SortItems> &)cppRef cache:(const std::shared_ptr<djinni::DbxCppWrapperCache<::textsort::SortItems>> &)cache
auto SortItems::toCpp(ObjcType objc) -> CppType
{
if (self = [super init]) {
_cppRef = cppRef;
_cache = cache;
}
return self;
return objc ? objc.cppRef.get() : nullptr;
}
- (void)dealloc
auto SortItems::fromCpp(const CppType& cpp) -> ObjcType
{
_cache->remove(_cppRef);
return !cpp ? nil : djinni::DbxCppWrapperCache<::textsort::SortItems>::getInstance()->get(cpp, [] (const auto& p)
{
return [[TXSSortItems alloc] initWithCpp:p];
});
}
+ (id)sortItemsWithCpp:(const std::shared_ptr<::textsort::SortItems> &)cppRef
} // namespace djinni_generated
@implementation TXSSortItems
- (id)initWithCpp:(const std::shared_ptr<::textsort::SortItems>&)cppRef
{
const auto & cache = djinni::DbxCppWrapperCache<::textsort::SortItems>::getInstance();
return cache->get(cppRef, [&] (const std::shared_ptr<::textsort::SortItems> & p) { return [[TXSSortItems alloc] initWithCpp:p cache:cache]; });
if (self = [super init]) {
_cppRef.assign(cppRef);
}
return self;
}
- (void)sort:(TXSSortOrder)order items:(TXSItemList *)items {
try {
::textsort::sort_order cppOrder = ::djinni::Enum<::textsort::sort_order, TXSSortOrder>::toCpp(order);
::textsort::ItemList cppItems = std::move([items cppItemList]);
_cppRef->sort(std::move(cppOrder), std::move(cppItems));
_cppRef.get()->sort(std::move(cppOrder), std::move(cppItems));
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (TXSSortItems *)createWithListener:(id<TXSTextboxListener>)listener {
try {
std::shared_ptr<::textsort::TextboxListener> cppListener = ::djinni_generated::TextboxListenerObjcProxy::textbox_listener_with_objc(listener);
std::shared_ptr<::textsort::TextboxListener> cppListener = ::djinni_generated::TextboxListener::toCpp(listener);
std::shared_ptr<::textsort::SortItems> cppRet = ::textsort::SortItems::create_with_listener(std::move(cppListener));
TXSSortItems* objcRet = [TXSSortItems sortItemsWithCpp:cppRet];
TXSSortItems* objcRet = ::djinni_generated::SortItems::fromCpp(cppRet);
return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS()
}
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#include "textbox_listener.hpp"
#include <memory>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@protocol TXSTextboxListener;
namespace djinni_generated {
struct TextboxListener
{
using CppType = std::shared_ptr<::textsort::TextboxListener>;
using ObjcType = id<TXSTextboxListener>;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSTextboxListener+Private.h"
#import "TXSTextboxListener.h"
#import "DJIObjcWrapperCache+Private.h"
#import "TXSItemList+Private.h"
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
namespace { // anonymous namespace
class ObjcProxy final
: public ::textsort::TextboxListener
, public ::djinni::DbxObjcWrapperCache<ObjcProxy>::Handle
{
public:
using Handle::Handle;
void update (const ::textsort::ItemList & items) override;
};
} // end anonymous namespace
namespace djinni_generated {
auto TextboxListener::toCpp(ObjcType objc) -> CppType
{
return objc ? djinni::DbxObjcWrapperCache<ObjcProxy>::getInstance()->get(objc) : nullptr;
}
auto TextboxListener::fromCpp(const CppType& cpp) -> ObjcType
{
assert(!cpp || dynamic_cast<ObjcProxy*>(cpp.get()));
return cpp ? static_cast<ObjcProxy&>(*cpp).Handle::get() : nil;
}
} // namespace djinni_generated
void ObjcProxy::update (const ::textsort::ItemList & items)
{
@autoreleasepool {
TXSItemList *cpp_items = [[TXSItemList alloc] initWithCppItemList:items];
[Handle::get() update:cpp_items];
}
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSTextboxListener.h"
#include "textbox_listener.hpp"
#import "DJIObjcWrapperCache+Private.h"
#import <Foundation/Foundation.h>
#include <memory>
namespace djinni_generated {
class TextboxListenerObjcProxy final : public ::textsort::TextboxListener
{
public:
const id <TXSTextboxListener> _objcRef;
const std::shared_ptr<djinni::DbxObjcWrapperCache<TextboxListenerObjcProxy>> _cache;
explicit TextboxListenerObjcProxy (id objcRef);
virtual ~TextboxListenerObjcProxy () override;
static std::shared_ptr<::textsort::TextboxListener> textbox_listener_with_objc (id<TXSTextboxListener> objcRef);
virtual void update (const ::textsort::ItemList & items) override;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSTextboxListenerObjcProxy+Private.h"
#import "TXSItemList+Private.h"
#import "TXSTextboxListener.h"
#include <vector>
namespace djinni_generated {
TextboxListenerObjcProxy::TextboxListenerObjcProxy (id objcRef)
: _objcRef((assert([[objcRef class] conformsToProtocol:@protocol(TXSTextboxListener)]), objcRef)),
_cache(djinni::DbxObjcWrapperCache<TextboxListenerObjcProxy>::getInstance())
{}
TextboxListenerObjcProxy::~TextboxListenerObjcProxy ()
{
_cache->remove(_objcRef);
}
std::shared_ptr<::textsort::TextboxListener> TextboxListenerObjcProxy::textbox_listener_with_objc (id<TXSTextboxListener> objcRef)
{
return djinni::DbxObjcWrapperCache<TextboxListenerObjcProxy>::getInstance()->get(objcRef);
}
void TextboxListenerObjcProxy::update (const ::textsort::ItemList & items)
{
@autoreleasepool {
TXSItemList *cpp_items = [[TXSItemList alloc] initWithCppItemList:items];
[_objcRef update:cpp_items];
}
}
} // namespace djinni_generated
......@@ -46,11 +46,9 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIMarshal+Private.h"))
case d: MDef => d.defType match {
case DEnum =>
body.add("#import " + q(spec.objcIncludePrefix + headerName(d.name)))
body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIMarshal+Private.h"))
header.add("#import " + q(spec.objcIncludePrefix + headerName(d.name)))
body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIMarshal+Private.h"))
case DInterface =>
header.add("#import <Foundation/Foundation.h>")
val ext = d.body.asInstanceOf[Interface].ext
if (ext.cpp) {
header.add("@class " + objcMarshal.typename(tm) + ";")
......@@ -58,7 +56,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
}
if (ext.objc) {
header.add("@protocol " + objcMarshal.typename(tm) + ";")
body.add("#import " + q(spec.objcIncludePrivatePrefix + privateHeaderName(d.name + "_objc_proxy")))
body.add("#import " + q(spec.objcIncludePrivatePrefix + privateHeaderName(d.name)))
}
case DRecord =>
val r = d.body.asInstanceOf[Record]
......@@ -71,6 +69,8 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
}
}
private def arcAssert(w: IndentWriter) = w.wl("static_assert(__has_feature(objc_arc), " + q("Djinni requires ARC to be enabled for this file") + ");")
override def generateEnum(origin: String, ident: Ident, doc: Doc, e: Enum) {
// No generation required
}
......@@ -141,13 +141,12 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
})
val self = objcMarshal.typename(ident, i)
val cppSelf = cppMarshal.fqTypename(ident, i)
refs.privHeader.add("#import <Foundation/Foundation.h>")
refs.privHeader.add("#include <memory>")
refs.privHeader.add("!#import " + q(spec.objcIncludePrefix + headerName(ident)))
refs.privHeader.add("!#include " + q(spec.objcIncludeCppPrefix + spec.cppFileIdentStyle(ident) + "." + spec.cppHeaderExt))
refs.body.add("#include <vector>")
refs.body.add("#import " + q(spec.objcIncludePrefix + headerName(ident)))
refs.body.add("!#import " + q(spec.objcIncludePrefix + headerName(ident)))
def writeObjcFuncDecl(method: Interface.Method, w: IndentWriter) {
val label = if (method.static) "+" else "-"
......@@ -160,7 +159,27 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
}
}
val cppSelf = cppMarshal.fqTypename(ident, i)
val helperClass = objcppMarshal.helperClass(ident)
val fqHelperClass = objcppMarshal.fqHelperClass(ident)
writeObjcFile(privateHeaderName(ident.name), origin, refs.privHeader, w => {
arcAssert(w)
w.wl
w.wl((if(i.ext.objc) "@protocol " else "@class ") + self + ";")
w.wl
wrapNamespace(w, Some(spec.objcppNamespace), w => {
w.wl(s"struct $helperClass")
w.bracedSemi {
w.wl(s"using CppType = std::shared_ptr<$cppSelf>;")
w.wl("using ObjcType = " + (if(i.ext.objc) s"id<$self>" else s"$self*") + ";");
w.wl
w.wl(s"static CppType toCpp(ObjcType objc);")
w.wl(s"static ObjcType fromCpp(const CppType& cpp);")
}
})
w.wl
})
if (i.ext.cpp) {
refs.body.add("!#import " + q(spec.objcIncludePrivatePrefix + privateHeaderName(ident.name)))
refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJICppWrapperCache+Private.h"))
......@@ -169,55 +188,51 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIDate.h"))
refs.body.add("#include <exception>")
writeObjcFile(privateHeaderName(ident.name), origin, refs.privHeader, w => {
w.wl(s"@interface $self ()")
w.wl
w.wl(s"@property (nonatomic, readonly) std::shared_ptr<$cppSelf> cppRef;")
w.wl
w.wl(s"+ (id)${idObjc.method(ident.name + "_with_cpp")}:(const std::shared_ptr<$cppSelf> &)cppRef;")
w.wl
w.wl("@end")
})
writeObjcFile(bodyName(ident.name), origin, refs.body, w => {
w.wl(s"static_assert(__has_feature(objc_arc), " + q("Djinni requires ARC to be enabled for this file") + ");" )
arcAssert(w)
if (i.consts.nonEmpty) generateObjcConstants(w, i.consts, self)
w.wl
w.wl(s"@interface $self ()")
w.wl(s"@property (nonatomic, readonly) std::shared_ptr<djinni::DbxCppWrapperCache<$cppSelf>> cache;")
w.wl("@end")
w.wl
w.wl(s"@implementation $self")
w.wl(s"@property (nonatomic, readonly) djinni::DbxCppWrapperCache<$cppSelf>::Handle cppRef;")
w.wl
w.wl(s"- (id)initWithCpp:(const std::shared_ptr<$cppSelf> &)cppRef cache:(const std::shared_ptr<djinni::DbxCppWrapperCache<$cppSelf>> &)cache")
w.wl(s"- (id)initWithCpp:(const std::shared_ptr<$cppSelf>&)cppRef;")
w.wl
w.wl("@end")
w.wl
wrapNamespace(w, Some(spec.objcppNamespace), w => {
w.wl(s"auto $helperClass::toCpp(ObjcType objc) -> CppType")
w.braced {
w.w("if (self = [super init])").braced {
w.wl("_cppRef = cppRef;")
w.wl("_cache = cache;")
}
w.wl("return self;")
w.wl(s"return objc ? objc.cppRef.get() : nullptr;")
}
w.wl
w.wl(s"- (void)dealloc")
w.wl(s"auto $helperClass::fromCpp(const CppType& cpp) -> ObjcType")
w.braced {
w.wl("_cache->remove(_cppRef);")
w.wl(s"return !cpp ? nil : djinni::DbxCppWrapperCache<$cppSelf>::getInstance()->get(cpp, [] (const auto& p)").bracedEnd(");") {
w.wl(s"return [[$self alloc] initWithCpp:p];")
}
}
})
w.wl
w.wl(s"+ (id)${idObjc.method(ident.name + "_with_cpp")}:(const std::shared_ptr<$cppSelf> &)cppRef")
w.wl(s"@implementation $self")
w.wl
w.wl(s"- (id)initWithCpp:(const std::shared_ptr<$cppSelf>&)cppRef")
w.braced {
w.wl(s"const auto & cache = djinni::DbxCppWrapperCache<$cppSelf>::getInstance();")
w.wl(s"return cache->get(cppRef, [&] (const std::shared_ptr<$cppSelf> & p) { return [[$self alloc] initWithCpp:p cache:cache]; });")
w.w("if (self = [super init])").braced {
w.wl("_cppRef.assign(cppRef);")
}
w.wl("return self;")
}
for (m <- i.methods) {
w.wl
writeObjcFuncDecl(m, w)
w.braced {
w.wl("try {").nested {
w.w("try").bracedEnd(" DJINNI_TRANSLATE_EXCEPTIONS()") {
for (p <- m.params) {
translateObjcTypeToCpp(idObjc.local("cpp_" + p.ident.name), idObjc.local(p.ident.name), p.ty, w)
}
val params = m.params.map(p => "std::move(" + idObjc.local("cpp_" + p.ident.name) + ")").mkString("(", ", ", ")")
val cppRef = if (!m.static) "_cppRef->" else cppSelf + "::"
val cppRef = if (!m.static) "_cppRef.get()->" else cppSelf + "::"
m.ret match {
case None =>
w.wl(s"$cppRef${idCpp.method(m.ident)}$params;")
......@@ -227,7 +242,6 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
w.wl("return objcRet;")
}
}
w.wl("} DJINNI_TRANSLATE_EXCEPTIONS()")
}
}
w.wl
......@@ -236,43 +250,40 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
}
if (i.ext.objc) {
val objcExtName = ident.name + "_objc_proxy"
val objcExtSelf = objcppMarshal.helperClass(objcExtName)
refs.privHeader.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIObjcWrapperCache+Private.h"))
refs.body.add("!#import " + q(spec.objcIncludePrivatePrefix + privateHeaderName(objcExtName)))
writeObjcFile(privateHeaderName(objcExtName), origin, refs.privHeader, w => {
wrapNamespace(w, Some(spec.objcppNamespace), (w: IndentWriter) => {
w.wl(s"class $objcExtSelf final : public $cppSelf").bracedSemi {
w.wl("public:")
w.wl(s"const id <$self> _objcRef;")
w.wl(s"const std::shared_ptr<djinni::DbxObjcWrapperCache<$objcExtSelf>> _cache;")
w.wl
w.wl(s"explicit $objcExtSelf (id objcRef);")
w.wl(s"virtual ~$objcExtSelf () override;")
w.wl(s"static std::shared_ptr<$cppSelf> ${idCpp.method(ident.name + "_with_objc")} (id<$self> objcRef);")
val objcExtSelf = objcppMarshal.helperClass("objc_proxy")
refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIObjcWrapperCache+Private.h"))
refs.body.add("!#import " + q(spec.objcIncludePrivatePrefix + privateHeaderName(ident.name)))
writeObjcFile(bodyName(ident.name), origin, refs.body, w => {
arcAssert(w)
w.wl
wrapAnonymousNamespace(w, w => {
w.wl(s"class $objcExtSelf final")
w.wl(s": public $cppSelf")
w.wl(s", public ::djinni::DbxObjcWrapperCache<$objcExtSelf>::Handle") // Use base class to avoid name conflicts with user-defined methods having the same name as this new data member
w.bracedSemi {
w.wlOutdent("public:")
w.wl("using Handle::Handle;")
for (m <- i.methods) {
val ret = cppMarshal.fqReturnType(m.ret)
val params = m.params.map(p => cppMarshal.fqParamType(p.ty) + " " + idCpp.local(p.ident))
w.wl(s"virtual $ret ${idCpp.method(m.ident)} ${params.mkString("(", ", ", ")")} override;")
w.wl(s"$ret ${idCpp.method(m.ident)} ${params.mkString("(", ", ", ")")} override;")
}
}
})
})
writeObjcFile(bodyName(objcExtName), origin, refs.body, w => {
wrapNamespace(w, Some(spec.objcppNamespace), (w: IndentWriter) => {
w.wl(s"$objcExtSelf::$objcExtSelf (id objcRef)")
w.wl(s" : _objcRef((assert([[objcRef class] conformsToProtocol:@protocol($self)]), objcRef)),")
w.wl(s" _cache(djinni::DbxObjcWrapperCache<$objcExtSelf>::getInstance())")
w.wl(s" {}")
w.wl
w.wl(s"$objcExtSelf::~$objcExtSelf ()").braced {
w.wl(s"_cache->remove(_objcRef);")
wrapNamespace(w, Some(spec.objcppNamespace), w => {
w.wl(s"auto $helperClass::toCpp(ObjcType objc) -> CppType")
w.braced {
w.wl(s"return objc ? djinni::DbxObjcWrapperCache<$objcExtSelf>::getInstance()->get(objc) : nullptr;")
}
w.wl
w.wl(s"std::shared_ptr<$cppSelf> $objcExtSelf::${idCpp.method(ident.name + "_with_objc")} (id<$self> objcRef)").braced {
w.wl(s"return djinni::DbxObjcWrapperCache<$objcExtSelf>::getInstance()->get(objcRef);")
w.wl(s"auto $helperClass::fromCpp(const CppType& cpp) -> ObjcType")
w.braced {
w.wl(s"assert(!cpp || dynamic_cast<$objcExtSelf*>(cpp.get()));")
w.wl(s"return cpp ? static_cast<$objcExtSelf&>(*cpp).Handle::get() : nil;")
}
})
for (m <- i.methods) {
w.wl
val ret = cppMarshal.fqReturnType(m.ret)
......@@ -282,7 +293,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
m.params.foreach(p =>
translateCppTypeToObjc(idCpp.local("cpp_" + p.ident.name), idCpp.local(p.ident), p.ty, true, w))
m.ret.fold()(r => w.w(objcMarshal.fqFieldType(r) + " objcRet = "))
w.w("[_objcRef " + idObjc.method(m.ident))
w.w("[Handle::get() " + idObjc.method(m.ident))
val skipFirst = SkipFirst()
for (p <- m.params) {
skipFirst { w.w(" " + idObjc.local(p.ident)) }
......@@ -297,7 +308,6 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
}
}
})
})
}
}
......@@ -350,7 +360,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
writeObjcFile(bodyName(objcName), origin, refs.body, w => {
if (r.consts.nonEmpty) generateObjcConstants(w, r.consts, noBaseSelf)
w.wl(s"static_assert(__has_feature(objc_arc), " + q("Djinni requires ARC to be enabled for this file") + ");" )
arcAssert(w)
w.wl
w.wl(s"@implementation $self")
w.wl
......@@ -681,11 +691,12 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
case DInterface =>
val ext = d.body.asInstanceOf[Interface].ext
val objcProxy = objcppMarshal.fqHelperClass(d.name + "_objc_proxy")
val helperClass = objcppMarshal.fqHelperClass(typeName)
(ext.cpp, ext.objc) match {
case (true, true) => throw new AssertionError("Function implemented on both sides")
case (false, false) => throw new AssertionError("Function not implemented")
case (true, false) => w.wl(s"$objcType$objcIdent = [${idObjc.ty(d.name)} ${idObjc.method(d.name + "_with_cpp")}:$cppIdent];")
case (false, true) => w.wl(s"$objcType$objcIdent = std::static_pointer_cast<$objcProxy>($cppIdent)->_objcRef;")
case (true, false) => w.wl(s"$objcType$objcIdent = $helperClass::fromCpp($cppIdent);")
case (false, true) => w.wl(s"$objcType$objcIdent = $helperClass::fromCpp($cppIdent);")
}
}
}
......@@ -778,12 +789,12 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
case DRecord => w.wl(s"$cppType $cppIdent = std::move([$objcIdent cpp${IdentStyle.camelUpper(typeName)}]);")
case DInterface =>
val ext = d.body.asInstanceOf[Interface].ext
val helperClass = objcppMarshal.fqHelperClass(typeName)
(ext.cpp, ext.objc) match {
case (true, true) => throw new AssertionError("Function implemented on both sides")
case (false, false) => throw new AssertionError("Function not implemented")
case (true, false) => w.wl(s"$cppType $cppIdent = $objcIdent.cppRef;")
case (false, true) => w.wl(s"$cppType $cppIdent = ${objcppMarshal.fqHelperClass(d.name + "_objc_proxy")}" +
s"::${idCpp.method(d.name + "_with_objc")}($objcIdent);")
case (true, false) => w.wl(s"$cppType $cppIdent = $helperClass::toCpp($objcIdent);")
case (false, true) => w.wl(s"$cppType $cppIdent = $helperClass::toCpp($objcIdent);")
}
}
}
......
......@@ -225,6 +225,14 @@ abstract class Generator(spec: Spec)
}
}
def wrapAnonymousNamespace(w: IndentWriter, f: IndentWriter => Unit) {
w.wl("namespace { // anonymous namespace")
w.wl
f(w)
w.wl
w.wl("} // end anonymous namespace")
}
def writeHppFileGeneric(folder: File, namespace: Option[String], fileIdentStyle: IdentConverter)(name: String, origin: String, includes: Iterable[String], fwds: Iterable[String], f: IndentWriter => Unit, f2: IndentWriter => Unit) {
createFile(folder, fileIdentStyle(name) + "." + spec.cppHeaderExt, (w: IndentWriter) => {
w.wl("// AUTOGENERATED FILE - DO NOT MODIFY!")
......
......@@ -60,6 +60,22 @@ public:
}
}
class Handle {
public:
Handle() = default;
~Handle() {
if (_ptr) {
_cache->remove(_ptr);
}
}
void assign(const std::shared_ptr<T>& ptr) { _ptr = ptr; }
const std::shared_ptr<T>& get() const noexcept { return _ptr; }
private:
const std::shared_ptr<DbxCppWrapperCache> _cache = getInstance();
std::shared_ptr<T> _ptr;
};
private:
std::unordered_map<T*, __weak id> m_mapping;
std::mutex m_mutex;
......
......@@ -25,12 +25,12 @@ struct Bool {
struct Boxed {
using ObjcType = NSNumber*;
static CppType toCpp(ObjcType x) noexcept { return [x boolValue] ? true : false; }
static ObjcType fromCpp(CppType x) noexcept { return [NSNumber numberWithChar:x ? YES : NO]; }
static CppType toCpp(ObjcType x) noexcept { assert(x); return [x boolValue] ? true : false; }
static ObjcType fromCpp(CppType x) noexcept { return [NSNumber numberWithBool:x ? YES : NO]; }
};
};
template<class T>
template<class Self, class T>
struct Primitive {
using CppType = T;
using ObjcType = T;
......@@ -39,7 +39,7 @@ struct Primitive {
static ObjcType fromCpp(CppType x) noexcept { return x; }
};
struct I8 : public Primitive<int8_t> {
struct I8 : public Primitive<I8, int8_t> {
struct Boxed {
using ObjcType = NSNumber*;
static CppType toCpp(ObjcType x) noexcept { return [x charValue]; }
......@@ -47,7 +47,7 @@ struct I8 : public Primitive<int8_t> {
};
};
struct I16 : public Primitive<int16_t> {
struct I16 : public Primitive<I16, int16_t> {
struct Boxed {
using ObjcType = NSNumber*;
static CppType toCpp(ObjcType x) noexcept { return [x shortValue]; }
......@@ -55,7 +55,7 @@ struct I16 : public Primitive<int16_t> {
};
};
struct I32 : public Primitive<int32_t> {
struct I32 : public Primitive<I32, int32_t> {
struct Boxed {
using ObjcType = NSNumber*;
static CppType toCpp(ObjcType x) noexcept { return [x intValue]; }
......@@ -63,7 +63,7 @@ struct I32 : public Primitive<int32_t> {
};
};
struct I64 : public Primitive<int64_t> {
struct I64 : public Primitive<I64, int64_t> {
struct Boxed {
using ObjcType = NSNumber*;
static CppType toCpp(ObjcType x) noexcept { return [x longLongValue]; }
......@@ -71,7 +71,7 @@ struct I64 : public Primitive<int64_t> {
};
};
struct F64 : public Primitive<double> {
struct F64 : public Primitive<F64, double> {
struct Boxed {
using ObjcType = NSNumber*;
static CppType toCpp(ObjcType x) noexcept { return [x doubleValue]; }
......
......@@ -57,6 +57,22 @@ public:
}
}
class Handle {
public:
Handle(id obj) : _obj(obj) { };
~Handle() {
if (_obj) {
_cache->remove(_obj);
}
}
id get() const noexcept { return _obj; }
private:
const std::shared_ptr<DbxObjcWrapperCache> _cache = getInstance();
const id _obj;
};
private:
NSMapTable *m_mapping;
std::mutex m_mutex;
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni
#include "client_interface.hpp"
#include <memory>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@protocol DBClientInterface;
namespace djinni_generated {
struct ClientInterface
{
using CppType = std::shared_ptr<::ClientInterface>;
using ObjcType = id<DBClientInterface>;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni
#import "DBClientInterfaceObjcProxy+Private.h"
#import "DBClientInterface+Private.h"
#import "DBClientInterface.h"
#import "DBClientReturnedRecord+Private.h"
#import "DJIMarshal+Private.h"
#import "DJIObjcWrapperCache+Private.h"
#include <vector>
namespace djinni_generated {
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
namespace { // anonymous namespace
class ObjcProxy final
: public ::ClientInterface
, public ::djinni::DbxObjcWrapperCache<ObjcProxy>::Handle
{
public:
using Handle::Handle;
::ClientReturnedRecord get_record (int64_t record_id, const std::string & utf8string) override;
};
} // end anonymous namespace
ClientInterfaceObjcProxy::ClientInterfaceObjcProxy (id objcRef)
: _objcRef((assert([[objcRef class] conformsToProtocol:@protocol(DBClientInterface)]), objcRef)),
_cache(djinni::DbxObjcWrapperCache<ClientInterfaceObjcProxy>::getInstance())
{}
namespace djinni_generated {
ClientInterfaceObjcProxy::~ClientInterfaceObjcProxy ()
auto ClientInterface::toCpp(ObjcType objc) -> CppType
{
_cache->remove(_objcRef);
return objc ? djinni::DbxObjcWrapperCache<ObjcProxy>::getInstance()->get(objc) : nullptr;
}
std::shared_ptr<::ClientInterface> ClientInterfaceObjcProxy::client_interface_with_objc (id<DBClientInterface> objcRef)
auto ClientInterface::fromCpp(const CppType& cpp) -> ObjcType
{
return djinni::DbxObjcWrapperCache<ClientInterfaceObjcProxy>::getInstance()->get(objcRef);
assert(!cpp || dynamic_cast<ObjcProxy*>(cpp.get()));
return cpp ? static_cast<ObjcProxy&>(*cpp).Handle::get() : nil;
}
::ClientReturnedRecord ClientInterfaceObjcProxy::get_record (int64_t record_id, const std::string & utf8string)
} // namespace djinni_generated
::ClientReturnedRecord ObjcProxy::get_record (int64_t record_id, const std::string & utf8string)
{
@autoreleasepool {
int64_t cpp_record_id = ::djinni::I64::fromCpp(record_id);
NSString *cpp_utf8string = ::djinni::String::fromCpp(utf8string);
DBClientReturnedRecord * objcRet = [_objcRef getRecord:cpp_record_id utf8string:cpp_utf8string];
DBClientReturnedRecord * objcRet = [Handle::get() getRecord:cpp_record_id utf8string:cpp_utf8string];
::ClientReturnedRecord cppRet = std::move([objcRet cppClientReturnedRecord]);
return cppRet;
}
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni
#import "DBClientInterface.h"
#include "client_interface.hpp"
#import "DJIObjcWrapperCache+Private.h"
#import <Foundation/Foundation.h>
#include <memory>
namespace djinni_generated {
class ClientInterfaceObjcProxy final : public ::ClientInterface
{
public:
const id <DBClientInterface> _objcRef;
const std::shared_ptr<djinni::DbxObjcWrapperCache<ClientInterfaceObjcProxy>> _cache;
explicit ClientInterfaceObjcProxy (id objcRef);
virtual ~ClientInterfaceObjcProxy () override;
static std::shared_ptr<::ClientInterface> client_interface_with_objc (id<DBClientInterface> objcRef);
virtual ::ClientReturnedRecord get_record (int64_t record_id, const std::string & utf8string) override;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from exception.djinni
#import "DBCppException.h"
#include "cpp_exception.hpp"
#import <Foundation/Foundation.h>
#include <memory>
@interface DBCppException ()
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@property (nonatomic, readonly) std::shared_ptr<::CppException> cppRef;
@class DBCppException;
+ (id)cppExceptionWithCpp:(const std::shared_ptr<::CppException> &)cppRef;
namespace djinni_generated {
struct CppException
{
using CppType = std::shared_ptr<::CppException>;
using ObjcType = DBCppException*;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from exception.djinni
#import "DBCppException+Private.h"
#import "DBCppException+Private.h"
#import "DBCppException.h"
#import "DBCppException+Private.h"
#import "DJICppWrapperCache+Private.h"
#import "DJIDate.h"
#import "DJIError.h"
......@@ -15,34 +15,43 @@
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@interface DBCppException ()
@property (nonatomic, readonly) std::shared_ptr<djinni::DbxCppWrapperCache<::CppException>> cache;
@property (nonatomic, readonly) djinni::DbxCppWrapperCache<::CppException>::Handle cppRef;
- (id)initWithCpp:(const std::shared_ptr<::CppException>&)cppRef;
@end
@implementation DBCppException
namespace djinni_generated {
- (id)initWithCpp:(const std::shared_ptr<::CppException> &)cppRef cache:(const std::shared_ptr<djinni::DbxCppWrapperCache<::CppException>> &)cache
auto CppException::toCpp(ObjcType objc) -> CppType
{
if (self = [super init]) {
_cppRef = cppRef;
_cache = cache;
}
return self;
return objc ? objc.cppRef.get() : nullptr;
}
- (void)dealloc
auto CppException::fromCpp(const CppType& cpp) -> ObjcType
{
_cache->remove(_cppRef);
return !cpp ? nil : djinni::DbxCppWrapperCache<::CppException>::getInstance()->get(cpp, [] (const auto& p)
{
return [[DBCppException alloc] initWithCpp:p];
});
}
+ (id)cppExceptionWithCpp:(const std::shared_ptr<::CppException> &)cppRef
} // namespace djinni_generated
@implementation DBCppException
- (id)initWithCpp:(const std::shared_ptr<::CppException>&)cppRef
{
const auto & cache = djinni::DbxCppWrapperCache<::CppException>::getInstance();
return cache->get(cppRef, [&] (const std::shared_ptr<::CppException> & p) { return [[DBCppException alloc] initWithCpp:p cache:cache]; });
if (self = [super init]) {
_cppRef.assign(cppRef);
}
return self;
}
- (int32_t)throwAnException {
try {
int32_t cppRet = _cppRef->throw_an_exception();
int32_t cppRet = _cppRef.get()->throw_an_exception();
int32_t objcRet = ::djinni::I32::fromCpp(cppRet);
return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS()
......@@ -51,7 +60,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (DBCppException *)get {
try {
std::shared_ptr<::CppException> cppRet = ::CppException::get();
DBCppException* objcRet = [DBCppException cppExceptionWithCpp:cppRet];
DBCppException* objcRet = ::djinni_generated::CppException::fromCpp(cppRet);
return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS()
}
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from test.djinni
#import "DBTestHelpers.h"
#include "test_helpers.hpp"
#import <Foundation/Foundation.h>
#include <memory>
@interface DBTestHelpers ()
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@property (nonatomic, readonly) std::shared_ptr<::TestHelpers> cppRef;
@class DBTestHelpers;
+ (id)testHelpersWithCpp:(const std::shared_ptr<::TestHelpers> &)cppRef;
namespace djinni_generated {
struct TestHelpers
{
using CppType = std::shared_ptr<::TestHelpers>;
using ObjcType = DBTestHelpers*;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
@end
......@@ -2,14 +2,13 @@
// This file generated by Djinni from test.djinni
#import "DBTestHelpers+Private.h"
#import "DBTestHelpers.h"
#import "DBAssortedIntegers+Private.h"
#import "DBClientInterfaceObjcProxy+Private.h"
#import "DBColor.h"
#import "DBClientInterface+Private.h"
#import "DBMapListRecord+Private.h"
#import "DBNestedCollection+Private.h"
#import "DBPrimitiveList+Private.h"
#import "DBSetRecord+Private.h"
#import "DBTestHelpers.h"
#import "DBToken+Private.h"
#import "DJICppWrapperCache+Private.h"
#import "DJIDate.h"
......@@ -22,29 +21,38 @@
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@interface DBTestHelpers ()
@property (nonatomic, readonly) std::shared_ptr<djinni::DbxCppWrapperCache<::TestHelpers>> cache;
@property (nonatomic, readonly) djinni::DbxCppWrapperCache<::TestHelpers>::Handle cppRef;
- (id)initWithCpp:(const std::shared_ptr<::TestHelpers>&)cppRef;
@end
@implementation DBTestHelpers
namespace djinni_generated {
- (id)initWithCpp:(const std::shared_ptr<::TestHelpers> &)cppRef cache:(const std::shared_ptr<djinni::DbxCppWrapperCache<::TestHelpers>> &)cache
auto TestHelpers::toCpp(ObjcType objc) -> CppType
{
if (self = [super init]) {
_cppRef = cppRef;
_cache = cache;
}
return self;
return objc ? objc.cppRef.get() : nullptr;
}
- (void)dealloc
auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
{
_cache->remove(_cppRef);
return !cpp ? nil : djinni::DbxCppWrapperCache<::TestHelpers>::getInstance()->get(cpp, [] (const auto& p)
{
return [[DBTestHelpers alloc] initWithCpp:p];
});
}
+ (id)testHelpersWithCpp:(const std::shared_ptr<::TestHelpers> &)cppRef
} // namespace djinni_generated
@implementation DBTestHelpers
- (id)initWithCpp:(const std::shared_ptr<::TestHelpers>&)cppRef
{
const auto & cache = djinni::DbxCppWrapperCache<::TestHelpers>::getInstance();
return cache->get(cppRef, [&] (const std::shared_ptr<::TestHelpers> & p) { return [[DBTestHelpers alloc] initWithCpp:p cache:cache]; });
if (self = [super init]) {
_cppRef.assign(cppRef);
}
return self;
}
+ (DBSetRecord *)getSetRecord {
......@@ -181,14 +189,14 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (void)checkClientInterfaceAscii:(id<DBClientInterface>)i {
try {
std::shared_ptr<::ClientInterface> cppI = ::djinni_generated::ClientInterfaceObjcProxy::client_interface_with_objc(i);
std::shared_ptr<::ClientInterface> cppI = ::djinni_generated::ClientInterface::toCpp(i);
::TestHelpers::check_client_interface_ascii(std::move(cppI));
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (void)checkClientInterfaceNonascii:(id<DBClientInterface>)i {
try {
std::shared_ptr<::ClientInterface> cppI = ::djinni_generated::ClientInterfaceObjcProxy::client_interface_with_objc(i);
std::shared_ptr<::ClientInterface> cppI = ::djinni_generated::ClientInterface::toCpp(i);
::TestHelpers::check_client_interface_nonascii(std::move(cppI));
} DJINNI_TRANSLATE_EXCEPTIONS()
}
......@@ -207,9 +215,9 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (DBToken *)tokenId:(DBToken *)t {
try {
std::shared_ptr<::Token> cppT = t.cppRef;
std::shared_ptr<::Token> cppT = ::djinni_generated::Token::toCpp(t);
std::shared_ptr<::Token> cppRet = ::TestHelpers::token_id(std::move(cppT));
DBToken* objcRet = [DBToken tokenWithCpp:cppRet];
DBToken* objcRet = ::djinni_generated::Token::fromCpp(cppRet);
return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS()
}
......@@ -217,21 +225,21 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (DBToken *)createCppToken {
try {
std::shared_ptr<::Token> cppRet = ::TestHelpers::create_cpp_token();
DBToken* objcRet = [DBToken tokenWithCpp:cppRet];
DBToken* objcRet = ::djinni_generated::Token::fromCpp(cppRet);
return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (void)checkCppToken:(DBToken *)t {
try {
std::shared_ptr<::Token> cppT = t.cppRef;
std::shared_ptr<::Token> cppT = ::djinni_generated::Token::toCpp(t);
::TestHelpers::check_cpp_token(std::move(cppT));
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (int64_t)cppTokenId:(DBToken *)t {
try {
std::shared_ptr<::Token> cppT = t.cppRef;
std::shared_ptr<::Token> cppT = ::djinni_generated::Token::toCpp(t);
int64_t cppRet = ::TestHelpers::cpp_token_id(std::move(cppT));
int64_t objcRet = ::djinni::I64::fromCpp(cppRet);
return objcRet;
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from token.djinni
#import "DBToken.h"
#include "token.hpp"
#import <Foundation/Foundation.h>
#include <memory>
@interface DBToken ()
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@property (nonatomic, readonly) std::shared_ptr<::Token> cppRef;
@class DBToken;
+ (id)tokenWithCpp:(const std::shared_ptr<::Token> &)cppRef;
namespace djinni_generated {
struct Token
{
using CppType = std::shared_ptr<::Token>;
using ObjcType = DBToken*;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
@end
......@@ -13,29 +13,38 @@
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@interface DBToken ()
@property (nonatomic, readonly) std::shared_ptr<djinni::DbxCppWrapperCache<::Token>> cache;
@property (nonatomic, readonly) djinni::DbxCppWrapperCache<::Token>::Handle cppRef;
- (id)initWithCpp:(const std::shared_ptr<::Token>&)cppRef;
@end
@implementation DBToken
namespace djinni_generated {
- (id)initWithCpp:(const std::shared_ptr<::Token> &)cppRef cache:(const std::shared_ptr<djinni::DbxCppWrapperCache<::Token>> &)cache
auto Token::toCpp(ObjcType objc) -> CppType
{
if (self = [super init]) {
_cppRef = cppRef;
_cache = cache;
}
return self;
return objc ? objc.cppRef.get() : nullptr;
}
- (void)dealloc
auto Token::fromCpp(const CppType& cpp) -> ObjcType
{
_cache->remove(_cppRef);
return !cpp ? nil : djinni::DbxCppWrapperCache<::Token>::getInstance()->get(cpp, [] (const auto& p)
{
return [[DBToken alloc] initWithCpp:p];
});
}
+ (id)tokenWithCpp:(const std::shared_ptr<::Token> &)cppRef
} // namespace djinni_generated
@implementation DBToken
- (id)initWithCpp:(const std::shared_ptr<::Token>&)cppRef
{
const auto & cache = djinni::DbxCppWrapperCache<::Token>::getInstance();
return cache->get(cppRef, [&] (const std::shared_ptr<::Token> & p) { return [[DBToken alloc] initWithCpp:p cache:cache]; });
if (self = [super init]) {
_cppRef.assign(cppRef);
}
return self;
}
@end
#import "DBClientInterfaceImpl.h"
#import "DBClientInterfaceObjcProxy+Private.h"
#import "DBClientInterface+Private.h"
#import "DBTestHelpers.h"
#import <XCTest/XCTest.h>
......@@ -37,8 +37,8 @@
@autoreleasepool {
id <DBClientInterface> objcClientInterface = [[DBClientInterfaceImpl alloc] init];
objcClientInterfaceWeak = objcClientInterface;
cppClientInterface1 = ::djinni_generated::ClientInterfaceObjcProxy::client_interface_with_objc(objcClientInterface);
cppClientInterface2 = ::djinni_generated::ClientInterfaceObjcProxy::client_interface_with_objc(objcClientInterface);
cppClientInterface1 = ::djinni_generated::ClientInterface::toCpp(objcClientInterface);
cppClientInterface2 = ::djinni_generated::ClientInterface::toCpp(objcClientInterface);
XCTAssertEqual(cppClientInterface1, cppClientInterface2);
}
XCTAssertNotNil(objcClientInterfaceWeak);
......
#import "DBCppException.h"
#import "DBCppException+Private.h"
#import <XCTest/XCTest.h>
......@@ -20,7 +21,7 @@
}
- (void)testThrown {
DBCppException* objcInterface = [DBCppException cppExceptionWithCpp:(std::make_shared<CppExceptionImpl>())];
DBCppException* objcInterface = ::djinni_generated::CppException::fromCpp(std::make_shared<CppExceptionImpl>());
NSString *exceptionName = nil;
@try {
......@@ -35,8 +36,8 @@
std::shared_ptr<CppException> cppInterface = std::make_shared<CppExceptionImpl>();
std::weak_ptr<CppException> weakCppInterface(cppInterface);
@autoreleasepool {
DBCppException* objcInterface1 = [DBCppException cppExceptionWithCpp:cppInterface];
DBCppException* objcInterface2 = [DBCppException cppExceptionWithCpp:cppInterface];
DBCppException* objcInterface1 = ::djinni_generated::CppException::fromCpp(cppInterface);
DBCppException* objcInterface2 = ::djinni_generated::CppException::fromCpp(cppInterface);
XCTAssertEqual(objcInterface1, objcInterface2, @"The same wrapper should be returned");
cppInterface.reset();
......
......@@ -26,7 +26,6 @@
6D66A8A91A3B09F000B312E8 /* DBConstantTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6D66A8A81A3B09F000B312E8 /* DBConstantTests.mm */; };
A239F37A1AF400C600DF27C8 /* DJIDate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A239F3781AF400C600DF27C8 /* DJIDate.mm */; };
A242494C1AF192E0003BF8F0 /* DBAssortedIntegers.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242491B1AF192E0003BF8F0 /* DBAssortedIntegers.mm */; };
A242494D1AF192E0003BF8F0 /* DBClientInterfaceObjcProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242491E1AF192E0003BF8F0 /* DBClientInterfaceObjcProxy.mm */; };
A242494E1AF192E0003BF8F0 /* DBClientReturnedRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249211AF192E0003BF8F0 /* DBClientReturnedRecord.mm */; };
A24249501AF192E0003BF8F0 /* DBConstants.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249271AF192E0003BF8F0 /* DBConstants.mm */; };
A24249511AF192E0003BF8F0 /* DBCppException.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242492A1AF192E0003BF8F0 /* DBCppException.mm */; };
......@@ -48,6 +47,7 @@
A278D45319BA3601006FD937 /* test_helpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A278D45219BA3601006FD937 /* test_helpers.cpp */; };
A2A162D21AF190D200C0B00A /* DJIDate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2A162D11AF190D200C0B00A /* DJIDate.mm */; };
A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2CB54B319BA6E6000A9E600 /* DJIError.mm */; };
A2CCB9421AF80DFC00E6230A /* DBClientInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2CCB9401AF80DFC00E6230A /* DBClientInterface.mm */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -105,8 +105,6 @@
A242491A1AF192E0003BF8F0 /* DBAssortedIntegers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBAssortedIntegers.h; sourceTree = "<group>"; };
A242491B1AF192E0003BF8F0 /* DBAssortedIntegers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBAssortedIntegers.mm; sourceTree = "<group>"; };
A242491C1AF192E0003BF8F0 /* DBClientInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBClientInterface.h; sourceTree = "<group>"; };
A242491D1AF192E0003BF8F0 /* DBClientInterfaceObjcProxy+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBClientInterfaceObjcProxy+Private.h"; sourceTree = "<group>"; };
A242491E1AF192E0003BF8F0 /* DBClientInterfaceObjcProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBClientInterfaceObjcProxy.mm; sourceTree = "<group>"; };
A242491F1AF192E0003BF8F0 /* DBClientReturnedRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBClientReturnedRecord+Private.h"; sourceTree = "<group>"; };
A24249201AF192E0003BF8F0 /* DBClientReturnedRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBClientReturnedRecord.h; sourceTree = "<group>"; };
A24249211AF192E0003BF8F0 /* DBClientReturnedRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBClientReturnedRecord.mm; sourceTree = "<group>"; };
......@@ -175,6 +173,8 @@
A2A162D01AF190D200C0B00A /* DJIDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DJIDate.h; path = "../../../../djinni/support-lib/objc/DJIDate.h"; sourceTree = "<group>"; };
A2A162D11AF190D200C0B00A /* DJIDate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DJIDate.mm; path = "../../../../djinni/support-lib/objc/DJIDate.mm"; sourceTree = "<group>"; };
A2CB54B319BA6E6000A9E600 /* DJIError.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DJIError.mm; sourceTree = "<group>"; };
A2CCB9401AF80DFC00E6230A /* DBClientInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBClientInterface.mm; sourceTree = "<group>"; };
A2CCB9411AF80DFC00E6230A /* DBClientInterface+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBClientInterface+Private.h"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -295,12 +295,12 @@
A24249181AF192E0003BF8F0 /* generated-objc */ = {
isa = PBXGroup;
children = (
A2CCB9401AF80DFC00E6230A /* DBClientInterface.mm */,
A2CCB9411AF80DFC00E6230A /* DBClientInterface+Private.h */,
A24249191AF192E0003BF8F0 /* DBAssortedIntegers+Private.h */,
A242491A1AF192E0003BF8F0 /* DBAssortedIntegers.h */,
A242491B1AF192E0003BF8F0 /* DBAssortedIntegers.mm */,
A242491C1AF192E0003BF8F0 /* DBClientInterface.h */,
A242491D1AF192E0003BF8F0 /* DBClientInterfaceObjcProxy+Private.h */,
A242491E1AF192E0003BF8F0 /* DBClientInterfaceObjcProxy.mm */,
A242491F1AF192E0003BF8F0 /* DBClientReturnedRecord+Private.h */,
A24249201AF192E0003BF8F0 /* DBClientReturnedRecord.h */,
A24249211AF192E0003BF8F0 /* DBClientReturnedRecord.mm */,
......@@ -475,6 +475,7 @@
A24249551AF192E0003BF8F0 /* DBMapRecord.mm in Sources */,
A24249581AF192E0003BF8F0 /* DBRecordWithDerivings.mm in Sources */,
A242495C1AF192E0003BF8F0 /* DBToken.mm in Sources */,
A2CCB9421AF80DFC00E6230A /* DBClientInterface.mm in Sources */,
A24249531AF192E0003BF8F0 /* DBMapDateRecord.mm in Sources */,
A24249501AF192E0003BF8F0 /* DBConstants.mm in Sources */,
A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */,
......@@ -483,7 +484,6 @@
A24249751AF192FC003BF8F0 /* record_with_derivings.cpp in Sources */,
A24249541AF192E0003BF8F0 /* DBMapListRecord.mm in Sources */,
A239F37A1AF400C600DF27C8 /* DJIDate.mm in Sources */,
A242494D1AF192E0003BF8F0 /* DBClientInterfaceObjcProxy.mm in Sources */,
A24249731AF192FC003BF8F0 /* assorted_integers.cpp in Sources */,
A24249561AF192E0003BF8F0 /* DBNestedCollection.mm in Sources */,
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment