Example #1
0
void tst_Q3ValueList::count()
{
    Q3ValueList<int> a;
    QCOMPARE( (int)a.count(), 0 );

    a.append( 1 );
    QCOMPARE( (int)a.count(), 1 );

    a.append( 2 );
    QCOMPARE( (int)a.count(), 2 );

    a.append( 3 );
    QCOMPARE( (int)a.count(), 3 );

    a.clear();
    QCOMPARE( (int)a.count(), 0 );
}
Example #2
0
static bool generate_var(const Q3ValueList<UmlParameter> & params,
                         unsigned rank, QTextStream & f)
{
    if ((int)rank >= params.count())
        return FALSE;

    f << params[rank].name;
    return TRUE;
}
Example #3
0
static bool generate_type(const Q3ValueList<UmlParameter> & params,
                          unsigned rank, QTextStream & f)
{
    if ((int)rank >= params.count())
        return FALSE;

    UmlClass::write(f, params[rank].type);
    return TRUE;
}
Example #4
0
void tst_Q3ValueList::insert()
{
    Q3ValueList<int> a;
    a.append( 1 );
    a.append( 10 );
    a.append( 100 );

    Q3ValueListIterator<int> it = a.fromLast();
    it = a.insert( it, 1000 );

    QCOMPARE( *(it), 1000 );
    QCOMPARE( *(++it), 100 );
    QCOMPARE( (int)a.count(), 4 );

    it = a.fromLast();
    a.insert( it, 10, 1234 );
    QCOMPARE( (int)a.count(), 14 );
}
Example #5
0
static bool generate_init(const Q3ValueList<UmlParameter> & params, 
			  unsigned rank, QTextOStream & f)
{
  if (rank >= params.count())
    return FALSE;
  
  if (! params[rank].default_value.isEmpty())
    f << " = " << params[rank].default_value;
  
  return TRUE;
}
Example #6
0
static bool generate_type(const Q3ValueList<UmlParameter> & params,
			  unsigned rank, QTextOStream & f, bool in_params)
{
  if (rank >= params.count())
    return FALSE;
  
  const UmlTypeSpec & t = params[rank].type;
  
  if (in_params && ((t.type != 0) || !t.explicit_type.isEmpty()))
    f << ": ";
  
  UmlClass::write(f, t);
  return TRUE;
}
Example #7
0
void tst_Q3ValueList::popping()
{
    Q3ValueList<int> a;
    a.append( 1 );
    a.append( 10 );
    a.append( 100 );
    a.append( 1000 );
    a.append( 10000 );

    a.pop_front();
    QCOMPARE( a.first(), 10 );
    QCOMPARE( a.last(), 10000 );

    a.pop_back();
    QCOMPARE( a.first(), 10 );
    QCOMPARE( a.last(), 1000 );

    QCOMPARE( (int)a.count(), 3 );

    a.pop_back();
    a.pop_back();
    a.pop_back();
    QVERIFY( a.isEmpty() );
}
Example #8
0
void NoteDrag::serializeImage(NoteSelection *noteList, K3MultipleDrag *multipleDrag)
{
	Q3ValueList<QPixmap> pixmaps;
	QPixmap pixmap;
	for (NoteSelection *node = noteList->firstStacked(); node; node = node->nextStacked()) {
		pixmap = node->note->content()->toPixmap();
		if (!pixmap.isNull())
			pixmaps.append(pixmap);
	}
	if (!pixmaps.isEmpty()) {
		QPixmap pixmapEquivalent;
		if (pixmaps.count() == 1)
			pixmapEquivalent = pixmaps[0];
		else {
			// Search the total size:
			int height = 0;
			int width  = 0;
			for (Q3ValueList<QPixmap>::iterator it = pixmaps.begin(); it != pixmaps.end(); ++it) {
				height += (*it).height();
				if ((*it).width() > width)
					width = (*it).width();
			}
			// Create the image by painting all image into one big image:
			pixmapEquivalent.resize(width, height);
			pixmapEquivalent.fill(Qt::white);
			QPainter painter(&pixmapEquivalent);
			height = 0;
			for (Q3ValueList<QPixmap>::iterator it = pixmaps.begin(); it != pixmaps.end(); ++it) {
				painter.drawPixmap(0, height, *it);
				height += (*it).height();
			}
		}
		Q3ImageDrag *imageDrag = new Q3ImageDrag(pixmapEquivalent.convertToImage());
		multipleDrag->addDragObject(imageDrag);
	}
}
Example #9
0
void DietWizardDialog::createDiet( void )
{
	KApplication::setOverrideCursor( Qt::WaitCursor );

	START_TIMER("Creating the diet");

	RecipeList rlist;
	dietRList->clear();

	// Get the whole list of recipes, detailed
	int flags = RecipeDB::Title | getNecessaryFlags();
	database->loadRecipes( &rlist, flags );

	// temporal iterator list so elements can be removed without reloading them again from the DB
	// this list prevents the same meal from showing up in the same day twice
	Q3ValueList <RecipeList::Iterator> tempRList;

	bool alert = false;

	for ( int day = 0;day < dayNumber;day++ )  // Create the diet for the number of days defined by the user
	{
		populateIteratorList( rlist, &tempRList ); // temporal iterator list so elements can be removed without reloading them again from the DB
		for ( int meal = 0;meal < mealNumber;meal++ )
		{
			int dishNo = ( ( MealInput* ) ( mealTabs->widget( meal ) ) ) ->dishNo();

			for ( int dish = 0;dish < dishNo;dish++ ) {
				bool found = false;
				Q3ValueList <RecipeList::Iterator> tempDishRList = tempRList;
				while ( ( !found ) && !tempDishRList.empty() ) {
					int random_index = ( int ) ( ( float ) ( KRandom::random() ) / ( float ) RAND_MAX * tempDishRList.count() );
					Q3ValueList<RecipeList::Iterator>::Iterator iit = tempDishRList.at( random_index ); // note that at() retrieves an iterator to the iterator list, so we need to use * in order to get the RecipeList::Iterator

					RecipeList::Iterator rit = *iit;
					if ( found = ( ( ( !categoryFiltering( meal, dish ) ) || checkCategories( *rit, meal, dish ) ) && checkConstraints( *rit, meal, dish ) ) )  // Check that the recipe is inside the constraint limits and in the categories specified
					{
						dietRList->append( *rit ); // Add recipe to the diet list
						tempRList.remove( tempRList.find(*iit) ); //can't just remove()... the iterator isn't from this list (its an iterator from tempDishRList)
					}
					else {
						tempDishRList.remove( iit ); // Remove this analized recipe from teh list
					}
				}
				if ( !found )
					alert = true;
			}
		}
	}

	if ( alert ) {
		KApplication::restoreOverrideCursor();
		KMessageBox::sorry( this, i18nc( "@info", "Given the constraints, a full diet list could not be constructed. Either the recipe list is too short or the constraints are too demanding. " ) );
	}

	else // show the resulting diet
	{

		// make a list of dishnumbers
		QList<int> dishNumbers;

		for ( int meal = 0;meal < mealNumber;meal++ ) {
			int dishNo = ( ( MealInput* ) ( mealTabs->widget( meal ) ) ) ->dishNo();
			dishNumbers << dishNo;
		}

		KApplication::restoreOverrideCursor();

		// display the list
		QPointer<DietViewDialog> dietDisplay = new DietViewDialog( this, *dietRList, dayNumber, mealNumber, dishNumbers );
		connect( dietDisplay, SIGNAL( signalOk() ), this, SLOT( createShoppingList() ) );
		dietDisplay->exec();
		delete dietDisplay;
	}

	END_TIMER();
}
Example #10
0
void UmlOperation::gen_java_decl(Q3CString s, bool descr)
{
    const char * p = bypass_comment(s);
    const Q3ValueList<UmlParameter> & pa = params();
    unsigned npa = pa.count();
    unsigned rank;

    while (*p) {
        if (!strncmp(p, "${comment}", 10))
            p += 10;
        else if (!strncmp(p, "${description}", 14))
            p += 14;
        else if (!strncmp(p, "${final}", 8)) {
            p += 8;

            if (isJavaFinal())
                fw.write("final ");
        }
        else if (!strncmp(p, "${visibility}", 13)) {
            p += 13;
            UmlItem::write(visibility(), javaLanguage);
            fw.write(' ');
        }
        else if (!strncmp(p, "${static}", 9)) {
            p += 9;

            if (isClassMember())
                fw.write("static ");
        }
        else if (!strncmp(p, "${abstract}", 11)) {
            p += 11;

            if (isAbstract())
                fw.write("abstract ");
        }
        else if (!strncmp(p, "${synchronized}", 15)) {
            p += 15;

            if (isJavaSynchronized())
                fw.write("synchronized ");
        }
        else if (!strncmp(p, "${type}", 7)) {
            p += 7;
            write(returnType(), javaLanguage);
        }
        else if (!strncmp(p, "${name}", 7)) {
            p += 7;
            writeq(compute_name(javaNameSpec()));
        }
        else if (!strncmp(p, "${(}", 4)) {
            p += 4;
            fw.write('(');
        }
        else if (!strncmp(p, "${)}", 4)) {
            p += 4;
            fw.write(')');
        }
        else if (!strncmp(p, "${throws}", 9)) {
            p += 9;

            const char * sep = " throws ";
            const Q3ValueList<UmlTypeSpec> e = exceptions();
            unsigned n = e.count();

            for (unsigned index2 = 0; index2 != n; index2 += 1) {
                fw.write(sep);
                sep = ", ";
                write(e[index2], javaLanguage);
            }
        }
        else if (!strncmp(p, "${staticnl}", 11))
            break;
        else if (sscanf(p, "${t%u}", &rank) == 1) {
            p = strchr(p, '}') + 1;

            if (rank < npa)
                write(pa[rank].type, javaLanguage);
            else
                fw.write("???");
        }
        else if (sscanf(p, "${p%u}", &rank) == 1) {
            p = strchr(p, '}') + 1;

            if (rank < npa)
                writeq(pa[rank].name);
            else
                fw.write("???");
        }
        else if (!strncmp(p, "${stereotype}", 13)) {
            p += 13;
            // get/set relation with multiplicity > 1
            UmlClassMember * m = getOf();

            if ((m != 0) || ((m = setOf()) != 0))
                writeq(JavaSettings::relationAttributeStereotype(m->stereotype()));
        }
        else if (!strncmp(p, "${association}", 14)) {
            p += 14;
            // get/set relation with multiplicity > 1
            UmlClassMember * m = getOf();

            if (((m != 0) || ((m = setOf()) != 0)) &&
                (m->kind() == aRelation))
                write(((UmlRelation *) m)->association(), javaLanguage);
        }
        else if (!strncmp(p, "${@}", 4))
            p += 4;
        else if (*p == '\r')
            p += 1;
        else if (*p == '\n') {
            if (descr) {
                fw.write("<br />");
                p += 1;
            }
            else {
                fw.write(' ');

                do
                    p += 1;

                while ((*p != 0) && (*p <= ' '));
            }
        }
        else if ((*p == '{') || (*p == ';')) {
            if (descr)
                fw.write(*p++);
            else
                break;
        }
        else if (*p == '@')
            manage_alias(p);
        else
            writeq(*p++);
    }
}
Example #11
0
void UmlOperation::gen_cpp_decl(Q3CString s, bool descr)
{
    const char * p = bypass_comment(s);

    if (! descr) {
        write((cppVisibility() == DefaultVisibility)
              ? visibility() : cppVisibility(),
              cppLanguage);
        fw.write(": ");
        p = bypass_comment(s);
    }
    else
        p = s;

    const Q3ValueList<UmlParameter> & pa = params();
    unsigned npa = pa.count();
    unsigned rank;

    while (*p) {
        if (!strncmp(p, "${comment}", 10))
            p += 10;
        else if (!strncmp(p, "${description}", 14))
            p += 14;
        else if (!strncmp(p, "${friend}", 9)) {
            p += 9;

            if (isCppFriend())
                fw.write("friend ");
        }
        else if (!strncmp(p, "${static}", 9)) {
            p += 9;

            if (isClassMember())
                fw.write("static ");
        }
        else if (!strncmp(p, "${inline}", 9)) {
            p += 9;

            if (isCppInline())
                fw.write("inline ");
        }
        else if (!strncmp(p, "${virtual}", 10)) {
            p += 10;

            if (isCppVirtual())
                fw.write("virtual ");
        }
        else if (!strncmp(p, "${type}", 7)) {
            p += 7;
            write(returnType(), cppLanguage);
        }
        else if (!strncmp(p, "${name}", 7)) {
            p += 7;
            writeq(compute_name(cppNameSpec()));
        }
        else if (!strncmp(p, "${(}", 4)) {
            p += 4;
            fw.write('(');
        }
        else if (!strncmp(p, "${)}", 4)) {
            p += 4;
            fw.write(')');
        }
        else if (!strncmp(p, "${const}", 8)) {
            p += 8;

            if (isCppConst())
                fw.write(" const");
        }
        else if (!strncmp(p, "${volatile}", 11)) {
            p += 11;

            if (isVolatile())
                fw.write(" volatile");
        }
        else if (!strncmp(p, "${throw}", 8)) {
            p += 8;

            const char * sep = " throw (";
            Q3ValueList<UmlTypeSpec> e = exceptions();
            unsigned n = e.count();
            unsigned index2;

            for (index2 = 0; index2 != n; index2 += 1) {
                fw.write(sep);
                sep = ", ";
                write(e[index2], cppLanguage);
            }

            if (index2 != 0)
                fw.write(')');
            else if (CppSettings::operationForceThrow())
                fw.write(" throw ()");
        }
        else if (sscanf(p, "${t%u}", &rank) == 1) {
            p = strchr(p, '}') + 1;

            if (rank < npa)
                write(pa[rank].type, cppLanguage);
            else
                fw.write("???");
        }
        else if (sscanf(p, "${p%u}", &rank) == 1) {
            p = strchr(p, '}') + 1;

            if (rank < pa.count())
                writeq(pa[rank].name);
            else
                fw.write("???");
        }
        else if (sscanf(p, "${v%u}", &rank) == 1) {
            p = strchr(p, '}') + 1;

            if (rank >= pa.count())
                fw.write("???");
            else if (! pa[rank].default_value.isEmpty()) {
                fw.write(" = ");
                writeq(pa[rank].default_value);
            }
        }
        else if (!strncmp(p, "${abstract}", 11)) {
            if (isAbstract())
                fw.write("= 0 ");

            break;
        }
        else if (!strncmp(p, "${stereotype}", 13)) {
            p += 13;
            // get/set relation with multiplicity > 1
            UmlClassMember * m = getOf();

            if ((m != 0) || ((m = setOf()) != 0))
                writeq(CppSettings::relationAttributeStereotype(m->stereotype()));
        }
        else if (!strncmp(p, "${association}", 14)) {
            p += 14;
            // get/set relation with multiplicity > 1
            UmlClassMember * m = getOf();

            if (((m != 0) || ((m = setOf()) != 0)) &&
                (m->kind() == aRelation))
                write(((UmlRelation *) m)->association(), cppLanguage);
        }
        else if (*p == '\r')
            p += 1;
        else if (*p == '\n') {
            if (descr) {
                fw.write("<br />");
                p += 1;
            }
            else {
                fw.write(' ');

                do
                    p += 1;

                while ((*p != 0) && (*p <= ' '));
            }
        }
        else if ((*p == '{') || (*p == ';')) {
            if (descr)
                fw.write(*p++);
            else
                break;
        }
        else if (*p == '@')
            manage_alias(p);
        else
            writeq(*p++);
    }
}
Example #12
0
void UmlOperation::gen_uml_decl()
{
    if (isAbstract())
        fw.write("abstract, ");

    if (isClassMember())
        fw.write("static, ");

    write(visibility());
    writeq(name());

    const Q3ValueList<UmlParameter> & pa = params();
    unsigned npa = pa.count();
    unsigned rank;
    const char * sep = "(";

    for (rank = 0; rank != npa; rank += 1) {
        const UmlParameter & p = pa[rank];

        fw.write(sep);
        sep = ", ";

        switch (p.dir) {
        case InputOutputDirection:
            fw.write("inout ");
            break;

        case InputDirection:
            fw.write("in ");
            break;

        default:
            // OutputDirection
            fw.write("out ");
        }

        writeq(p.name);
        fw.write(" : ");
        write(p.type);

        Q3CString s = p.default_value;

        if (!s.isEmpty()) {
            if (s[0] != '=')
                fw.write(" = ");

            writeq(s);
        }
    }

    fw.write((rank == 0) ? "() : " : ") : ");
    write(returnType());

    sep = ",  exceptions : ";

    const Q3ValueList<UmlTypeSpec> e = exceptions();
    unsigned n = e.count();

    for (unsigned index2 = 0; index2 != n; index2 += 1) {
        fw.write(sep);
        sep = ", ";
        write(e[index2]);
    }
}
Example #13
0
bool UmlOperation::new_one(Class * container, aVisibility visibility,
			   bool finalp, bool abstractp, bool staticp,
			   Q3CString comment, Q3CString description)
{
  // 'function' was read, it is followed by :
  // ['&'] name'(' {'array' | <classname>] ['&'] '$'<varname> ['=' <value>]}* ')' '{' ... '}'
  Q3CString s = Lex::read_word();
  bool refp;
  
  if (s == "&") {
    refp = TRUE;
    s = Lex::read_word();
  }
  else
    refp = FALSE;
  
  if (s.isEmpty()) {
    Lex::premature_eof();
    return FALSE;
  }
    
  Q3CString name = s;
  
#ifdef TRACE
  QLOG_INFO() <<"OPERATION '" << name << "'\n";
#endif
  
  s = Lex::read_word();
  if (s != "(") {
    Lex::syntax_error("'(' expected rather than '" + s + "'");
    return FALSE;
  }
  
  UmlClass * cl = container->get_uml();
  UmlOperation * op;
  
#ifndef REVERSE
  if (visibility == PrivateVisibility)
    op = 0;
  else
#endif
  {
    op = UmlBaseOperation::create(cl, name);
    
    if (op == 0) {
      PhpCatWindow::trace(Q3CString("<font face=helvetica><b>cannot add operation <i>")
			   + name + "</i> in <i>" + cl->name() 
			   + "</i></b></font><br>");  
      return FALSE;
    }
    
#ifdef REVERSE
    Statistic::one_operation_more();
#endif
  }
    
  Q3CString def;
    
  if (op != 0) {
    op->set_Visibility(visibility);
    if (staticp) op->set_isClassMember(TRUE);
    if (finalp) op->set_isPhpFinal(TRUE);
  
    def = PhpSettings::operationDef();
  
    int index;
    
    if (((index = def.find("${(}")) == -1) ||
	(def.find("${)}", index + 4) == -1) ||
	((index = def.find("${name}")) == -1) ||
	(def.find("${body}") == -1)) {
      // use a definition where ${body] is not indented
      def = "  ${comment}${final}${visibility}${abstract}${static}function ${name}${(}${)}\n{\n  ${body}}\n";
      index = def.find("${name}");
    }
    
    if (refp)
      def.insert(index, "&");
    
    if ((name == cl->name()) || (name == "__construct")) {
      // constructor, remove useless ${}
      if ((index = def.find("${static}")) != -1)
	def.remove(index, 9);
      if ((index = def.find("${final}")) != -1)
	def.remove(index, 8);
      if ((index = def.find("${abstract}")) != -1)
	def.remove(index, 11);
    }
    
    if (abstractp) {
      op->set_isAbstract(TRUE);
      
      def = def.left(def.find("${)}") + 4) + ";";
    }
  }
  
  // parameters
  
  unsigned rank = 0;
  UmlParameter param;
  
  while (read_param(container, rank, param, def, op == 0)) {
    if ((op != 0) && ! op->addParameter(rank++, param)) {
      PhpCatWindow::trace(Q3CString("<font face=helvetica><b>cannot add param <i>")
			   + name + "</i> in <i>" + cl->name() 
			   + "</i></b></font><br>");  
#ifdef TRACE
      QLOG_INFO() <<"ERROR cannot add param '" << param.name << '\n';
#endif
      return FALSE;
    }
  }
  
  s = Lex::read_word();
  
  if (s.isEmpty()) {
    Lex::premature_eof();
    return FALSE;
  }
    
  // definition
  
  if (abstractp || (cl->stereotype() == "interface")) {
    if (s != ";") {
      Lex::error_near(s);
      return FALSE;
    }
#ifdef REVERSE
    if (op != 0)
      op->set_PhpBody(0);
#endif
  }
  else if (s != "{") {
    Lex::error_near(s);
    return FALSE;
  }
  else {
    Lex::mark();
    
    // goto the end of the body
    
    char c;
    int level = 1;	// '{' already read
    
    for (;;) {
      if ((c = Lex::read_word_bis()) == 0)
	return FALSE;
      else if (c == '{')
	level += 1;
      else if ((c == '}') && (--level == 0))
	break;
    }
    
#ifdef REVERSE
    if (op != 0) {
      Q3CString e = Lex::region();
      
      e.truncate(e.length() - 1);	// remove }

      // remove fist \n
      if (*((const char *) e) == '\n')
	e.remove(0, 1);
      
      // remove last spaces and tabs
      int ln = e.length();
      
      while (ln && ((e[ln - 1] == ' ') || (e[ln - 1] == '\t')))
	ln -= 1;
      e.truncate(ln);
      
      op->set_PhpBody(e);
      op->set_PhpContextualBodyIndent(FALSE);
    }
#endif
  }
  
  if ((op != 0) && (def != op->phpDecl()))
    op->set_PhpDecl(def);
  
  Lex::clear_comments();	// params & body comments
  Lex::finish_line();
  
  if ((op != 0) && !comment.isEmpty()) {
    s = (def.find("${description}") != -1) ? description : comment;
    
    UmlTypeSpec t;
    int index1;
    
    if (! (t.explicit_type = value_of(s, "@return", index1)).isEmpty()) {
      op->set_ReturnType(t);
      s.replace(index1, t.explicit_type.length(), "${type}");
    }
    
    Q3ValueList<UmlParameter> l = op->params();
    unsigned nparams = l.count();

    if (nparams != 0) {
      Q3CString varname;
      int index2;
      char xn[16];

      index1 = 0;
      rank = 0;
      
      while (!((t.explicit_type = value_of(s, "@param", index1, varname, index2))
	       .isEmpty())) {
	if (varname.isEmpty() || (varname[0] != '$')) {
	  if (rank < nparams) {
	    UmlParameter & p = l[rank];
	    
	    p.type = t;
	    op->replaceParameter(rank, p);
	  }
	}
	else {
	  varname = varname.mid(1);
	  
	  Q3ValueList<UmlParameter>::Iterator it;
	  
	  for (it = l.begin(), rank = 0; it != l.end(); ++it, rank += 1) {
	    if ((*it).name == varname) {
	      (*it).type = t;
	      op->replaceParameter(rank, *it);
	      sprintf(xn, "${p%d}", rank);
	      s.replace(index2, varname.length() + 1, xn);
	      break;
	    }
	  }
	}
	sprintf(xn, "${t%d}", rank++);
	s.replace(index1, t.explicit_type.length(), xn);
      }
    }
    op->set_Description(s);
  }
  
  return TRUE;
}
Example #14
0
void UmlClass::utilities()
{
    TRACE_FUNCTION;
    const Q3PtrVector<UmlItem> ch = children();
    bool have_constructor = FALSE;
    bool have_destructor = FALSE;
    Q3CString destr = "~" + name();
    bool have_copy = FALSE;
    bool have_const_copy = FALSE;
    bool have_assignment = FALSE;
    bool have_const_assignment = FALSE;

    for (unsigned i = 0; i != ch.size(); i += 1) {
        if (ch[i]->kind() == anOperation) { //[rageek] literal comparison
            Q3CString s = ch[i]->name(); //[rageek]


            if (s == name()) {
                // may be a constructor or a copy constructor
                const Q3ValueList<UmlParameter> params =
                    ((UmlOperation *) ch[i])->params();

                if (params.count() == 1) {
                    const UmlParameter & param = *(params.at(0));

                    if (param.type.type == this) {
                        if (param.dir == InputDirection)
                            have_const_copy = TRUE;
                        else
                            have_copy = TRUE;
                    }
                    else
                        have_constructor = TRUE;
                }
                else
                    have_constructor = TRUE;
            }
            else if (s == destr)
                have_destructor = TRUE;
            else if (s == "operator=") {
                const Q3ValueList<UmlParameter> params =
                    ((UmlOperation *) ch[i])->params();

                if (params.count() == 1) {
                    if ((*(params.at(0))).dir == InputDirection)
                        have_const_assignment = TRUE;
                    else
                        have_assignment = TRUE;
                }
            }
        }
    }

    ConstrDestrCopyDialog d(this, have_constructor, have_destructor,
                            have_copy, have_const_copy,
                            have_assignment, have_const_assignment);

    d.exec();


}
Example #15
0
void UmlOperation::write_cpp_java_params(FileOut & out, WrapperStr decl)
{
    int index1 = decl.find("${(}");

    if (index1 == -1)
        return;

    int index2 = decl.find("${)}", index1 + 4);

    if (index2 == -1)
        return;

    decl = decl.mid(index1 + 4, index2 - index1 - 4);

    index1 = 0;

    const Q3ValueList<UmlParameter> p = params();
    WrapperStr sparam;
    WrapperStr kname;
    WrapperStr ktype;
    int rank;

    while (get_param(decl, index1, sparam, kname, ktype, rank)) {
        if (rank < (int) p.count()) {
            const UmlParameter & pa = p[rank];

            out.indent();
            out << "<ownedParameter xmi:type=\"uml:Parameter\" name=\"" << pa.name
                << "\" xmi:id=\"BOUML_op_param_"
                << ++param_id << "\" direction =\"";

            if (_pk_prefix)
                out << "pk_";

            switch (pa.dir) {
            case InputOutputDirection:
                out << "inout\">\n";
                break;

            case OutputDirection:
                out << "out\">\n";
                break;

            default:
                out << "in\">\n";
            }

            UmlTypeSpec t = pa.type;

            if ((t.type != 0) ||
                !(t.explicit_type = (_lang == Cpp)
                                    ? CppSettings::type(t.explicit_type)
                                    : JavaSettings::type(t.explicit_type)).isEmpty()) {
                out.indent();
                out << "\t<type xmi:type=\"uml:Class\"";
                write_type(out, t, sparam, kname, ktype);
                out << "/>\n";
            }

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