本文整理汇总了C++中UmlRelation::addGetOperation方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlRelation::addGetOperation方法的具体用法?C++ UmlRelation::addGetOperation怎么用?C++ UmlRelation::addGetOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlRelation
的用法示例。
在下文中一共展示了UmlRelation::addGetOperation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}