Beispiel #1
0
void UmlOperation::write_return_type(FileOut & out, QCString decl) {
  const UmlTypeSpec & t = returnType();
  static int return_rank = 0;
  
  if ((t.type != 0) || !t.explicit_type.isEmpty()) {
    out.indent();
    out << "<UML:Parameter name=\"return\" xmi.id=\"BOUML_return_"
        << ++return_rank << "\" kind=\"return\">\n";
    out.indent();
    out << "\t<UML:Parameter.type>\n";
    out.indent();
    out << "\t\t<UML:DataType";
    switch (_lang) {
    case Uml:
      if (t.type != 0)
	out.idref(t.type);
      else
	out.idref_datatype(t.explicit_type);
      break;
    case Cpp:
      write_cpp_returntype(out, decl);
      break;
    default: // java
      write_java_returntype(out, decl);
    }
    out << "/>\n";
    out.indent();
    out << "\t</UML:Parameter.type>\n";
    out.indent();
    out << "</UML:Parameter>\n";
  }
}
Beispiel #2
0
void UmlOperation::write_return_type(FileOut & out, WrapperStr decl)
{
    const UmlTypeSpec & t = returnType();
    static int return_rank = 0;

    if ((t.type != 0) || !t.explicit_type.isEmpty()) {
        out.indent();
        out << "<ownedParameter name=\"return\" xmi:id=\"BOUML_return_"
            << ++return_rank << "\" direction=\"";

        if (_pk_prefix)
            out << "pk_";

        out << "return\">\n";

        switch (_lang) {
        case Uml:
            out.indent(+1);
            UmlItem::write_type(out, t);
            out.indent(-1);
            break;

        case Cpp:
            out.indent();
            out << "\t<type xmi:type=\"uml:Class\"";
            write_cpp_returntype(out, decl);
            out << "/>\n";
            break;

        default: // java
            out.indent();
            out << "\t<type xmi:type=\"uml:Class\"";
            write_java_returntype(out, decl);
            out << "/>\n";
        }

        out.indent();
        out << "</ownedParameter>\n";
    }
}