*** Gen.cpp 2011-10-14 18:18:50.000000000 +0400 --- /home/zmij/cppworkspace/slice2as/src/Gen.cpp 2011-12-26 14:23:06.311615858 +0400 *************** *** 8,14 **** // ********************************************************************** #include ! #include #include #include #include --- 8,14 ---- // ********************************************************************** #include ! #include "Gen.h" #include #include #include *************** *** 358,363 **** --- 358,368 ---- string package = getPackage(p); string scoped = p->scoped(); ClassList bases = p->bases(); + ClassDefPtr baseClass; + if(!bases.empty() && !bases.front()->isInterface()) + { + baseClass = bases.front(); + } ClassList allBases = p->allBases(); StringList ids; *************** *** 806,812 **** string retS = typeToString(ret, TypeModeReturn, op->getMetaData()); out << sp; ! out << nl << "public function " << (amd ? opname + "_async" : fixKwd(opname)) << spar << params; if(!p->isLocal()) { out << "__current:Ice.Current=null"; --- 811,828 ---- string retS = typeToString(ret, TypeModeReturn, op->getMetaData()); out << sp; ! out << nl << "public "; ! // Check if the operation is overriden. ! // Quick fix, there is always a better way to do it. ! if (baseClass) { ! OperationList baseOps = baseClass->allOperations(); ! OperationList::iterator f = std::find(baseOps.begin(), baseOps.end(), op); ! if (f != baseOps.end()) ! out << "override "; ! } ! ! out << "function "; ! out << nl << (amd ? opname + "_async" : fixKwd(opname)) << spar << params; if(!p->isLocal()) { out << "__current:Ice.Current=null"; *************** *** 2048,2054 **** if(!p->isInterface() || p->isLocal()) { ! OperationList ops = p->operations(); for(OperationList::const_iterator r = ops.begin(); r != ops.end(); ++r) { --- 2064,2070 ---- if(!p->isInterface() || p->isLocal()) { ! OperationList ops = p->allOperations(); for(OperationList::const_iterator r = ops.begin(); r != ops.end(); ++r) { *************** *** 2082,2087 **** --- 2098,2119 ---- { tracker.add("Ice.AsyncResult"); } + + ContainerPtr container = op->container(); + ClassDefPtr cl = ClassDefPtr::dynamicCast(container); + assert(cl); + if(cl->scoped() != p->scoped()) + { + string base; + if(cl->isInterface()) + { + tracker.add(getAbsolute(cl, "_", "Disp")); + } + else + { + tracker.add(getAbsolute(cl)); + } + } } tracker.add(allDataMembers); *************** *** 4320,4326 **** out << sp << "package " << package; out << sb; ! OperationList ops = p->operations(); OperationList::const_iterator r; // --- 4352,4358 ---- out << sp << "package " << package; out << sb; ! OperationList ops = p->allOperations(); OperationList::const_iterator r; // *************** *** 4383,4388 **** --- 4415,4436 ---- { tracker.add(getAbsolute(*eli)); } + + ContainerPtr container = op->container(); + ClassDefPtr cl = ClassDefPtr::dynamicCast(container); + assert(cl); + if(cl->scoped() != p->scoped()) + { + string base; + if(cl->isInterface()) + { + tracker.add(getAbsolute(cl, "_", "Disp")); + } + else + { + tracker.add(getAbsolute(cl)); + } + } } tracker.write(out);