本文整理汇总了C++中UmlItem::children方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlItem::children方法的具体用法?C++ UmlItem::children怎么用?C++ UmlItem::children使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlItem
的用法示例。
在下文中一共展示了UmlItem::children方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: already_in_bouml
Class::Class(Package * p, const char * n, char st)
: BrowserNode(p, n),
uml(0), stereotype(st), abstractp(FALSE), reversedp(FALSE),
#ifdef REVERSE
from_lib(FALSE)
#else
description_updatedp(FALSE)
#endif
{
p->new_class(this);
}
UmlClass * Class::get_uml()
{
if (uml != 0)
return uml;
UmlItem * p = // no nested classe in php
(UmlItem *)((Package *) parent())->get_uml()->get_classview(get_namespace());
WrapperStr str = WrapperStr(text(0).toLatin1().constData());
uml = UmlBaseClass::create(p, str);
if (uml == 0) {
// probably already exist
QVector<UmlItem*> ch = p->children();
UmlItem * x;
for (int chindex = 0; chindex != ch.size(); chindex += 1) {
if (((x = ch[chindex])->kind() == aClass) && (x->name() == str)) {
uml = (UmlClass *) x;
break;
}
}
if (uml == 0) {
#ifdef REVERSE
UmlCom::message("");
UmlCom::trace(QString(QString("<font face=helvetica><b>cannot create class <i>")
+ text(0) + "</i> under <i>"
+ parent()->text(0) + "</b></font><br>").toLatin1().constData());
throw 0;
#else
QMessageBox::critical(0, "Fatal Error",
QString("<font face=helvetica><b>cannot create class <i>")
+ text(0) + "</i> under <i>"
+ parent()->text(0) + "</b></font><br>");
QApplication::exit(1);
#endif
}
}
switch (stereotype) {
case 'i':
uml->set_Stereotype("interface");
uml->set_PhpDecl(PhpSettings::interfaceDecl());
break;
default:
// class
break;
}
if (abstractp)
uml->set_isAbstract(TRUE);
return uml;
}
bool Class::already_in_bouml()
{
QVector<UmlItem*> ch = get_uml()->children();
for (int index = 0; index != ch.size(); index += 1)
if (ch[index]->kind() != aClass)
return TRUE;
return FALSE;
}