本文整理汇总了C++中UmlClass::set_usefull方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlClass::set_usefull方法的具体用法?C++ UmlClass::set_usefull怎么用?C++ UmlClass::set_usefull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlClass
的用法示例。
在下文中一共展示了UmlClass::set_usefull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s
UmlClass * UmlClass::auxilarily_typedef(const WrapperStr & base
#ifdef REVERSE
, bool libp
# ifdef ROUNDTRIP
, bool container_roundtrip
, QList<UmlItem *> & container_expected_order
# endif
#endif
)
{
WrapperStr typedef_decl = CppSettings::typedefDecl();
const QVector<UmlItem*>& children = parent()->children();
unsigned n = children.count();
unsigned index;
// a typedef with the right definition already exist ?
for (index = 0; index != n; index += 1) {
if (children[index]->kind() == aClass) {
UmlClass * cl = (UmlClass *) children[index];
if ((cl->stereotype() == "typedef") &&
(cl->cppDecl() == typedef_decl) &&
(cl->baseType().explicit_type == base)) {
#ifdef ROUNDTRIP
cl->set_usefull();
if (container_roundtrip)
container_expected_order.append(cl);
#endif
return cl;
}
}
}
// must create typedef with a new name
for (;;) {
static unsigned nty;
QString s("typedef%1");
s=s.arg(QString::number(++nty));
for (index = 0; index != n; index += 1)
if (children[index]->name() == s)
break;
if (index == n) {
UmlClass * cl = UmlClass::create(parent(), s.toLatin1().constData());
if (cl == 0) {
#ifdef REVERSE
UmlCom::message("");
CppCatWindow::trace(WrapperStr("<font face=helvetica><b>cannot create class <i>")
+ s + "</i> under <i>"
+ parent()->name() + "</b></font><br>");
throw 0;
#else
QMessageBox::critical(0, "Fatal Error",
WrapperStr("<font face=helvetica><b>cannot create class <i>")
+ s + "</i> under <i>"
+ parent()->name() + "</b></font><br>");
QApplication::exit(1);
#endif
}
UmlTypeSpec typespec;
typespec.explicit_type = base;
cl->set_Stereotype("typedef");
cl->set_BaseType(typespec);
cl->set_CppDecl(typedef_decl);
#ifdef REVERSE
if (!libp)
cl->need_artifact(Namespace::current());
# ifdef ROUNDTRIP
if (container_roundtrip)
container_expected_order.append(cl);
# endif
#endif
return cl;
}
}
}