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


C++ Q3PtrVector::size方法代码示例

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


在下文中一共展示了Q3PtrVector::size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: solve_output_flows

void UmlJoinActivityNode::solve_output_flows() {
  // output is data if at least one input is data
  ControlOrData k = Unset;
  const Q3PtrVector<UmlItem> ch = children();
  unsigned n = ch.size(); // theo 1

  if (n == 0)
    return;

  UmlFlow * f = (UmlFlow *) ch[0];

  // look at input flows
  Q3PtrListIterator<UmlFlow> it(_incoming_flows);

  while (it.current() != 0) {
    k = it.current()->control_or_data();

    if (k == Unset) {
      ((UmlActivityNode *) it.current()->parent())->solve_output_flows();
      k = it.current()->control_or_data();
    }

    if (k == IsData)
      break;

    ++it;
  }

  f->set_control_or_data((k == IsData) ? IsData : IsControl);
}
开发者ID:SciBoy,项目名称:douml,代码行数:30,代码来源:UmlActivityControlNodeClasses.cpp

示例3: write_if_needed

bool UmlComponent::write_if_needed(FileOut & out)
{
    parent()->write(out);

    out.indent();
    out << "<UML:Component name=\"";
    out.quote(name());
    out << '"';
    out.id(this);
    out << " visibility=\"public\" isAbstract=\"false\" isActive=\"false\" >\n";
    out.indent(+1);
    write_stereotype(out);
    write_description_properties(out);
    out.indent(-1);
    out.indent();
    out << "</UML:Component>\n";

    const Q3PtrVector<UmlItem> ch = children();
    unsigned n = ch.size();

    for (unsigned i = 0; i != n; i += 1)
        ch[i]->write_if_needed(out);

    unload();

    return TRUE;
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:27,代码来源:UmlComponent.cpp

示例4: write

void UmlPseudoState::write(FileOut & out) {
  out.indent();
  out << "<subvertex xmi:type=\"uml:Pseudostate\"";
  out.id(this);
  if (! name().isEmpty()) {
    out << " name=\"";
    out.quote((const char*)name());//[jasa] ambiguous call
    out << '"';
  }
  out << " kind=\"" << sKind() << "\">\n";

  out.indent(+1);
  
  write_description_properties(out); 
     
  while (! _incoming_trans.isEmpty())
    _incoming_trans.take(0)->write_in(out);
  
  const Q3PtrVector<UmlItem> ch = children(); 
  unsigned n = ch.size();
  unsigned i;
     
  for (i = 0; i != n; i += 1)
    ch[i]->write(out);

  out.indent(-1);
  out.indent();
  out << "</subvertex>\n";
    
  unload(); 
}
开发者ID:SciBoy,项目名称:douml,代码行数:31,代码来源:UmlPseudoState.cpp

示例5: write

void UmlActivityPartition::write(FileOut & out) {
  const char * p = (parent()->kind() == aPartition)
    ? "subpartition" : "group";
  
  out.indent();
  out << "<" << p << " xmi:type=\"uml:ActivityPartition\" name=\"";
  out.quote((const char*)name());//[jasa] ambiguous call
  out << '"';
  out.id(this);
  if (isDimension())
    out << " isDimension=\"true\"";
  if (isExternal())
    out << " isExternal=\"true\"";
  if (represents() != 0)
    out.ref(represents(), "represents");
  out << ">\n";
  out.indent(+1);
  
  write_description_properties(out); 
  
  const Q3PtrVector<UmlItem> ch = children();
  unsigned n = ch.size();
  
  for (unsigned i = 0; i != n; i += 1)
    ch[i]->write(out);
  
  out.indent(-1);
  out.indent();
  out << "</" << p << ">\n";

  unload();
}
开发者ID:SciBoy,项目名称:douml,代码行数:32,代码来源:UmlActivityPartition.cpp

示例6: readParameterNode

void UmlActivity::readParameterNode(FileIn & in, Token & token)
{
    // the parameter node may already exist because of a
    // ActivityParameter definition, search for it
    UmlActivityParameter * param = 0;
    WrapperStr s = token.valueOf("name");
    const Q3PtrVector<UmlItem> ch = children();
    unsigned int n = ch.size();
    int i;

    for (i = 0; i != (int) n; i += 1) {
        UmlActivityParameter * p = dynamic_cast<UmlActivityParameter *>(ch[i]);

        if ((p != 0) && (p->name() == s)) {
            param = p;
            break;
        }
    }

    if (param == 0) {
        param = UmlActivityParameter::create(this, s);

        if (param == 0)
            in.error("cannot create activity parameter node '"
                     + s + "' in '" + name() + "'");

        param->addItem(token.xmiId(), in);
    }

    param->readParameterNode(in, token);

}
开发者ID:bleakxanadu,项目名称:douml,代码行数:32,代码来源:UmlActivity.cpp

示例7: roundtrip_python

void UmlPackage::roundtrip_python()
{
    Q3PtrVector<UmlItem> ch = UmlItem::children();

    for (unsigned index = 0; index != ch.size(); index += 1)
        ch[index]->roundtrip_python();
}
开发者ID:harmegnies,项目名称:douml,代码行数:7,代码来源:UmlPackage.cpp

示例8: children

void UmlItem::rename_jdk5()
{
    const Q3PtrVector<UmlItem> ch = children();

    for (unsigned i = 0; i != ch.size(); i += 1)
        ch[i]->rename_jdk5();
}
开发者ID:gilbertoca,项目名称:douml,代码行数:7,代码来源:UmlItem.cpp

示例9: mark_useless

void UmlPackage::mark_useless(Q3PtrList<UmlItem> & l) {
  Q3PtrVector<UmlItem> ch = UmlItem::children();
  UmlClassItem ** v = (UmlClassItem **) ch.data();
  UmlClassItem ** const vsup = v + ch.size();
    
  for (;v != vsup; v += 1)
    (*v)->mark_useless(l);
}
开发者ID:SciBoy,项目名称:douml,代码行数:8,代码来源:UmlPackage.cpp

示例10: generate_import

void UmlClass::generate_import(QTextOStream & f, const Q3CString & indent) {
  Q3PtrVector<UmlItem> ch = children();
  const unsigned sup = ch.size();
  unsigned index;
  
  for (index = 0; index != sup; index += 1)
    ch[index]->generate_import(f, indent);
}
开发者ID:SciBoy,项目名称:douml,代码行数:8,代码来源:UmlClass.cpp

示例11: search_class_assoc

void UmlClass::search_class_assoc()
{
    const Q3PtrVector<UmlItem> ch = children();
    unsigned n = ch.size();

    for (unsigned i = 0; i != n; i += 1)
        ch[i]->search_class_assoc();
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:8,代码来源:UmlClass.cpp

示例12: write

void UmlItem::write(FileOut & out) {
  const Q3PtrVector<UmlItem> ch = children();
  unsigned n = ch.size();
  
  for (unsigned i = 0; i != n; i += 1)
    ch[i]->write(out);

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

示例13: write

void UmlArtifact::write(FileOut & out)
{
    const char * k = (_uml_20) ? "ownedMember" : "packagedElement";

    out.indent();
    out << "<" << k << " xmi:type=\"uml:Artifact\"";
    out.id(this);
    out << " name=\"";
    out.quote((const char *)name()); //[jasa] ambiguous call
    out << "\">\n";
    out.indent(+1);

    write_description_properties(out);

    const Q3PtrVector<UmlItem> ch = children();
    unsigned i;
    unsigned n = ch.size();
    unsigned rank = 0;

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

        if ((x->kind() == aNcRelation) &&
            (x->stereotype() == "manifest") &&
            (((UmlNcRelation *) x)->relationKind() == aDependency))
            write_manifest(out, ((UmlNcRelation *) x)->target(), "dependency", ++rank);
        else
            ch[i]->write(out);
    }

    if (stereotype() == "source") {
        const Q3PtrVector<UmlClass> & cls = associatedClasses();

        n = cls.size();

        for (i = 0; i != n; i += 1)
            write_manifest(out, cls[i], "source", ++rank);
    }
    else {
        const Q3PtrVector<UmlArtifact> & arts = associatedArtifacts();

        n = arts.size();

        for (i = 0; i != n; i += 1)
            write_manifest(out, arts[i], 0, ++rank);
    }

    out.indent(-1);
    out.indent();
    out << "</" << k << ">\n";

    unload();

}
开发者ID:02JanDal,项目名称:douml,代码行数:54,代码来源:UmlArtifact.cpp

示例14: write_end

void UmlActivityAction::write_end(FileOut & out, bool dontclose) {
  out << ">\n";
  out.indent(+1);
  
  Q3CString s = constraint();
  
  if (! s.isEmpty()) {
    out.indent();
    out << "<ownedRule xmi:type=\"uml:Constraint\"";
    out.id_prefix(this, "CONSTRAINT_");
    out.ref(this, "constrainedElement");
    out << ">\n";
    out.indent();
    out << "\t<specification xmi:type=\"uml:OpaqueExpression\"";
    out.id_prefix(this, "CSPEC_");
    out << ">\n";
    out.indent();
    out << "\t\t<body>";
    out.quote(s);
    out << "</body>\n";
    out.indent();
    out << "\t</specification>\n";
    out.indent();
    out << "</ownedRule>\n";
  }
  
  write_description_properties(out);

  switch (_lang) {
  case Uml:
    write_condition(out, preCondition(), TRUE);
    write_condition(out, postCondition(), FALSE);
    break;
  case Cpp:
    write_condition(out, cppPreCondition(), TRUE);
    write_condition(out, cppPostCondition(), FALSE);
    break;
  default:
    // java
    write_condition(out, javaPreCondition(), TRUE);
    write_condition(out, javaPostCondition(), FALSE);
  }

  const Q3PtrVector<UmlItem> ch = children();
  unsigned n = ch.size();
  
  for (unsigned i = 0; i != n; i += 1)
    ch[i]->write(out);

  write_incoming_flows(out);
  
  if (!dontclose)
    write_close(out);
}
开发者ID:SciBoy,项目名称:douml,代码行数:54,代码来源:UmlActivityAction.cpp

示例15: write_if_needed

bool UmlItem::write_if_needed(FileOut & out)
{
    const Q3PtrVector<UmlItem> ch = children();
    unsigned n = ch.size();
    bool used = FALSE;

    for (unsigned i = 0; i != n; i += 1)
        used |= ch[i]->write_if_needed(out);

    return used;
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:11,代码来源:UmlItem.cpp


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