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


C++ AttributeValueList::Next方法代码示例

本文整理汇总了C++中AttributeValueList::Next方法的典型用法代码示例。如果您正苦于以下问题:C++ AttributeValueList::Next方法的具体用法?C++ AttributeValueList::Next怎么用?C++ AttributeValueList::Next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AttributeValueList的用法示例。


在下文中一共展示了AttributeValueList::Next方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get_transformer

Transformer* CreateGraphicFunc::get_transformer(AttributeList* al) {
  static int transform_symid = symbol_add("transform");

  AttributeValue* transformv = nil;
  Transformer* rel = nil;
  AttributeValueList* avl = nil;
  if (al && 
      (transformv=al->find(transform_symid)) && 
      transformv->is_array() && 
      (avl=transformv->array_val()) &&
      avl->Number()==6) {
    float a00, a01, a10, a11, a20, a21;
    Iterator it;
    avl->First(it); a00=avl->GetAttrVal(it)->float_val();
    avl->Next(it); a01=avl->GetAttrVal(it)->float_val();
    avl->Next(it); a10=avl->GetAttrVal(it)->float_val();
    avl->Next(it); a11=avl->GetAttrVal(it)->float_val();
    avl->Next(it); a20=avl->GetAttrVal(it)->float_val();
    avl->Next(it); a21=avl->GetAttrVal(it)->float_val();
    rel = new Transformer(a00, a01, a10, a11, a20, a21);
  } else {
    rel = ((OverlayViewer*)_ed->GetViewer())->GetRel();
    if (rel != nil) {
      rel = new Transformer(rel);
      rel->Invert();
    }
  }
  return rel;
  
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:30,代码来源:grfunc.c

示例2: execute

void CreateOpenSplineFunc::execute() {
    ComValue& vect = stack_arg(0);
    if (!vect.is_type(ComValue::ArrayType) || vect.array_len()==0) {
        reset_stack();
	push_stack(ComValue::nullval());
	return;
    }

    const int len = vect.array_len();
    const int npts = len/2;
    int x[npts];
    int y[npts];
    ALIterator i;
    AttributeValueList* avl = vect.array_val();
    avl->First(i);
    for (int j=0; j<npts && !avl->Done(i); j++) {
        x[j] = avl->GetAttrVal(i)->int_val();
	avl->Next(i);
        y[j] = avl->GetAttrVal(i)->int_val();
	avl->Next(i);
    }

    AttributeList* al = stack_keys();
    Resource::ref(al);
    reset_stack();

    PasteCmd* cmd = nil;

    if (npts) {
	BrushVar* brVar = (BrushVar*) _ed->GetState("BrushVar");
	PatternVar* patVar = (PatternVar*) _ed->GetState("PatternVar");
	ColorVar* colVar = (ColorVar*) _ed->GetState("ColorVar");

        Transformer* rel = get_transformer(al);

	ArrowVar* aVar = (ArrowVar*) _ed->GetState("ArrowVar");
	ArrowOpenBSpline* openspline = new ArrowOpenBSpline(x, y, npts, aVar->Head(), aVar->Tail(), 
					_ed->GetViewer()->GetMagnification(), stdgraphic);

	if (brVar != nil) openspline->SetBrush(brVar->GetBrush());
	if (patVar != nil) openspline->SetPattern(patVar->GetPattern());

	if (colVar != nil) {
	    openspline->FillBg(!colVar->GetBgColor()->None());
	    openspline->SetColors(colVar->GetFgColor(), colVar->GetBgColor());
            }
	openspline->SetTransformer(rel);
	Unref(rel);
	ArrowSplineOvComp* comp = new ArrowSplineOvComp(openspline);
	comp->SetAttributeList(al);
	if (PasteModeFunc::paste_mode()==0)
	  cmd = new PasteCmd(_ed, new Clipboard(comp));
	ComValue compval(new OverlayViewRef(comp), symbol_add("ArrowSplineComp"));
	push_stack(compval);
	execute_log(cmd);
    } else 
	push_stack(ComValue::nullval());

    Unref(al);
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:60,代码来源:grfunc.c

示例3: execute

void JoinStrFunc::execute() {
  ComValue listv(stack_arg(0));
  static int sym_symid = symbol_add("sym");
  ComValue symflagv(stack_key(sym_symid));
  boolean symflag = symflagv.is_true();
  reset_stack();

  if (listv.is_array()) {
    AttributeValueList* avl = listv.array_val();
    if (avl) {
      char cbuf[avl->Number()+1];
      Iterator i;
      int cnt=0;
      for (avl->First(i); !avl->Done(i); avl->Next(i)) {
	cbuf[cnt] = avl->GetAttrVal(i)->char_val();
	cnt++;
      }
      cbuf[cnt] = '\0';

    ComValue retval(symbol_add(cbuf), symflag ? ComValue::SymbolType : ComValue::StringType);
    push_stack(retval);
    return;
    }
  }
  push_stack(ComValue::nullval());
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:26,代码来源:symbolfunc.c

示例4: execute

void SumFunc::execute() {
  ComValue vallist(stack_arg(0));
  reset_stack();
  
  if (vallist.is_type(ComValue::ArrayType)) {
    AttributeValueList* avl = vallist.array_val();
    AddFunc addfunc(comterp());
    push_stack(ComValue::zeroval());
    Iterator it;
    int count = 0;
    for (avl->First(it); !avl->Done(it); avl->Next(it)) {
      count++;
      push_stack(*avl->GetAttrVal(it));
      addfunc.exec(2,0);
    }
    if (_meanfunc) {
      DivFunc divfunc(comterp());
      ComValue divisor(count, ComValue::IntType);
      push_stack(divisor);
      divfunc.exec(2,0);
    }
  } else {
    push_stack(vallist);
  }
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:25,代码来源:statfunc.c

示例5: execute


//.........这里部分代码省略.........
        strmbuf = new std::strstreambuf();
#endif
    ostream out(strmbuf);

    int narg = nargs();
    if (narg==1) {

        if (formatstr.is_string())
            out << formatstr.symbol_ptr();
        else
            out << formatstr;  // which could be arbitrary ComValue

    } else {
        switch( printval.type() )
        {
        case ComValue::SymbolType:
        case ComValue::StringType:
            out_form(out, fstr, symbol_pntr( printval.symbol_ref()));
            break;

        case ComValue::BooleanType:
            out_form(out, fstr, printval.boolean_ref());
            break;

        case ComValue::CharType:
            out_form(out, fstr, printval.char_ref());
            break;

        case ComValue::UCharType:
            out_form(out, fstr, printval.uchar_ref());
            break;

        case ComValue::IntType:
            out_form(out, fstr, printval.int_ref());
            break;

        case ComValue::UIntType:
            out_form(out, fstr, printval.uint_ref());
            break;

        case ComValue::LongType:
            out_form(out, fstr, printval.long_ref());
            break;

        case ComValue::ULongType:
            out_form(out, fstr, printval.ulong_ref());
            break;

        case ComValue::FloatType:
            out_form(out, fstr, printval.float_ref());
            break;

        case ComValue::DoubleType:
            out_form(out, fstr, printval.double_ref());
            break;

        case ComValue::ArrayType:
        {

            ALIterator i;
            AttributeValueList* avl = printval.array_val();
            avl->First(i);
            boolean first = true;
            while (!avl->Done(i)) {
                ComValue val(*avl->GetAttrVal(i));
                push_stack(formatstr);
                push_stack(val);
                exec(2,0);
                avl->Next(i);
                if (!avl->Done(i)) out << "\n";
            }
        }
        break;

        case ComValue::BlankType:
            out << "<blank>";
            break;

        case ComValue::UnknownType:
            out_form(out, fstr, nil);
            break;

        default:
            break;
        }
    }


    if (stringflag.is_true() || strflag.is_true()) {
        out << '\0';
        ComValue retval(((std::strstreambuf*)strmbuf)->str());
        push_stack(retval);
    } else if (symbolflag.is_true() || symflag.is_true()) {
        out << '\0';
        int symbol_id = symbol_add(((std::strstreambuf*)strmbuf)->str());
        ComValue retval(symbol_id, ComValue::SymbolType);
        push_stack(retval);
    }
    delete strmbuf;
}
开发者ID:steinarb,项目名称:interviews,代码行数:101,代码来源:iofunc.c

示例6: if

ostream& operator<< (ostream& out, const AttributeValue& sv) {
    AttributeValue* svp = (AttributeValue*)&sv;
    char* title;
    char* symbol;
    int counter;
#if 0
    switch( svp->type() )
	{
	case AttributeValue::KeywordType:
	    out << "Keyword (" << symbol_pntr( svp->symbol_ref() ) << 
		")"; 
	    break;
	    
	case AttributeValue::CommandType:
	    title = "Command (";
	    symbol = symbol_pntr( svp->symbol_ref() );
	    out << title << symbol;
	    counter = strlen(title) + strlen(symbol);
	    while( ++counter < 32 ) out << ' ';
	    out << ")";
	    break;
	    
	case AttributeValue::SymbolType:
	    out << "symbol (" << svp->symbol_ptr()  << ")";
	    break;
	    
	case AttributeValue::StringType:
	    out << "string (" << svp->string_ptr()  << ")";
	    break;
	    
	case AttributeValue::BooleanType:
	    out << "boolean (" << svp->boolean_ref() << ")";
	    break;
	    
	case AttributeValue::CharType:
	    out << "char (" << svp->char_ref() << ":" << (int)svp->char_ref() << ")";
	    break;
	    
	case AttributeValue::UCharType:
	    out << "uchar (" << svp->char_ref() << ":" << (int)svp->char_ref() << ")";
	    break;
	    
	case AttributeValue::IntType:
	    out << "int (" << svp->int_ref() << ")";
	    break;
	    
	case AttributeValue::UIntType:
	    if (svp->state()==AttributeValue::OctState) 
	      out << "uint (" << svp->uint_ref() << ")";
	    else if (svp->state()==AttributeValue::HexState) 
	      out << "uint (" << svp->uint_ref() << ")";
	    else
	      out << "uint (" << svp->uint_ref() << ")";
	    break;
	    
	case AttributeValue::LongType:
	    out << "Long (" << svp->long_ref() << ")";
	    break;
	    
	case AttributeValue::ULongType:
	    out << "ulong (" << svp->ulong_ref() << ")";
	    break;
	    
	case AttributeValue::FloatType:
	    out << "float (" << svp->float_ref() << ")";
	    break;
	    
	case AttributeValue::DoubleType:
	    out << "double (" << svp->double_ref() << ")";
	    //printf("%9.2f\n", svp->double_ref());
	    break;
	    
	case AttributeValue::EofType:
	    out << "eof";
	    break;
	    
	case AttributeValue::ArrayType:
	  {
	    out << "list of length " << svp->array_len();
	    ALIterator i;
	    AttributeValueList* avl = svp->array_val();
	    avl->First(i);
	    boolean first = true;
	    while (!avl->Done(i)) {
 	        out << "\n\t" << *avl->GetAttrVal(i);
	        avl->Next(i);
	    }
	  }
	    break;
	    
	case AttributeValue::BlankType:
	    break;
	    
	default:
	    break;
	}
#else
        switch(svp->type()) {
	case AttributeValue::KeywordType:
	  out << "Keyword (" << symbol_pntr( svp->symbol_ref() ) << 
//.........这里部分代码省略.........
开发者ID:barak,项目名称:ivtools-cvs,代码行数:101,代码来源:attrvalue.c

示例7: execute


//.........这里部分代码省略.........
        strncpy(fbuf, fstrptr, BUFSIZ);

      switch( printval.type() )
      {
      case ComValue::SymbolType:
      case ComValue::StringType:
	out_form(out, fbuf, symbol_pntr( printval.symbol_ref()));
	break;
	
      case ComValue::BooleanType:
	out_form(out, fbuf, printval.boolean_ref());
	break;
	
      case ComValue::CharType:
	out_form(out, fbuf, printval.char_ref());
	break;	    
	
      case ComValue::UCharType:
	out_form(out, fbuf, printval.uchar_ref());
	break;
	
      case ComValue::IntType:
	out_form(out, fbuf, printval.int_ref());
	break;
	
      case ComValue::UIntType:
	out_form(out, fbuf, printval.uint_ref());
	break;
	
      case ComValue::LongType:
	out_form(out, fbuf, printval.long_ref());
	break;
	
      case ComValue::ULongType:
	out_form(out, fbuf, printval.ulong_ref());
	break;
	
      case ComValue::FloatType:
	out_form(out, fbuf, printval.float_ref());
	break;
	
      case ComValue::DoubleType:
	out_form(out, fbuf, printval.double_ref());
	break;
	
      case ComValue::ArrayType: 
      {
	
        ALIterator i;
        AttributeValueList* avl = printval.array_val();
        avl->First(i);
        boolean first = true;
        while (!avl->Done(i)) {
          ComValue val(*avl->GetAttrVal(i));
          push_stack(formatstr);
          push_stack(val);
          exec(2,0);
          avl->Next(i);
          if (!avl->Done(i)) out << "\n";
        }
      }
      break;
      
      case ComValue::BlankType:
	out << "<blank>";
	break;
	
      case ComValue::UnknownType:
	out_form(out, fbuf, nil);
	break;
	
      case ComValue::ObjectType:
	out_form(out, fbuf, symbol_pntr(printval.class_symid()));
	break;
	
      default:
	break;
      }
    }
  }


  reset_stack();
  if (stringflag.is_true() || strflag.is_true()) {
    out << '\0';
    ComValue retval(((std::strstreambuf*)strmbuf)->str());
    push_stack(retval);
  } else if (symbolflag.is_true() || symflag.is_true()) {
    out << '\0';
    int symbol_id = symbol_add(((std::strstreambuf*)strmbuf)->str());
    ComValue retval(symbol_id, ComValue::SymbolType);
    push_stack(retval);
  } else {
    out.flush();
    push_stack(ComValue::blankval());
  }

  delete strmbuf;

}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:101,代码来源:iofunc.c


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