本文整理汇总了C++中Tuple::DeleteIfAllowed方法的典型用法代码示例。如果您正苦于以下问题:C++ Tuple::DeleteIfAllowed方法的具体用法?C++ Tuple::DeleteIfAllowed怎么用?C++ Tuple::DeleteIfAllowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tuple
的用法示例。
在下文中一共展示了Tuple::DeleteIfAllowed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeScan
std::ostream& Relation::Print(std::ostream& os) const
{
os << "Start of Relation: " << endl;
int i = 0;
Tuple* t = 0;
GenericRelationIterator* it = MakeScan();
while ((t = it->GetNextTuple()) != 0)
{
os << i << ".Tuple: ";
t->Print(os);
t->DeleteIfAllowed();
t = 0;
i++;
os << endl;
}
delete it;
it = 0;
os << "End of Relation." << endl;
return os;
}
示例2: Relation
GenericRelation *Relation::In( ListExpr typeInfo, ListExpr value,
int errorPos, ListExpr& errorInfo,
bool& correct, bool tupleBuf /*=false*/)
{
ListExpr tuplelist, TupleTypeInfo, first;
GenericRelation* rel;
Tuple* tupleaddr;
int tupleno, count;
bool tupleCorrect;
correct = true;
count = 0;
if (tupleBuf)
rel = new TupleBuffer;
else
rel = new Relation( typeInfo );
tuplelist = value;
TupleTypeInfo = nl->TwoElemList(nl->Second(typeInfo),
nl->IntAtom(nl->ListLength(nl->Second(nl->Second(typeInfo)))));
tupleno = 0;
if (nl->IsAtom(value))
{
correct = false;
errorInfo = nl->Append(errorInfo,
nl->ThreeElemList(
nl->IntAtom(70),
nl->SymbolAtom(Relation::BasicType()),
tuplelist));
return rel;
}
else
{ // increase tupleno
while (!nl->IsEmpty(tuplelist))
{
first = nl->First(tuplelist);
tuplelist = nl->Rest(tuplelist);
tupleno++;
tupleaddr = Tuple::In(TupleTypeInfo, first, tupleno,
errorInfo, tupleCorrect);
if (tupleCorrect)
{
rel->AppendTuple(tupleaddr);
tupleaddr->DeleteIfAllowed();
count++;
}
else
{
correct = false;
}
}
if (!correct)
{
errorInfo =
nl->Append(errorInfo,
nl->TwoElemList(
nl->IntAtom(72),
nl->SymbolAtom(Relation::BasicType())));
delete rel;
return 0;
}
else
return rel;
}
}