本文整理汇总了C++中UmlRelation::isReadOnly方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlRelation::isReadOnly方法的具体用法?C++ UmlRelation::isReadOnly怎么用?C++ UmlRelation::isReadOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlRelation
的用法示例。
在下文中一共展示了UmlRelation::isReadOnly方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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) {
//.........这里部分代码省略.........
示例2: generate
void UmlRelation::generate(QTextStream & f, const Q3CString &,
Q3CString indent, int &) {
switch (relationKind()) {
case aDependency:
case aGeneralisation:
case aRealization:
break;
default:
if (!phpDecl().isEmpty()) {
const char * p = phpDecl();
const char * pp = 0;
Q3CString s;
while ((*p == ' ') || (*p == '\t'))
indent += *p++;
f << indent;
for (;;) {
if (*p == 0) {
if (pp == 0)
break;
// comment management done
p = pp;
pp = 0;
if (*p == 0)
break;
f << indent;
}
if (*p == '\n') {
f << *p++;
if (*p)
f << indent;
}
else if (*p == '@')
manage_alias(p, f);
else if (*p != '$')
f << *p++;
else if (!strncmp(p, "${comment}", 10))
manage_comment(p, pp, PhpSettings::isGenerateJavadocStyleComment());
else if (!strncmp(p, "${description}", 14))
manage_description(p, pp);
else if (!strncmp(p, "${visibility}", 13)) {
p += 13;
generate_visibility(f);
}
else if (!strncmp(p, "${static}", 9)) {
p += 9;
if (isClassMember())
f << "static ";
}
else if (!strncmp(p, "${type}", 7)) {
p += 7;
roleType()->write(f);
}
else if (!strncmp(p, "${name}", 7)) {
p += 7;
if (!isReadOnly())
f << "$";
f << roleName();
}
else if (!strncmp(p, "${inverse_name}", 15)) {
p += 15;
switch (relationKind()) {
case anAssociation:
case anAggregation:
case anAggregationByValue:
{
UmlRelation * inverse = side(side(TRUE) != this);
if (!inverse->isReadOnly())
f << "$";
f << inverse->roleName();
}
default:
break;
}
}
else if (!strncmp(p, "${var}", 6)) {
p += 6;
if (!isReadOnly() &&
!isClassMember() &&
(visibility() == PackageVisibility))
f << "var ";
}
else if (!strncmp(p, "${value}", 8)) {
if (!defaultValue().isEmpty()) {
if (need_equal(p, defaultValue()))
f << " = ";
f << defaultValue();
}
p += 8;
}
else if (!strncmp(p, "${const}", 8)) {
p += 8;
if (isReadOnly())
f << "const ";
}
//.........这里部分代码省略.........
示例3: new_one
bool UmlRelation::new_one(Class * container, const Q3CString & name,
UmlClass * dest, const Q3CString & modifier,
const Q3CString & pretype, const Q3CString & array,
const Q3CString & typeform, aVisibility visibility,
bool staticp, bool constp, bool mutablep, bool volatilep,
const Q3CString & value, Q3CString comment,
Q3CString description
#ifdef ROUNDTRIP
, bool roundtrip, Q3PtrList<UmlItem> & expected_order
#endif
)
{
#ifdef DEBUG_BOUML
cout << "RELATION '" << name << "' from '" << cl->name() << "' to '" << dest->name()
<< "' modifier '" << modifier << "' array '" << array
<< "' typeform '" << typeform << "'\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
if (roundtrip &&
((rel = search_rel(container, name, dest, "")) != 0)) {
rel->set_usefull();
expected_order.append(rel);
}
else {
#endif
rel = UmlBaseRelation::create((modifier.isEmpty() &&
((typeform == "${type}") ||
(typeform[typeform.find("${type}") + 7] != '*')))
? aDirectionalAggregationByValue
: aDirectionalAssociation,
cl, dest);
if (rel == 0) {
UmlCom::trace(Q3CString("<font face=helvetica><b>cannot add relation <i>")
+ name + "</i> in <i>" + cl->name() + "</i> to <i>"
+ dest->name() + "</i></b></font><br><hr>");
return FALSE;
}
#ifdef REVERSE
# ifndef ROUNDTRIP
Statistic::one_relation_more();
# else
if (roundtrip) {
expected_order.append(rel);
container->set_updated();
roundtrip = FALSE;
}
}
# endif
#endif
Lex::finish_line();
comment = Lex::get_comments(comment);
description = Lex::get_description(description);
#ifdef ROUNDTRIP
if (roundtrip) {
if (rel->visibility() != visibility) {
rel->set_Visibility(visibility);
container->set_updated();
}
if (rel->isReadOnly() != constp) {
rel->set_isReadOnly(constp);
container->set_updated();
}
if (rel->isClassMember() != staticp) {
rel->set_isClassMember(staticp);
container->set_updated();
}
if (rel->isCppMutable() != mutablep) {
rel->set_isCppMutable(mutablep);
container->set_updated();
}
if (rel->isVolatile() != volatilep) {
rel->set_isVolatile(volatilep);
container->set_updated();
}
}
else {
#endif
//.........这里部分代码省略.........
示例4: 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();
}
//.........这里部分代码省略.........