当前位置: 首页>>代码示例>>C++>>正文


C++ UmlRelation::stereotype方法代码示例

本文整理汇总了C++中UmlRelation::stereotype方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlRelation::stereotype方法的具体用法?C++ UmlRelation::stereotype怎么用?C++ UmlRelation::stereotype使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UmlRelation的用法示例。


在下文中一共展示了UmlRelation::stereotype方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: new_one


//.........这里部分代码省略.........
    
    if (rel->isVolatile() != volatilep) {
      rel->set_isVolatile(volatilep);
      container->set_updated();
    }
  }
  else {
#endif
    rel->set_Visibility(visibility);
    if (constp) rel->set_isReadOnly(TRUE);
    if (staticp) rel->set_isClassMember(TRUE);
    if (mutablep) rel->set_isCppMutable(TRUE);
    if (volatilep) rel->set_isVolatile(TRUE);
    
#ifdef ROUNDTRIP
  }
#endif
  
  Q3CString decl;
  
  if (typeform != "${type}") {
    // array & modified are empty, pretype is empty ?
    decl = CppSettings::relationDecl(TRUE, "*");
    
    int index = typeform.find("<");	// cannot be -1
    Q3CString st = typeform.left(index);
    Q3CString st_uml = CppSettings::umlType(st);

#ifdef ROUNDTRIP
    if (roundtrip) {
      if (st_uml.isEmpty()) 
	st_uml = st;
      
      if (neq(rel->stereotype(), st_uml)) {
	rel->set_Stereotype(st_uml);
	container->set_updated();
      }
    }
    else
#endif
      rel->set_Stereotype((st_uml.isEmpty()) ? st : st_uml);
    
    int index2;
    
    if ((index2 = decl.find("<${type}>")) == -1) {
      decl = "    ${comment}${static}${mutable}${volatile}${const}${stereotype}<${type}> ${name}${value};";
      index2 = decl.find("<${type}>");
    }
    decl.replace(index2, 9, typeform.mid(index));
  }
  else {
    if (!array.isEmpty()) {
#ifdef ROUNDTRIP
    if (roundtrip) {
      if (neq(rel->multiplicity(), array)) {
	rel->set_Multiplicity(array);
	container->set_updated();
      }
    }
    else
#endif
      rel->set_Multiplicity(array);
    }
    decl = CppSettings::relationDecl(modifier != "*", array);
    
    int index;
开发者ID:SciBoy,项目名称:douml,代码行数:67,代码来源:UmlRelation.cpp

示例2: new_one

// from a form 'generic<...C...> var' where C is a class
    bool UmlRelation::new_one(Class * container, const WrapperStr & name,
                              UmlClass * type, WrapperStr type_def,
                              WrapperStr genericname,
                              aVisibility visibility, bool staticp,
                              bool constp, bool transientp, bool volatilep,
                              const WrapperStr & array, const WrapperStr & value,
                              WrapperStr comment, WrapperStr description,
                              WrapperStr annotation
#ifdef ROUNDTRIP
                              , bool roundtrip, QList<UmlItem *> & expected_order
#endif
                             )
    {
#ifdef TRACE
        QLOG_INFO() << "RELATION '" << name << "' from '" << cl->Name() << "' to '" << type->Name()
                    << "' array '" << array << "'\n";
#endif

        if (
#ifdef REVERSE
            container->from_libp() &&
#endif
            (visibility == PrivateVisibility)) {
            Lex::finish_line();
            Lex::clear_comments();
            return TRUE;
        }

        WrapperStr st = JavaSettings::umlType(genericname);

        if (st.isEmpty())
            st = genericname;

        UmlClass * cl = container->get_uml();
        UmlRelation * rel;

#ifdef ROUNDTRIP
        bool created;

        if (!roundtrip ||
            ((rel = search_rel(container, name, type, st)) == 0)) {
#endif
            rel = UmlBaseRelation::create(aDirectionalAssociation, cl, type);

            if (rel == 0) {
                JavaCatWindow::trace(WrapperStr("<font face=helvetica><b>cannot add relation <i>")
                                     + name + "</i> in <i>" + cl->name() + "</i> to <i>"
                                     + type->name() + "</i></b></font><br>");
                return FALSE;
            }

#ifdef REVERSE
# ifndef ROUNDTRIP
            Statistic::one_relation_more();
# else

            if (roundtrip)
                container->set_updated();

            created = TRUE;
        }
        else
            created = FALSE;

# endif
#endif

            Lex::finish_line();

            comment = Lex::get_comments(comment);
            description = Lex::get_description(description);

            WrapperStr decl = JavaSettings::relationDecl(array);

            type_def.replace(0, genericname.length(), "${stereotype}");
            decl.replace(decl.find("${type}"), 7, type_def);


#ifdef ROUNDTRIP

            if (roundtrip && !created) {
                if (rel->visibility() != visibility) {
                    rel->set_Visibility(visibility);
                    container->set_updated();
                }

                if (decl.find("${description}") != -1) {
                    if (nequal(rel->description(), description)) {
                        rel->set_Description(description);
                        container->set_updated();
                    }
                }
                else if (nequal(rel->description(), Lex::simplify_comment(comment))) {
                    rel->set_Description(comment); // comment was set
                    container->set_updated();
                }

                if (rel->isReadOnly() != constp) {
                    rel->set_isReadOnly(constp);
//.........这里部分代码省略.........
开发者ID:jeremysalwen,项目名称:douml,代码行数:101,代码来源:UmlRelation.cpp

示例3: manage_inherit


//.........这里部分代码省略.........
                is_new = !roundtrip || ((rel = search_for_inherit(mother.type)) == 0);
#endif
                mother_name += "<" + after_gt;
                Lex::come_back();

                // must add inheritance before setting actuals
                if (
#ifdef ROUNDTRIP
                    is_new && (
#endif
                               (rel = UmlBaseRelation::create(aRealization, this, mother.type)) == 0
#ifdef ROUNDTRIP
                               )
#endif
                    )
                {
                    Lex::warn("cannot inherit <font color =\"red\">" +
                              Lex::quote(mother_name) + " </font>");
#ifdef DEBUG_DOUML
                    QLOG_INFO() << "cannot create <|---\n";
#endif
                    return FALSE;
                }
                else if (!get_actuals(mother.type, container, tmplts
#ifdef ROUNDTRIP
                                      , !is_new
#endif
                                     ))
                    return FALSE;

#ifdef ROUNDTRIP

                if (! is_new) {
                    if (neq(rel->stereotype(), "bind")) {
                        rel->set_Stereotype("bind");
                        the_class->set_updated();
                    }
                }
                else
#endif
                    rel->set_Stereotype("bind");

                s = Lex::read_word();
            }
        }

        if (mother.type == 0) {
            mother.type = auxilarily_typedef(mother_name
#ifdef REVERSE
                                             , libp
# ifdef ROUNDTRIP
                                             , container_roundtrip
                                             , container_expected_order
# endif
#endif
                                            );

            if (mother.type == 0)
                return FALSE;
        }

#ifdef ROUNDTRIP

        if (rel == 0)
            is_new = !roundtrip || ((rel = search_for_inherit(mother.type)) == 0);
开发者ID:ErickCastellanos,项目名称:douml,代码行数:66,代码来源:UmlClass.cpp


注:本文中的UmlRelation::stereotype方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。