本文整理汇总了C++中UmlPackage::children方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlPackage::children方法的具体用法?C++ UmlPackage::children怎么用?C++ UmlPackage::children使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlPackage
的用法示例。
在下文中一共展示了UmlPackage::children方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parent
UmlClass * UmlClass::addMetaclass(WrapperStr mclname, const char * mclpath)
{
UmlPackage * pack = (UmlPackage *) parent()->parent(); // is a package
const Q3PtrVector<UmlItem> ch = pack->children();
unsigned n = ch.size();
UmlClass * r = 0;
for (unsigned i = 0; i != n; i += 1) {
UmlItem * x = ch[i];
if ((x->kind() == aClassView) &&
!strncmp(x->name(), "meta classes", 12) &&
((r = UmlClass::create(x, mclname)) != 0))
break;
}
if (r == 0) {
WrapperStr s = "meta classes";
UmlItem * v = 0;
while ((v = UmlClassView::create(pack, s)) == 0)
s += "_";
r = UmlClass::create(v, mclname);
}
r->set_Stereotype("metaclass");
if (mclpath != 0)
r->set_PropertyValue("metaclassPath", mclpath);
return r;
}
示例2: name
UmlClassView * UmlPackage::get_classview(const Q3CString & nmsp) {
UmlPackage * pack;
if (nmsp != cppNamespace()) {
if (namespace_fixedp) {
if ((pack = findCppNamespace(nmsp)) == 0) {
Q3CString s = nmsp;
if (s.isEmpty())
s = name();
else {
int index = 0;
while ((index = s.find("::", index)) != -1)
s.replace(index++, 2, " ");
}
if (((pack = UmlBasePackage::create(this, s)) == 0) &&
((pack = UmlBasePackage::create(this, s += "_")) == 0) &&
((pack = UmlBasePackage::create(this, s += "_")) == 0) &&
((pack = UmlBasePackage::create(this, s += "_")) == 0) &&
((pack = UmlBasePackage::create(this, s += "_")) == 0)) {
#ifdef REVERSE
UmlCom::trace(Q3CString("<font face=helvetica><b>cannot create package <i>")
+ s + "</i> under package <i>"
+ name() + "</b></font><br>");
UmlCom::message("");
throw 0;
#else
QMessageBox::critical(0, "Fatal Error",
Q3CString("<font face=helvetica><b>cannot create package <i>")
+ s + "</i> under package <i>"
+ Name() + "</b></font><br>");
QApplication::exit(1);
#endif
}
pack->set_CppNamespace(nmsp);
pack->set_CppSrcDir(cppSrcDir());
pack->set_CppHDir(cppHDir());
pack->namespace_fixedp = TRUE;
}
}
else {
pack = this;
pack->set_CppNamespace(nmsp);
pack->namespace_fixedp = TRUE;
}
}
else
pack = this;
if (pack->class_view == 0) {
Q3PtrVector<UmlItem> ch = pack->children();
for (unsigned index = 0; index != ch.size(); index += 1)
// return the first class view find
if (ch[index]->kind() == aClassView)
return pack->class_view = (UmlClassView *) ch[index];
if ((pack->class_view = UmlBaseClassView::create(pack, name())) == 0) {
#ifdef REVERSE
UmlCom::trace(Q3CString("<font face=helvetica><b>cannot create class view <i>")
+ name() + "</i> under package <i>"
+ pack->name() + "</b></font><br>");
UmlCom::message("");
throw 0;
#else
QMessageBox::critical(0, "Fatal Error",
Q3CString("<font face=helvetica><b>cannot create class view <i>")
+ name() + "</i> under package <i>"
+ pack->name() + "</b></font><br>");
QApplication::exit(1);
#endif
}
}
return pack->class_view;
}