| 677 | } |
| 678 | |
| 679 | string op_signature(AST_Operation *op) |
| 680 | { |
| 681 | string signature = |
| 682 | (op->void_return_type() ? "void" |
| 683 | : idl_mapping_java::type(op->return_type())) |
| 684 | + " " + op->local_name()->get_string() + "("; |
| 685 | UTL_ScopeActiveIterator it(op, UTL_Scope::IK_decls); |
| 686 | bool noArgs = true; |
| 687 | |
| 688 | for (; !it.is_done(); it.next()) { |
| 689 | noArgs = false; |
| 690 | AST_Decl *item = it.item(); |
| 691 | |
| 692 | if (item->node_type() == AST_Decl::NT_argument) { |
| 693 | AST_Argument *arg = dynamic_cast<AST_Argument*>(item); |
| 694 | signature += param_type(arg->field_type(), arg->direction()) |
| 695 | + " " + arg->local_name()->get_string() + ", "; |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | if (noArgs) signature += ")"; |
| 700 | |
| 701 | else signature.replace(signature.size() - 2, 2, ")"); |
| 702 | |
| 703 | return signature; |
| 704 | } |
| 705 | } |
| 706 | |
| 707 | bool idl_mapping_java::gen_interf(UTL_ScopedName *name, bool local, |
no test coverage detected