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


C++ UmlItem::name方法代码示例

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


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

示例1: parent

UmlClass * UmlClass::addMetaclass(WrapperStr mclname, const char * mclpath)
{
    UmlPackage * pack = (UmlPackage *) parent()->parent();	// is a package
    const Q3PtrVector<UmlItem> ch = pack->children();
    unsigned n = ch.size();
    UmlClass * r = 0;

    for (unsigned i = 0; i != n; i += 1) {
        UmlItem * x = ch[i];

        if ((x->kind() == aClassView) &&
            !strncmp(x->name(), "meta classes", 12) &&
            ((r = UmlClass::create(x, mclname)) != 0))
            break;
    }

    if (r == 0) {
        WrapperStr s = "meta classes";
        UmlItem * v = 0;

        while ((v = UmlClassView::create(pack, s)) == 0)
            s += "_";

        r = UmlClass::create(v, mclname);
    }

    r->set_Stereotype("metaclass");

    if (mclpath != 0)
        r->set_PropertyValue("metaclassPath", mclpath);

    return r;
}
开发者ID:daniel7solis,项目名称:douml,代码行数:33,代码来源:UmlClass.cpp

示例2: add_init

void UmlExtraClassMember::add_init(UmlClass * cl, WrapperStr def, bool roundtrip,
                                   QList<UmlItem *> & expected_order)
{
    if (roundtrip) {
        const QVector<UmlItem*> & ch = cl->children();
        UmlItem *const* v = ch.data();
        UmlItem *const*  vsup = v + ch.size();
        UmlItem * x;

        for (; v != vsup; v += 1) {
            if (((x = *v)->kind() == anExtraClassMember) &&
                ((UmlExtraClassMember *) x)->is_useless() &&
                (x->name() == "initialization")) {
                expected_order.append(x);

                if (neq(((UmlExtraClassMember *) x)->javaDecl(), def)) {
                    ((UmlExtraClassMember *) x)->set_JavaDecl(def);
                    cl->get_class()->set_updated();
                }

                ((UmlExtraClassMember *) x)->set_usefull();
                return;
            }
        }
    }

    UmlExtraClassMember * x =
        UmlExtraClassMember::create(cl, "initialization");

    x->set_JavaDecl(def);
    expected_order.append(x);
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:32,代码来源:UmlExtraClassMember.cpp

示例3: import

void UmlClass::import(QTextOStream & f, const QCString & indent) {
  QCString s;
  
  if (!isJavaExternal()) {
    UmlArtifact * cp = associatedArtifact();
    UmlPackage * pack = (UmlPackage *)
      ((cp != 0) ? (UmlItem *) cp : (UmlItem *) this)->package();
    
    if ((s = pack->javaPackage()).isEmpty())
      return;
    
    QCString s2 = name();
    UmlItem * p = this;
    
    while ((p = p->parent())->kind() == aClass)
      s2 = p->name() + dot + s2;
    
    s += dot + s2;
  }
  else if ((s = package()->javaPackage()).isEmpty())
    return;
  else
    s += dot + name();
  
  if (! UmlArtifact::generated_one()->is_imported(s)) {
    f << indent << "import " << s << ";\n";
    UmlArtifact::generated_one()->imported(s);
  }
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例4: it

UmlItem * UmlClass::search_for_att_rel(const WrapperStr & name)
{
    const QVector<UmlItem*> & ch = UmlItem::children();

    QVectorIterator<UmlItem*> it(ch);
    while(it.hasNext())
    {
        UmlItem* item = it.next();
        switch (item->kind()) {
        case anAttribute:
            if (item->name() == name)
                return item;

            break;

        case aRelation:
            if (((UmlRelation *) item)->roleName() == name)
                return item;

            break;

        default:
            break;
        }
    }

    return 0;
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:28,代码来源:UmlClass.cpp

示例5: update_class_list

void Package::update_class_list(WrapperStr pack, UmlItem * container)
{
    const Q3PtrVector<UmlItem> & ch = container->children();

    for (unsigned i = 0; i != ch.size(); i += 1) {
        UmlItem * it = ch[i];

        switch (it->kind()) {
        case aClass:
            user_classes.replace(pack + it->name(), (UmlClass *) it);
            update_class_list(pack + it->name() + ".", (UmlClass *) it);
            break;

        case aClassView:
            update_class_list(pack, it);

        default:
            break;
        }
    }
}
开发者ID:jeremysalwen,项目名称:douml,代码行数:21,代码来源:Package.cpp

示例6: write

void UmlClass::write(QTextOStream & f) {
  if (isJavaExternal()) {
    QCString s = javaDecl().stripWhiteSpace();
    int index;
      
    if ((index = s.find("${name}")) != -1)
      s.replace(index, 7, name());
    else if ((index = s.find("${Name}")) != -1)
      s.replace(index, 7, capitalize(name()));
    else if ((index = s.find("${NAME}")) != -1)
      s.replace(index, 7, name().upper());
    else if ((index = s.find("${nAME}")) != -1)
      s.replace(index, 7, name().lower());
    
    f << s;
  }
  else {
    UmlClass * toplevel = this;
    UmlItem * p;
    QCString s2;
    
    while ((p = toplevel->parent())->kind() == aClass) {
      toplevel = (UmlClass *) p;
      s2 = dot + p->name() + s2;
    }
    
    UmlArtifact * cp = toplevel->associatedArtifact();
    UmlPackage * pack = (UmlPackage *)
      ((cp != 0) ? (UmlItem *) cp : (UmlItem *) toplevel)->package();
    
    if (pack != UmlArtifact::generation_package()) {
      QCString s = pack->javaPackage();

      if (! s.isEmpty() && (s != "java.lang") && (s.left(10) != "java.lang.")) {
	s += s2;
	
	if (JavaSettings::isForcePackagePrefixGeneration() ||
	    !UmlArtifact::generated_one()->is_imported(s, name()))
	  f << s << '.';
      }
    }
    else if (! s2.isEmpty())
      f << s2.mid(1) << '.';
    
    f << name();
  }
}
开发者ID:,项目名称:,代码行数:47,代码来源:

示例7: solveManifestation

void UmlArtifact::solveManifestation(WrapperStr s, WrapperStr idref)
{
    QMap<WrapperStr, UmlItem *>::Iterator it = All.find(idref);

    if (it == All.end()) {
        if (!FileIn::isBypassedId(idref))
            UmlCom::trace("manifestation : unknown utilized element reference '" + idref + "'<br>");

        return;
    }

    UmlItem * target = *it;

    if (!FromBouml || (s != "dependency")) {
        switch (target->kind()) {
        case aClass:
            if (s != "source")
                break;
            else if (stereotype().isEmpty())
                set_Stereotype("source");
            else if (stereotype() != "source")
                break;

            addAssociatedClass((UmlClass *) target);
            return;

        case anArtifact:
            if (!FromBouml)
                break;

            addAssociatedArtifact((UmlArtifact *) target);
            return;

        default:
            break;
        }
    }

    UmlNcRelation * rel = UmlNcRelation::create(aDependency, this, target);

    if (rel == 0)
        UmlCom::trace("cannot create manifestation from '" + name() +
                      "' to '" + target->name() + "'");
    else
        rel->set_Stereotype("manifest");
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:46,代码来源:UmlArtifact.cpp

示例8: subArtifacts

void UmlPackage::subArtifacts(QList<UmlArtifact *> &l, QByteArray name, QByteArray deplview_name)
{
    UmlDeploymentView * deplview;

    foreach (deplview, _deplviews){
        if (deplview->baseName() == deplview_name) {
            const QVector<UmlItem*> ch = deplview->children();
            int i;

            for (i = 0; i != ch.size(); i += 1) {
                UmlItem * it = ch[i];

                if ((it->kind() == anArtifact) && (it->name() == name))
                    l.append((UmlArtifact *) it);
            }
        }
    }

}
开发者ID:DoUML,项目名称:douml,代码行数:19,代码来源:UmlPackage.cpp

示例9: solveGeneralizationDependencyRealization

void UmlItem::solveGeneralizationDependencyRealization(int context, WrapperStr idref, WrapperStr label, WrapperStr)
{
    QMap<QString, UmlItem *>::Iterator it = All.find(idref);

    if (it != All.end()) {
        static const struct {
            aRelationKind rk;
            const char * err;
        } r[] = {
            { aGeneralisation, "cannot create generalization from '" },
            { aDependency, "cannot create dependency from '" },
            { aRealization, "cannot create realization from '" },
            { aDependency, "cannot create usage from '" },
            { aDependency, "cannot create import from '" }
        };
        UmlItem * target = *it;
        UmlItem * rel = UmlNcRelation::create(r[context].rk, this, target);

        if (rel == 0)
            UmlCom::trace(r[context].err + name() + "' to '" + target->name() + "'<br>");
        else {
            if (! label.isEmpty())
                rel->set_Name(label);

            switch (context) {
            case 3:
                rel->set_Stereotype("use");
                break;

            case 4:
                rel->set_Stereotype("import");
                break;

            default:
                break;
            }
        }
    }
    else if (!FileIn::isBypassedId(idref))
        UmlCom::trace("relation : unknown target reference '" + idref + "'<br>");

}
开发者ID:daniel7solis,项目名称:douml,代码行数:42,代码来源:UmlItem.cpp

示例10: text

UmlPackage * Package::get_uml(bool mandatory)
{
    if (uml == 0) {
        const char * name = text(0);
        Package * pa = (Package *) parent();
        UmlPackage * uml_pa = pa->get_uml();	// will end on project

        Q3PtrVector<UmlItem> ch = uml_pa->children();

        for (unsigned index = 0; index != ch.size(); index += 1) {
            UmlItem * it = ch[index];

            if ((it->kind() == aPackage) && (it->name() == name))
                return uml = (UmlPackage *) it;
        }

        if ((uml = UmlBasePackage::create(uml_pa, name)) == 0) {
            if (!mandatory)
                return 0;

#ifdef REVERSE
            UmlCom::trace(WrapperStr("<font face=helvetica><b>cannot create package <i>")
                          + name + "</i> under package <i>" + uml_pa->name() +
                          "</b></font><br>");
            UmlCom::message("");
            throw 0;
#else
            QMessageBox::critical(0, "Fatal Error",
                                  QString("<font face=helvetica><b>cannot create package <i>")
                                  + name + "</i> under package <i>"
                                  + ((const char *) uml_pa->name()) + "</b></font><br>");
            QApplication::exit(1);
#endif
        }
    }

    return uml;
}
开发者ID:jeremysalwen,项目名称:douml,代码行数:38,代码来源:Package.cpp

示例11: already_in_bouml

Class::Class(Package * p, const char * n, char st)
    : BrowserNode(p, n),
      uml(0), stereotype(st), abstractp(FALSE), reversedp(FALSE),
#ifdef REVERSE
      from_lib(FALSE)
#else
      description_updatedp(FALSE)
#endif
{
    p->new_class(this);
}

UmlClass * Class::get_uml()
{
    if (uml != 0)
        return uml;

    UmlItem * p = // no nested classe in php
        (UmlItem *)((Package *) parent())->get_uml()->get_classview(get_namespace());
    WrapperStr str = WrapperStr(text(0).toLatin1().constData());

    uml = UmlBaseClass::create(p, str);

    if (uml == 0) {
        // probably already exist
        QVector<UmlItem*> ch = p->children();
        UmlItem * x;

        for (int chindex = 0; chindex != ch.size(); chindex += 1) {
            if (((x = ch[chindex])->kind() == aClass) && (x->name() == str)) {
                uml = (UmlClass *) x;
                break;
            }
        }

        if (uml == 0) {
#ifdef REVERSE
            UmlCom::message("");
            UmlCom::trace(QString(QString("<font face=helvetica><b>cannot create class <i>")
                          + text(0) + "</i> under <i>"
                          + parent()->text(0) + "</b></font><br>").toLatin1().constData());
            throw 0;
#else
            QMessageBox::critical(0, "Fatal Error",
                                  QString("<font face=helvetica><b>cannot create class <i>")
                                  + text(0) + "</i> under <i>"
                                  + parent()->text(0) + "</b></font><br>");
            QApplication::exit(1);
#endif
        }
    }

    switch (stereotype) {
    case 'i':
        uml->set_Stereotype("interface");
        uml->set_PhpDecl(PhpSettings::interfaceDecl());
        break;

    default:
        // class
        break;
    }

    if (abstractp)
        uml->set_isAbstract(TRUE);

    return uml;
}

bool Class::already_in_bouml()
{
    QVector<UmlItem*> ch = get_uml()->children();

    for (int index = 0; index != ch.size(); index += 1)
        if (ch[index]->kind() != aClass)
            return TRUE;

    return FALSE;
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:79,代码来源:Class.cpp


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