当前位置: 首页>>代码示例>>C++>>正文


C++ Tuple::DeleteIfAllowed方法代码示例

本文整理汇总了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;
 }
开发者ID:awarematics,项目名称:SECONDO,代码行数:20,代码来源:RelationCommon.cpp

示例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;
  }
}
开发者ID:awarematics,项目名称:SECONDO,代码行数:70,代码来源:RelationCommon.cpp


注:本文中的Tuple::DeleteIfAllowed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。