本文整理汇总了C++中FileOut::ref方法的典型用法代码示例。如果您正苦于以下问题:C++ FileOut::ref方法的具体用法?C++ FileOut::ref怎么用?C++ FileOut::ref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileOut
的用法示例。
在下文中一共展示了FileOut::ref方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_extension
void UmlRelation::write_extension(FileOut & out) {
if ((side(TRUE) == this) &&
(parent()->stereotype() == "stereotype") &&
(roleType()->stereotype() == "metaclass")) {
const char * k = (_uml_20) ? "ownedMember" : "packagedElement";
out.indent();
out << "<" << k << " xmi:type=\"uml:Extension\" name=\"A_";
out.quote((const char*)roleType()->name());//[jasa] ambiguous call
out << '_';
out.quote((const char*)parent()->name());//[jasa] ambiguous call
out << '"';
out.id_prefix(this, "EXT_");
out.ref(this, "memberEnd", "BASE_");
out << ">\n";
out.indent();
out << "\t<ownedEnd xmi:type=\"uml:ExtensionEnd\" name=\"extension_";
out.quote((const char*)parent()->name());//[jasa] ambiguous call
out << '"';
out.id_prefix(this, "EXTEND_");
out.ref(this, "type");
out << " aggregation=\"composite\"/>\n";
out.indent();
out << "</" << k << ">\n";
}
unload();
}
示例2: write_events
void UmlOperation::write_events(FileOut & out)
{
const char * k = (_uml_20) ? "ownedMember" : "packagedElement";
UmlItem * prj = UmlPackage::getProject();
Q3PtrDictIterator<char> it_oper(SentReceived);
while (it_oper.current()) {
out.indent();
out << "<" << k << " xmi:type=\"uml:SendOperationEvent\"";
out.id_prefix(prj, "SENDOPEREVT", (int)((long) it_oper.current()));
out << " name=\"";
out.quote((const char *)((UmlOperation *)it_oper.currentKey())->name()); //[jasa] ambiguous call
out << '"';
out.ref((UmlOperation *)it_oper.currentKey(), "operation");
out << "/>\n";
out.indent();
out << "<" << k << " xmi:type=\"uml:ReceiveOperationEvent\"";
out.id_prefix(prj, "RECOPEREVT", (int)((long) it_oper.current()));
out << " name=\"";
out.quote((const char *)((UmlOperation *)it_oper.currentKey())->name()); //[jasa] ambiguous call
out << '"';
out.ref((UmlOperation *)it_oper.currentKey(), "operation");
out << "/>\n";
++it_oper;
}
Q3AsciiDictIterator<char> it_evt(Events);
while (it_evt.current()) {
out.indent();
if (it_evt.currentKey()[0] == 'D') {
out << "<" << k << " xmi:type=\"uml:DestructionEvent\"";
out.id_prefix(prj, it_evt.current());
out << "/>\n";
}
else {
out << "<" << k << " xmi:type=\"uml:ExecutionEvent\"";
out.id_prefix(prj, it_evt.current());
if (*it_evt.currentKey() != 0) {
out << " name=\"";
out.quote(it_evt.currentKey() + 1);
out << "\"/>\n";
}
else
out << "/>\n";
}
free(it_evt.current());
++it_evt;
}
}
示例3: write_ends
void UmlRelation::write_ends(FileOut & out) {
// note : it is the first side
out.indent();
out << "\t<memberEnd";
out.idref(this);
out << "/>\n";
UmlRelation * other = side(FALSE);
out.indent();
if (other != 0) {
out << "\t<memberEnd";
out.idref(other);
out << "/>\n";
}
else {
out << "\t<ownedEnd xmi:type=\"uml:Property\"";
out.id_prefix(this, "REVERSE_");
if (_assoc_class != 0)
out.ref(_assoc_class, "association");
else
out.ref(this, "association", "ASSOC_");
out << " visibility=\"" << ((_vis_prefix) ? "vis_private\"" : "private\"");
out.ref(parent(), "type");
out << " aggregation=\"";
if (_gen_eclipse)
out << "none";
else {
switch (relationKind()) {
case anAggregation:
case aDirectionalAggregation:
out << "shared";
break;
case anAggregationByValue:
case aDirectionalAggregationByValue:
out << "composite";
break;
default:
out << "none";
}
}
out << "\" isNavigable=\"false\"/>\n";
out.indent();
out << "\t<memberEnd ";
out.idref_prefix(this, "REVERSE_");
out << "/>\n";
}
}
示例4: write_manifest
void UmlArtifact::write_manifest(FileOut & out, UmlItem * x, const char * name, unsigned rank)
{
out.indent();
out << "<manifestation xmi:type=\"uml:Manifestation\"";
out.id_prefix(this, "MANIFESTATION", rank);
out.ref(this, "client");
out.ref(x, "supplier");
out.ref(x, "utilizedElement");
if (name != 0)
out << " name=\"" << name << '"';
out << "/>\n";
}
示例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();
}
示例6: write
void UmlAcceptEventAction::write(FileOut & out) {
write_begin(out, "AcceptEventAction");
if (isUnmarshall())
out << " isUnmarshall=\"true\"";
Q3CString trig;
switch (_lang) {
case Uml:
trig = trigger();
break;
case Cpp:
trig = cppTrigger();
break;
default:
// java
trig = javaTrigger();
}
if (! trig.isEmpty()) {
out.ref(this, "trigger", "TRIGGER_");
write_end(out);
out.indent();
out << "<trigger xmi:type=\"uml:Trigger\"";
out.id_prefix(this, "TRIGGER_");
out << " name=\"";
out.quote(trig);
out << "\"/>\n";
}
else
write_end(out);
}
示例7: write
void UmlNcRelation::write(FileOut & out)
{
if ((relationKind() == aDependency) &&
(parent()->kind() == anUseCase) &&
(target()->kind() == anUseCase)) {
const char * t;
const char * r;
if (stereotype() == "include") {
t = "Include";
r = "addition";
}
else if (stereotype() == "extend") {
t = "Extend";
r = "extendedCase";
}
else {
write(out, TRUE);
return;
}
out.indent();
out << "<" << stereotype() << " xmi:type=\"uml:" << t << "\"";
out.id(this);
out.ref(target(), r);
out << ">\n";
out.indent(+1);
write_description_properties(out);
out.indent(-1);
out.indent();
out << "</" << stereotype() << ">\n";
}
else
write(out, TRUE);
}
示例8: write_dependency
void UmlRelation::write_dependency(FileOut & out) {
const char * k = (_uml_20) ? "ownedElement" : "packagedElement";
out.indent();
out << '<' << k << " xmi:type=\"uml:Dependency\"";
out.id(this);
out.ref(parent(), "client");
out.ref(roleType(), "supplier");
out << ">\n";
out.indent(+1);
write_constraint(out);
write_description_properties(out);
out.indent(-1);
out.indent();
out << "</" << k << ">\n";
}
示例9: write
void UmlFormalParameter::write(FileOut & out, UmlClass * cl, int rank, bool uml20) const {
out.indent();
out << "<parameter";
out.idref_prefix(cl, "TEMPLPARAM", rank);
out << "/>\n";
out.indent();
out << "<ownedParameter xmi:type=\"uml:ClassifierTemplateParameter\"";
out.id_prefix(cl, "TEMPLPARAM", rank);
out << ">\n";
out.indent(+1);
out.indent();
if (uml20)
out << "<ownedElement xmi:type=\"uml:Class\"";
else
out << "<ownedParameteredElement xmi:type=\"uml:Class\"";
out.id_prefix(cl, "TEMPLELEM", rank);
out << " name=\"";
out.quote(name());
out << '"';
out.ref(cl, "templateParameter", "TEMPLPARAM", rank);
out << "/>\n";
if (defaultValue().type != 0)
UmlItem::write_default_value(out, defaultValue().type->name(), cl, rank);
else
UmlItem::write_default_value(out, defaultValue().explicit_type, cl, rank);
out.indent(-1);
out.indent();
out << "</ownedParameter>\n";
}
示例10: write_generalization
void UmlNcRelation::write_generalization(FileOut & out)
{
out.indent();
out << "<generalization xmi:type=\"uml:Generalization\"";
out.id(this);
out.ref(target(), "general");
out << "/>\n";
}
示例11: write_dependency
void UmlNcRelation::write_dependency(FileOut & out)
{
const char * k = (_uml_20) ? "ownedElement" : "packagedElement";
out.indent();
out << '<' << k <<
(((parent()->kind() == anArtifact) && (stereotype() == "manifest"))
? " xmi:type=\"uml:Manifestation\"" : " xmi:type=\"uml:Dependency\"");
out.id(this);
out.ref(parent(), "client");
out.ref(target(), "supplier");
out << ">\n";
out.indent(+1);
write_description_properties(out);
out.indent(-1);
out.indent();
out << "</" << k << ">\n";
}
示例12: write_stereotyped
void UmlItem::write_stereotyped(FileOut & out)
{
QMap<QString, Q3PtrList<UmlItem> >::Iterator it;
for (it = _stereotypes.begin(); it != _stereotypes.end(); ++it) {
const char * st = it.key();
UmlClass * cl = UmlClass::findStereotype(it.key(), TRUE);
if (cl != 0) {
Q3ValueList<WrapperStr> extended;
cl->get_extended(extended);
Q3PtrList<UmlItem> & l = it.data();
UmlItem * elt;
for (elt = l.first(); elt != 0; elt = l.next()) {
out << "\t<" << st;
out.id_prefix(elt, "STELT_");
const Q3Dict<WrapperStr> props = elt->properties();
Q3DictIterator<WrapperStr> itp(props);
while (itp.current()) {
QString k = itp.currentKey();
if (k.contains(':') == 2) {
out << " ";
out.quote((const char *)k.mid(k.findRev(':') + 1)); //[jasa] ambiguous call
out << "=\"";
out.quote((const char *)*itp.current());
out << '"';
}
++itp;
}
Q3ValueList<WrapperStr>::Iterator iter_extended;
for (iter_extended = extended.begin();
iter_extended != extended.end();
++iter_extended) {
WrapperStr vr = "base_" + *iter_extended;
out.ref(elt, vr);
}
out << "/>\n";
elt->unload();
}
}
}
}
示例13: 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);
}
示例14: write_generalization
void UmlRelation::write_generalization(FileOut & out) {
out.indent();
out << "<generalization xmi:type=\"uml:Generalization\"";
out.id(this);
out.ref(roleType(), "general");
if (!constraint().isEmpty()) {
out << ">\n";
out.indent(+1);
write_constraint(out);
out.indent(-1);
out.indent();
out << "</generalization>\n";
}
else
out << "/>\n";
}
示例15: write_fragment
void UmlSequenceMessage::write_fragment(FileOut & out, UmlItem * diagram, QList< UmlSequenceMessage* > & msgs)
{
msgs.removeOne(this);
#define MSG "MSG", itsrank
#define SEND "MSGOCCSPECSEND", itsrank
#define REF_SEND "MSGOCCSPECSEND", reverse->itsrank
#define REC "MSGOCCSPECREC", itsrank
#define BEH "BEHEXECSPEC", itsrank
#define REF_BEH "BEHEXECSPEC", reverse->itsrank
#define EXEC "EXECOCCSPEC", itsrank
#define REF_EXEC "EXECOCCSPEC", reverse->itsrank
#define DEL "DELOCCSPEC", itsrank
UmlPackage * prj = UmlPackage::getProject();
switch (kind()) {
case aSynchronousCall:
case anAsynchronousCall:
used = TRUE;
if (from() != 0) {
out.indent();
out << "<fragment xmi:type=\"uml:MessageOccurrenceSpecification\"";
out.id_prefix(diagram, SEND);
out.ref(diagram, "covered", from()->lifeline());
out.ref(prj, "event",
(operation() != 0) ? operation()->event(FALSE)
: UmlOperation::event("SEND", form()));
out.ref(diagram, "message", MSG);
out << "/>\n";
}
if (to() != 0) {
out.indent();
out << "<fragment xmi:type=\"uml:MessageOccurrenceSpecification\"";
out.id_prefix(diagram, REC);
out.ref(diagram, "covered", to()->lifeline());
out.ref(prj, "event",
(operation() != 0) ? operation()->event(TRUE)
: UmlOperation::event("REC", form()));
out.ref(diagram, "message", MSG);
out << "/>\n";
out.indent();
out << "<fragment xmi:type=\"uml:BehaviorExecutionSpecification\"";
out.id_prefix(diagram, BEH);
out.ref(diagram, "covered", to()->lifeline());
out.ref(diagram, "start", REC);
if (reverse != 0) {
if (reverse->kind() == anExplicitReturn)
out.ref(diagram, "finish", REF_SEND);
else
out.ref(diagram, "finish", REF_EXEC);
}
out << "/>\n";
}
break;
case anExplicitReturn:
used = TRUE;
out.indent();
out << "<fragment xmi:type=\"uml:MessageOccurrenceSpecification\"";
out.id_prefix(diagram, SEND);
out.ref(diagram, "covered", from()->lifeline());
out.ref(prj, "event", UmlOperation::event("SEND", form()));
out.ref(diagram, "message", MSG);
out << "/>\n";
out.indent();
out << "<fragment xmi:type=\"uml:MessageOccurrenceSpecification\"";
out.id_prefix(diagram, REC);
out.ref(diagram, "covered", to()->lifeline());
out.ref(prj, "event", UmlOperation::event("REC", form()));
out.ref(diagram, "message", MSG);
out << "/>\n";
break;
case aDestruction:
out.indent();
out << "<fragment xmi:type=\"uml:OccurrenceSpecification\"";
out.id_prefix(diagram, DEL);
out.ref(diagram, "covered", from()->lifeline());
out.ref(prj, "event", UmlOperation::event("DEL", ""));
out << "/>\n";
break;
case anInteractionUse:
break;
default:
if (reverse != 0) {
out.indent();
out << "<fragment xmi:type=\"uml:ExecutionOccurrenceSpecification\"";
out.id_prefix(diagram, EXEC);
out.ref(diagram, "covered", from()->lifeline());
//.........这里部分代码省略.........