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


C++ FileOut::ref_only方法代码示例

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


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

示例1: write_ref

void UmlFragment::write_ref(FileOut & out, UmlItem * diagram, Q3PtrList< UmlSequenceMessage > & msgs)
{
    static int rank = 0;

    out.indent();
    out << "<fragment xmi:type=\"uml:InteractionUse\"";
    out.id_prefix(diagram, "INTERACTIONUSE", ++rank);

    const Q3PtrVector<UmlClassInstanceReference> & v = UmlBaseFragment::covered();
    unsigned n;
    unsigned index;

    n = v.count();

    if (n != 0) {
        out << " covered=\"";

        index = 0;

        for (;;) {
            out.ref_only(diagram, v.at(index)->lifeline());

            if (++index == n)
                break;

            out << " ";
        }

        out << '"';
    }

    UmlDiagram * d = refer();

    if (d != 0) {
        switch (d->kind()) {
        case aSequenceDiagram:
        case aCollaborationDiagram:
            out.ref(d, "refersTo", "INTERACTION_");

            if (arguments().isEmpty())
                out << "/>\n";
            else {
                static int rank = 0;

                out << ">\n";
                out.indent();
                out << "\t<argument xmi:type=\"uml:OpaqueExpression\"";
                out.id_prefix(d, "INTER_ARG_EXPR_", ++rank);
                out << ">\n";
                out.indent();
                out << "\t\t<body>";
                out.quote(arguments());
                out << "</body>\n";
                out.indent();
                out << "\t</argument>\n";
                out.indent();
                out << "</fragment>\n";
            }

            break;

        default:
            out << "/>\n";
            break;
        }
    }
    else
        out << "/>\n";

    // remove internal messages and compartment

    const Q3PtrVector<UmlFragmentCompartment> & subs = compartments();

    n = subs.size();

    for (index = 0; index != n; index += 1)
        subs.at(index)->bypass(msgs);
}
开发者ID:02JanDal,项目名称:douml,代码行数:78,代码来源:UmlFragment.cpp

示例2: write

void UmlFragment::write(FileOut & out, UmlItem * diagram, Q3PtrList<UmlSequenceMessage> & msgs)
{
    WrapperStr oper = name();

    if (oper == "ref")
        write_ref(out, diagram, msgs);
    else {
        if ((oper != "alt") &&
            (oper != "opt") &&
            (oper != "loop") &&
            (oper != "break") &&
            (oper != "par") &&
            (oper != "seq") &&
            (oper != "strict") &&
            (oper != "neg") &&
            (oper != "critical") &&
            (oper != "assert") &&
            (oper != "ignore") &&
            (oper != "consider"))
            oper = "";
        else {
            static int rank = 0;

            out.indent();
            out << "<fragment xmi:type=\"uml:CombinedFragment\"";
            out.id_prefix(diagram, "COMBINEDFRAGMENT", ++rank);

            if (! covered.isEmpty()) {
                out << " covered=\"";

                UmlClassInstanceReference * lifeline = covered.first();

                for (;;) {
                    out.ref_only(diagram, lifeline->lifeline());
                    lifeline = covered.next();

                    if (lifeline == 0)
                        break;

                    out << " ";
                }

                out << '"';
            }

            out << " interactionOperator=\"" << oper.operator QString() << "\">\n";
            out.indent(+1);
        }

        const Q3PtrVector<UmlFragmentCompartment> & subs = compartments();
        unsigned n = subs.size();

        for (unsigned i = 0; i != n; i += 1)
            subs.at(i)->write(out, diagram, msgs, oper);

        if (!oper.isEmpty()) {
            out.indent(-1);
            out.indent();
            out << "</fragment>\n";
        }
    }
}
开发者ID:02JanDal,项目名称:douml,代码行数:62,代码来源:UmlFragment.cpp


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