gpt4 book ai didi

cross-platform - Dropbox Djinni - 接口(interface)继承

转载 作者:行者123 更新时间:2023-12-04 04:30:42 24 4
gpt4 key购买 nike

有没有办法继承/扩展 Djinni 的 DSL 中的接口(interface)?

例如:

parent = interface +c {
parentMethod();
}

child1 = interface +c {
childMethod1();
}

child2 = interface +c {
childMethod2();
}

我要继承 child1child2来自 parent .

最佳答案

Djinni 目前没有接口(interface)继承。这并不是因为我们反对它(欢迎拉取请求!),而仅仅是因为它在 Dropbox 的开发中并不是必需的。您可能可以通过一些显式方法获得接近您需要的东西。例如。将 asParentInterface() 方法添加到您的子对象。在 C++ 层,您可以选择仅将“this”强制类型转换返回到另一种类型,并且您的 impl 对象将多次继承自 Djinni 基类。在应用程序语言中,您会在同一个底层对象上看到多个不同的代理对象。

关于cross-platform - Dropbox Djinni - 接口(interface)继承,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28811444/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com