本文整理汇总了C++中UmlRelation::set_Description方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlRelation::set_Description方法的具体用法?C++ UmlRelation::set_Description怎么用?C++ UmlRelation::set_Description使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlRelation
的用法示例。
在下文中一共展示了UmlRelation::set_Description方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importInstantiate
void UmlClass::importInstantiate(File & f) {
if (scanning) {
f.skipNextForm();
return;
}
f.read("(");
f.read("object");
f.read("Instantiation_Relationship");
Q3CString id;
Q3CString ste;
Q3CString doc;
Q3Dict<Q3CString> prop;
Q3CString s2;
int k;
do {
k = f.readDefinitionBeginning(s2, id, ste, doc, prop);
} while (id.isEmpty());
for (;;) {
if (k == ATOM) {
if (s2 == "quidu")
break;
f.skipNextForm();
k = f.read(s2);
}
else
f.syntaxError(s2);
}
if (f.read(s2) != STRING)
f.syntaxError(s2, "quidu value");
UmlClass * target = (UmlClass *) findItem(s2, aClass);
if (target != 0) {
UmlRelation * r = UmlRelation::create(aRealization, this, target);
if (r == 0)
UmlCom::trace("<br>cannot create aRealization from '" +
fullName() + "' to '" + target->fullName() + "'");
else {
newItem(r, id);
if (!ste.isEmpty())
r->set_Stereotype(ste);
if (!doc.isEmpty())
r->set_Description(doc);
r->setProperties(prop);
}
}
f.skipBlock();
}
示例2: new_one
// not from a form 'generic<...C...> var' where C is a class
bool UmlRelation::new_one(Class * container, const WrapperStr & name,
UmlTypeSpec & dest, WrapperStr str_actuals,
aVisibility visibility, bool staticp,
bool constp, bool transientp, bool volatilep,
const WrapperStr & array, const WrapperStr & value,
WrapperStr comment, WrapperStr description,
WrapperStr annotation
#ifdef ROUNDTRIP
, bool roundtrip, QList<UmlItem *> & expected_order
#endif
)
{
#ifdef TRACE
QLOG_INFO() << "RELATION '" << name << "' from '" << cl->Name() << "' to '" << dest.type->Name()
<< "' array '" << array << "'\n";
#endif
if (
#ifdef REVERSE
container->from_libp() &&
#endif
(visibility == PrivateVisibility)) {
Lex::finish_line();
Lex::clear_comments();
return TRUE;
}
UmlClass * cl = container->get_uml();
UmlRelation * rel;
#ifdef ROUNDTRIP
bool created;
if (!roundtrip ||
((rel = search_rel(container, name, dest.type, "")) == 0)) {
#endif
rel = UmlBaseRelation::create(aDirectionalAssociation, cl, dest.type);
if (rel == 0) {
JavaCatWindow::trace(WrapperStr("<font face=helvetica><b>cannot add relation <i>")
+ name + "</i> in <i>" + cl->name() + "</i> to <i>"
+ dest.type->name() + "</i></b></font><br>");
return FALSE;
}
#ifdef REVERSE
# ifndef ROUNDTRIP
Statistic::one_relation_more();
# else
if (roundtrip)
container->set_updated();
created = TRUE;
}
else
created = FALSE;
# endif
#endif
WrapperStr decl = JavaSettings::relationDecl(array);
UmlClass::manage_generic(decl, dest, str_actuals, "${type}");
Lex::finish_line();
comment = Lex::get_comments(comment);
description = Lex::get_description(description);
#ifdef ROUNDTRIP
if (roundtrip && !created) {
if (rel->visibility() != visibility) {
rel->set_Visibility(visibility);
container->set_updated();
}
if (decl.find("${description}") != -1) {
if (nequal(rel->description(), description)) {
rel->set_Description(description);
container->set_updated();
}
}
else if (nequal(rel->description(), Lex::simplify_comment(comment))) {
rel->set_Description(comment); // comment was set
container->set_updated();
}
if (rel->isReadOnly() != constp) {
rel->set_isReadOnly(constp);
container->set_updated();
}
if (rel->isJavaTransient() != transientp) {
rel->set_isJavaTransient(transientp);
container->set_updated();
}
if (rel->isVolatile() != volatilep) {
//.........这里部分代码省略.........
示例3: set_unidir
void UmlRelation::set_unidir()
{
UmlRelation * r1 = side(TRUE);
UmlRelation * r2 = (r1 != this) ? this : side(FALSE);
if (r1->isReadOnly() || r2->isReadOnly()) {
UmlCom::trace(WrapperStr("<font face=helvetica>in <i>") + WrapperStr(Lex::filename().toAscii().constData())
+ "</i> line " + WrapperStr().setNum(Lex::line_number())
+ " <b>cannot remove relation between classes <i>"
+ roleType()->name() + "</i> and <i>" + parent()->name()
+ "</i> because one is read only</b></font><br>");
throw 0;
}
aRelationKind k;
switch (relationKind()) {
case anAssociation:
k = aDirectionalAssociation;
break;
case anAggregation:
k = aDirectionalAggregation;
break;
default:
k = aDirectionalAggregationByValue;
}
if (this == r1)
set_rel_kind(k);
else {
UmlRelation * rel =
UmlBaseRelation::create(aDirectionalAssociation,
(UmlClass *) parent(), roleType());
WrapperStr role = roleName();
rel->moveAfter(this);
rel->set_Visibility(visibility());
if (!description().isEmpty())
rel->set_Description(description());
if (isReadOnly())
rel->set_isReadOnly(TRUE);
if (isJavaTransient())
rel->set_isJavaTransient(TRUE);
if (isVolatile())
rel->set_isVolatile(TRUE);
if (isClassMember())
rel->set_isClassMember(TRUE);
if (!multiplicity().isEmpty())
rel->set_Multiplicity(multiplicity());
if (!defaultValue().isEmpty())
rel->set_DefaultValue(defaultValue());
if (!javaAnnotations().isEmpty())
rel->set_JavaAnnotations(javaAnnotations());
if (!stereotype().isEmpty())
rel->set_Stereotype(stereotype());
rel->set_JavaDecl(javaDecl());
UmlOperation * op;
UmlOperation * oper;
if (((op = getOperation()) != 0) &&
rel->addGetOperation() &&
((oper = rel->getOperation()) != 0))
copy(op, oper);
if (((op = setOperation()) != 0) &&
rel->addSetOperation() &&
((oper = rel->getOperation()) != 0))
copy(op, oper);
r1->deleteIt();
r2->deleteIt();
rel->set_RoleName(role);
}
}
示例4: new_one
//.........这里部分代码省略.........
st_uml = st;
if (neq(rel->stereotype(), st_uml)) {
rel->set_Stereotype(st_uml);
container->set_updated();
}
}
else
#endif
rel->set_Stereotype((st_uml.isEmpty()) ? st : st_uml);
int index2;
if ((index2 = decl.find("<${type}>")) == -1) {
decl = " ${comment}${static}${mutable}${volatile}${const}${stereotype}<${type}> ${name}${value};";
index2 = decl.find("<${type}>");
}
decl.replace(index2, 9, typeform.mid(index));
}
else {
if (!array.isEmpty()) {
#ifdef ROUNDTRIP
if (roundtrip) {
if (neq(rel->multiplicity(), array)) {
rel->set_Multiplicity(array);
container->set_updated();
}
}
else
#endif
rel->set_Multiplicity(array);
}
decl = CppSettings::relationDecl(modifier != "*", array);
int index;
if (!pretype.isEmpty() &&
((index = decl.find("${type}")) != 0))
decl.insert(index,(const char*)( pretype + " "));
if ((modifier == "&") && ((index = decl.find("${type}")) != 0))
decl.insert(index + 7, " &");
}
if (! value.isEmpty()) {
int index = decl.find("${value}");
if (index != -1)
decl.insert(index + 2, "h_");
#ifdef ROUNDTRIP
if (roundtrip) {
if (!staticp) {
Q3CString v = rel->defaultValue();
if (!v.isEmpty() && (((const char *) v)[0] == '='))
v = v.mid(1);
if (nequal(v, value)) {
rel->set_DefaultValue(value);
container->set_updated();
}
}
}
else
#endif
rel->set_DefaultValue(value);
}
#ifdef ROUNDTRIP
if (roundtrip) {
if (neq(rel->cppDecl(), decl)) {
rel->set_CppDecl(decl);
container->set_updated();
}
if (decl.find("${description}") != -1) {
if (nequal(rel->description(), description)) {
rel->set_Description(description);
container->set_updated();
}
}
else if (nequal(rel->description(), Lex::simplify_comment(comment))) {
rel->set_Description(comment); // comment was set
container->set_updated();
}
// role name is the right one
return TRUE;
}
#endif
rel->set_CppDecl(decl);
if (!comment.isEmpty())
rel->set_Description((decl.find("${description") != -1)
? description : Lex::simplify_comment(comment));
return rel->set_RoleName(name);
}
示例5: importRelations
//.........这里部分代码省略.........
aRelationKind rk;
Q3CString sr;
if (s == "Uses_Relationship") {
rk = aDependency;
sr = "dependency";
}
else if (s == "Inheritance_Relationship") {
rk = aGeneralisation;
sr = "generalisation";
}
else if (s == "Realize_Relationship") {
rk = aRealization;
sr = "realization";
}
else {
f.skipBlock();
continue;
}
// dependency or generalisation
Q3CString id;
Q3CString ste;
Q3CString doc;
Q3Dict<Q3CString> prop;
Q3CString s2;
int k;
do {
k = f.readDefinitionBeginning(s2, id, ste, doc, prop);
} while (id.isEmpty());
Q3CString target_id;
aVisibility visibility = PublicVisibility;
bool virtual_inheritance = FALSE;
bool a_friend = FALSE;
for (;;) {
if (k == ATOM) {
if (s2 == "quidu") {
if (f.read(target_id) != STRING)
f.syntaxError(target_id, "quidu value");
}
else if (s2 == "exportControl")
visibility = f.readVisibility();
else if (s2 == "virtual")
virtual_inheritance = f.readBool();
else if (s2 == "friend")
a_friend = f.readBool();
else
f.skipNextForm();
k = f.read(s2);
}
else if (k == ')')
break;
else
f.syntaxError(s2);
}
if (target_id.isEmpty())
f.syntaxError("quidu missing");
UmlClass * target = (UmlClass *) findItem(target_id, aClass);
if (target != 0) {
UmlRelation * r;
if (a_friend) {
if ((r = UmlRelation::create(rk, target, this)) == 0) {
UmlCom::trace("<br>cannot create " + sr + " from '" +
target->fullName() + "' to '" + fullName() + "'");
f.skipBlock();
return;
}
r->set_Stereotype("friend");
}
else {
if ((r = UmlRelation::create(rk, this, target)) == 0) {
UmlCom::trace("<br>cannot create " + sr + " from '" +
fullName() + "' to '" + target->fullName() + "'");
f.skipBlock();
return;
}
if (!ste.isEmpty())
r->set_Stereotype(ste);
if (visibility != PublicVisibility)
r->set_Visibility(visibility);
if (virtual_inheritance)
r->set_CppVirtualInheritance(TRUE);
}
newItem(r, id);
if (!doc.isEmpty())
r->set_Description(doc);
r->setProperties(prop);
}
}
}
示例6: new_one
// from a form 'generic<...C...> var' where C is a class
bool UmlRelation::new_one(Class * container, const QCString & name,
UmlClass * type, QCString type_def,
QCString genericname,
aVisibility visibility, bool staticp,
bool constp, bool transientp, bool volatilep,
const QCString & array, const QCString & value,
QCString comment, QCString description,
QCString annotation
#ifdef ROUNDTRIP
, bool roundtrip, QList<UmlItem> & expected_order
#endif
)
{
#ifdef TRACE
cout << "RELATION '" << name << "' from '" << cl->Name() << "' to '" << type->Name()
<< "' array '" << array << "'\n";
#endif
if (
#ifdef REVERSE
container->from_libp() &&
#endif
(visibility == PrivateVisibility)) {
Lex::finish_line();
Lex::clear_comments();
return TRUE;
}
QCString st = JavaSettings::umlType(genericname);
if (st.isEmpty())
st = genericname;
UmlClass * cl = container->get_uml();
UmlRelation * rel;
#ifdef ROUNDTRIP
bool created;
if (!roundtrip ||
((rel = search_rel(container, name, type, st)) == 0)) {
#endif
rel = UmlBaseRelation::create(aDirectionalAssociation, cl, type);
if (rel == 0) {
JavaCatWindow::trace(QCString("<font face=helvetica><b>cannot add relation <i>")
+ name + "</i> in <i>" + cl->name() + "</i> to <i>"
+ type->name() + "</i></b></font><br>");
return FALSE;
}
#ifdef REVERSE
# ifndef ROUNDTRIP
Statistic::one_relation_more();
# else
if (roundtrip)
container->set_updated();
created = TRUE;
}
else
created = FALSE;
# endif
#endif
Lex::finish_line();
comment = Lex::get_comments(comment);
description = Lex::get_description(description);
QCString decl = JavaSettings::relationDecl(array);
type_def.replace(0, genericname.length(), "${stereotype}");
decl.replace(decl.find("${type}"), 7, type_def);
#ifdef ROUNDTRIP
if (roundtrip && !created) {
if (rel->visibility() != visibility) {
rel->set_Visibility(visibility);
container->set_updated();
}
if (decl.find("${description}") != -1) {
if (nequal(rel->description(), description)) {
rel->set_Description(description);
container->set_updated();
}
}
else if (nequal(rel->description(), Lex::simplify_comment(comment))) {
rel->set_Description(comment); // comment was set
container->set_updated();
}
if (rel->isReadOnly() != constp) {
rel->set_isReadOnly(constp);
container->set_updated();
}
//.........这里部分代码省略.........