本文整理汇总了C++中FileOut::id_prefix方法的典型用法代码示例。如果您正苦于以下问题:C++ FileOut::id_prefix方法的具体用法?C++ FileOut::id_prefix怎么用?C++ FileOut::id_prefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileOut
的用法示例。
在下文中一共展示了FileOut::id_prefix方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_condition
void UmlActivityAction::write_condition(FileOut & out, Q3CString cond, bool pre) {
if (! cond.isEmpty()) {
const char * k;
const char * K;
const char * body;
if (pre) {
k = "pre";
K = "PRE_";
body = "PRE_BODY_";
}
else {
k = "post";
K = "POST_";
body = "POST_BODY_";
}
out.indent();
out << '<' << k << "condition xmi:type=\"uml:Constraint\"";
out.id_prefix(this, K);
out << ">\n";
out.indent();
out << "\t<specification xmi:type=\"uml:OpaqueExpression\"";
out.id_prefix(this, body);
out << " body=\"";
out.quote(cond);
out << "\"/>\n";
out.indent();
out << "</" << k << "condition>\n";
}
}
示例2: 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";
}
示例3: 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();
}
示例4: write_multiplicity
void UmlItem::write_multiplicity(FileOut & out, WrapperStr s, UmlItem * who)
{
if (!s.isEmpty()) {
WrapperStr min;
WrapperStr max;
int index = s.find("..");
if (index != -1) {
min = s.left(index).stripWhiteSpace();
max = s.mid(index + 2).stripWhiteSpace();
}
else
min = max = s.stripWhiteSpace();
out.indent();
out << "<lowerValue xmi:type=\"uml:LiteralString\"";
out.id_prefix(who, "MULTIPLICITY_L_");
out << " value=\"" << min.operator QString() << "\"/>\n";
out.indent();
out << "<upperValue xmi:type=\"uml:LiteralString\"";
out.id_prefix(who, "MULTIPLICITY_U_");
out << " value=\"" << max.operator QString() << "\"/>\n";
}
}
示例5: 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;
}
}
示例6: 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);
}
示例7: 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);
}
示例8: write_relation
void UmlRelation::write_relation(FileOut & out) {
// note : it is the first side
if (_assoc_class != 0)
// generated in the association class
return;
const char * k = (_uml_20) ? "ownedElement" : "packagedElement";
out.indent();
out << '<' << k << " xmi:type=\"uml:Association\"";
out.id_prefix(this, "ASSOC_");
Q3CString s = name();
int i1 = s.find("(");
int i2 = s.findRev(")");
if ((i1 != -1) && (i2 != -1) && (i2 > i1) && (s[i1+1] != '<') && (s[i2-1] != '>')) {
s = s.mid(i1 + 1, i2 - i1 - 1);
if (!s.isEmpty()) {
out << " name=\"";
out.quote((const char*)s);//[jasa] ambiguous call
out << '"';
}
}
write_visibility(out);
out << ">\n";
write_ends(out);
out.indent();
out << "</" << k << ">\n";
}
示例9: 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();
}
}
}
}
示例10: write_default_value
void UmlItem::write_default_value(FileOut & out, Q3CString v, UmlItem * who, int rank)
{
if (! v.isEmpty()) {
if (v[0] == '=') {
v = v.mid(1);
if (v.isEmpty())
return;
}
out.indent();
out << "<defaultValue xmi:type=\"uml:LiteralString\"";
if (rank == -1)
out.id_prefix(who, "VALUE_");
else
out.id_prefix(who, "VALUE", rank);
out << " value=\"";
out.quote((const char*)v);//[jasa] ambiguous call
out << "\"/>\n";
}
}
示例11: write
void UmlActivityParameter::write(FileOut & out) {
// write parameter def
out.indent();
out << "<ownedParameter name=\"";
out.quote(name());
out << '"';
out.id(this);
write_dir(out);
write_effect(out);
write_flags(out);
out << ">\n";
out.indent(+1);
write_description_properties(out);
write_multiplicity(out, multiplicity(), this);
write_default_value(out, defaultValue(), this);
UmlItem::write_type(out, type());
out.indent(-1);
out.indent();
out << "</ownedParameter>\n";
//write parameter node
out.indent();
out << "<node xmi:type=\"uml:ActivityParameterNode\" name =\"";
out.quote(name());
out << '"';
out.id_prefix(this, "PARAMETER_NODE_");
if (isControlType())
out << " isControlType=\"true\"";
write_ordering(out);
write_selection(out);
write_in_state(out);
out << ">\n";
out.indent(+1);
UmlItem::write_type(out, type());
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 << "</node>\n";
unload();
}
示例12: 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";
}
}
示例13: 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";
}
示例14: write_actuals
void UmlClass::write_actuals(FileOut & out)
{
Q3ValueList<UmlActualParameter> actual_params = actuals();
Q3ValueList<UmlActualParameter>::ConstIterator iter;
int rank;
UmlClass * super = 0;
for (iter = actual_params.begin(), rank = 0;
iter != actual_params.end();
++iter, rank += 1) {
if (super != (*iter).superClass()) {
if (super != 0) {
out.indent(-1);
out.indent();
out << "</templateBinding>\n";
}
super = (*iter).superClass();
out.indent();
out << "<templateBinding xmi:type=\"uml:TemplateBinding\"";
out.id_prefix(this, "ACTUAL", rank);
out << ">\n";
out.indent(+1);
out.indent();
out << "<boundElement";
out.idref(this);
out << " />\n";
out.indent();
out << "<signature";
out.idref_prefix(super, "FORMALS_");
out << " />\n";
}
(*iter).write(out, this, rank);
}
if (super != 0) {
out.indent(-1);
out.indent();
out << "</templateBinding>\n";
}
}
示例15: write_signal
void UmlOnSignalAction::write_signal(FileOut & out) {
Q3CString sig;
switch (_lang) {
case Uml:
sig = signal();
break;
case Cpp:
sig = cppSignal();
break;
default:
// java
sig = javaSignal();
}
if (! sig.isEmpty()) {
out.indent();
out << "<signal xmi:type=\"uml:Signal\"";
out.id_prefix(this, "SIGNAL_");
out << " name=\"";
out.quote(sig);
out << "\"/>\n";
}
}