本文整理汇总了C++中UmlClass::children方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlClass::children方法的具体用法?C++ UmlClass::children怎么用?C++ UmlClass::children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlClass
的用法示例。
在下文中一共展示了UmlClass::children方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isAppliedStereotype
bool UmlClass::isAppliedStereotype(Token & tk, WrapperStr & prof_st, Q3ValueList<WrapperStr> & base_v)
{
static Q3Dict<WrapperStr> stereotypes;
static Q3Dict<Q3ValueList<WrapperStr> > bases;
WrapperStr s = tk.what();
WrapperStr * st = stereotypes[s];
if (st != 0) {
prof_st = *st;
base_v = *bases[s];
return TRUE;
}
base_v.clear();
if (tk.xmiType().isEmpty() && (getFct(tk) == 0)) {
int index = s.find(':');
if ((index != -1) &&
((index != 3) || ((s.left(3) != "uml") && (s.left(3) != "xmi")))) {
UmlClass * cl = findStereotype(s, FALSE);
if (cl != 0) {
const Q3PtrVector<UmlItem> ch = cl->children();
unsigned n = ch.size();
for (unsigned i = 0; i != n; i += 1) {
UmlItem * x = ch[i];
if ((x->kind() == aRelation) &&
(((UmlRelation *) x)->relationKind() == aDirectionalAssociation) &&
(((UmlRelation *) x)->roleType()->stereotype() == "metaclass"))
base_v.append("base_" + ((UmlRelation *) x)->roleType()->name().lower());
}
if (base_v.isEmpty())
base_v.append("base_element");
prof_st = cl->parent()->parent()->name() + ":" + cl->name();
stereotypes.insert(s, new WrapperStr(prof_st));
bases.insert(s, new Q3ValueList<WrapperStr>(base_v));
return TRUE;
}
}
}
return FALSE;
}
示例2: new_friend
bool UmlRelation::new_friend(Class * container, UmlClass * to,
Q3PtrList<UmlItem> & expected_order)
{
UmlClass * from = container->get_uml();
#ifdef DEBUG_BOUML
cout << "FRIEND from '" << from->name() << "' to '" << to->name() << "'\n";
#endif
const Q3PtrVector<UmlItem> & ch = from->children();
UmlItem ** v = ch.data();
UmlItem ** const vsup = v + ch.size();
for (;v != vsup; v += 1) {
if (((*v)->kind() == aRelation) &&
(((UmlRelation *) *v)->relationKind() == aDependency) &&
(((UmlRelation *) *v)->roleType() == to) &&
!neq((*v)->stereotype(), "friend")) {
expected_order.append(*v);
((UmlRelation *) *v)->set_usefull();
return TRUE;
}
}
// relation not found
UmlRelation * rel = UmlBaseRelation::create(aDependency, from, to);
if (rel == 0) {
UmlCom::trace(Q3CString("<font face=helvetica><b>cannot add friend relation in <i>")
+ from->name() + "</i> to <i>"
+ to->name() + "</i></b></font><br><hr><br>");
return FALSE;
}
expected_order.append(rel);
container->set_updated();
rel->set_CppDecl("Generated");
return rel->set_Stereotype("friend");
}