本文整理汇总了C++中Q3ValueList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3ValueList::clear方法的具体用法?C++ Q3ValueList::clear怎么用?C++ Q3ValueList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3ValueList
的用法示例。
在下文中一共展示了Q3ValueList::clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QVERIFY
void tst_Q3ValueList::clear()
{
Q3ValueList<int> a;
a.append( 1 );
a.append( 2 );
a.append( 3 );
a.clear();
QVERIFY( a.isEmpty() );
}
示例2: relationsValue
void UmlBaseClassInstance::relationsValue(Q3ValueList<SlotRelation> & result) {
UmlCom::send_cmd(_identifier, relationsCmd, (void *) 0);
unsigned n = UmlCom::read_unsigned();
result.clear();
while (n--) {
UmlRelation * r = (UmlRelation *) UmlBaseItem::read_();
result.append(SlotRelation(r, (UmlClassInstance *) UmlBaseItem::read_()));
}
}
示例3: attributesValue
void UmlBaseClassInstance::attributesValue(Q3ValueList<SlotAttribute> & result) {
UmlCom::send_cmd(_identifier, attributesCmd, (char) 0);
unsigned n = UmlCom::read_unsigned();
result.clear();
while (n--) {
UmlAttribute * at = (UmlAttribute *) UmlBaseItem::read_();
result.append(SlotAttribute(at, UmlCom::read_string()));
}
}
示例4: 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;
}
示例5: QCOMPARE
void tst_Q3ValueList::size()
{
Q3ValueList<int> a;
QCOMPARE( (int)a.size(), 0 );
a.append( 1 );
QCOMPARE( (int)a.size(), 1 );
a.append( 2 );
QCOMPARE( (int)a.size(), 2 );
a.append( 3 );
QCOMPARE( (int)a.size(), 3 );
a.clear();
QCOMPARE( (int)a.size(), 0 );
}
示例6: get_extended
void UmlClass::get_extended(Q3ValueList<WrapperStr> & r)
{
r.clear();
const Q3PtrVector<UmlItem> ch = children();
unsigned n = ch.size();
unsigned i;
for (i = 0; i != n; i += 1) {
UmlItem * x = ch[i];
if ((x->kind() == aRelation) &&
(((UmlRelation *) x)->relationKind() == aDirectionalAssociation) &&
(((UmlRelation *) x)->roleType()->stereotype() == "metaclass"))
r.append(((UmlRelation *) x)->roleType()->name());
}
if (r.isEmpty())
r.append("Element");
}