Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

Djinni Interface Inheritance #270

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Merge dropbox/djinni commit '502b77ff3cc6158aee5d8223f18c84783985574f…
…' into master
  • Loading branch information
Mike Foster committed Jul 27, 2016
commit 51f9edd0fdded5f9453e9a600351edace6054883
3 changes: 2 additions & 1 deletion src/source/CppGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ class CppGenerator(spec: Spec) extends Generator(spec) {

val self = marshal.typename(ident, i)
val superNametype = marshal.superTypename(i)
val methodNamesInScope = i.methods.map(m => idCpp.method(m.ident))

writeHppFile(ident, origin, refs.hpp, refs.hppFwds, w => {

Expand Down Expand Up @@ -355,7 +356,7 @@ class CppGenerator(spec: Spec) extends Generator(spec) {
}
})

// Only generate the cpp file if constants need to be defined.
// Cpp only generated in need of Constants
if (i.consts.nonEmpty) {
writeCppFile(ident, origin, refs.cpp, w => {
generateCppConstants(w, i.consts, self)
Expand Down
2 changes: 2 additions & 0 deletions src/source/CppMarshal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class CppMarshal(spec: Spec) extends Marshal(spec) {
case _ => None
}

def paramType(tm: MExpr, scopeSymbols: Seq[String]): String = toCppParamType(tm, None, scopeSymbols)
def paramType(ty: TypeRef, scopeSymbols: Seq[String]): String = paramType(ty.resolved, scopeSymbols)
override def paramType(tm: MExpr): String = toCppParamType(tm)
override def fqParamType(tm: MExpr): String = toCppParamType(tm, Some(spec.cppNamespace))

Expand Down
3 changes: 3 additions & 0 deletions src/source/ObjcGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class ObjcGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
writeAlignedObjcCall(w, decl, List(), ";", p => ("",""))
}

/**
* Generate Interface
*/
override def generateInterface(idl: Seq[TypeDecl], origin: String, ident: Ident, doc: Doc, typeParams: Seq[TypeParam], i: Interface) {
val refs = new ObjcRefs()
i.methods.map(m => {
Expand Down
4 changes: 3 additions & 1 deletion src/source/resolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private def resolveRecord(scope: Scope, r: Record) {
}

private def resolveInterface(idl: Seq[TypeDecl], scope: Scope, i: Interface) {
// Check for static methods in Java or Objective-C; not allowed
// Const and static methods are only allowed on +c (only) interfaces
if (i.ext.java || i.ext.objc) {
for (m <- i.methods) {
if (m.static)
Expand All @@ -286,6 +286,8 @@ private def resolveInterface(idl: Seq[TypeDecl], scope: Scope, i: Interface) {
}
}


// Static+const isn't valid
if (i.ext.cpp) {
for (m <- i.methods) {
if (m.static && m.const)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.