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


C++ VarList类代码示例

本文整理汇总了C++中VarList的典型用法代码示例。如果您正苦于以下问题:C++ VarList类的具体用法?C++ VarList怎么用?C++ VarList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: doEnableQuitOnClose

void OptionsTabApplication::restoreOptions()
{
	if ( !w )
		return;

	OptApplicationUI *d = (OptApplicationUI *)w;

	d->ck_autoUpdate->setChecked(PsiOptions::instance()->getOption("options.auto-update.check-on-startup").toBool());
	d->ck_quitOnClose->setChecked(PsiOptions::instance()->getOption("options.ui.contactlist.quit-on-close").toBool());

	// docklet
	d->ck_docklet->setChecked( PsiOptions::instance()->getOption("options.ui.systemtray.enable").toBool() );
	d->ck_dockDCstyle->setChecked( PsiOptions::instance()->getOption("options.ui.systemtray.use-double-click").toBool() );
	d->ck_dockHideMW->setChecked( PsiOptions::instance()->getOption("options.contactlist.hide-on-start").toBool() );
	d->ck_dockToolMW->setChecked( PsiOptions::instance()->getOption("options.contactlist.use-toolwindow").toBool() );
	doEnableQuitOnClose(d->ck_docklet->isChecked()?1:0);

	// data transfer
	d->le_dtPort->setText( QString::number(PsiOptions::instance()->getOption("options.p2p.bytestreams.listen-port").toInt()) );
	d->le_dtExternal->setText( PsiOptions::instance()->getOption("options.p2p.bytestreams.external-address").toString() );

	// Language
	VarList vList = TranslationManager::instance()->availableTranslations();
	QStringList lang = vList.varsToStringList();
	d->cb_lang->addItem(tr("Default"));
	foreach(QString item, lang) {
		d->cb_lang->addItem(vList.get(item));
	}
开发者ID:Vitozz,项目名称:psi,代码行数:28,代码来源:opt_application.cpp

示例2: Inst

InstFakeKill::InstFakeKill(Cfg *Func, const VarList &KilledRegs,
                           const Inst *Linked)
    : Inst(Func, Inst::FakeKill, KilledRegs.size(), NULL), Linked(Linked) {
  for (VarList::const_iterator I = KilledRegs.begin(), E = KilledRegs.end();
       I != E; ++I) {
    Variable *Var = *I;
    addSource(Var);
  }
}
开发者ID:stichnot,项目名称:subzero,代码行数:9,代码来源:IceInst.cpp

示例3: renderDofAmountTest

void renderDofAmountTest()
{
    Options opts;
    opts.xRes = 320;
    opts.yRes = 240;
    opts.gridSize = 8;
    opts.clipNear = 0.1;
    opts.superSamp = Imath::V2i(10,10);
    opts.pixelFilter = makeGaussianFilter(Vec2(2.0,2.0));
    opts.fstop = 100;
    opts.focalLength = 20;
    opts.focalDistance = 3;

    Attributes attrs;
    attrs.shadingRate = 1;
    attrs.smoothShading = true;

    Mat4 camToScreen =
        perspectiveProjection(90, opts.clipNear, opts.clipFar) *
        screenWindow(-2.33333, 0.33333, -1, 1);

    // Output variables.
    VarList outVars;
    outVars.push_back(Stdvar::Cs);

    Renderer r(opts, camToScreen, outVars);

    Mat4 wToO = Mat4().setTranslation(Vec3(-0.5,-0.5,-1)) *
                Mat4().setAxisAngle(Vec3(0,0,1), deg2rad(45)) *
                Mat4().setTranslation(Vec3(-1.5, 0, 2));

    const float P[12] = {0, 0, 0,  1, 0, 0,  0, 1, 0,  1, 1, 0};
    {
        const float Cs[3] = {1, 0.7, 0.7};
        r.add(createPatch(P, Cs, wToO), attrs);
    }
    {
        const float Cs[3] = {0.7, 1, 0.7};
        r.add(createPatch(P, Cs, Mat4().setTranslation(Vec3(0,0,1))*wToO), attrs);
    }
    {
        const float Cs[3] = {0.7, 0.7, 1};
        r.add(createPatch(P, Cs, Mat4().setTranslation(Vec3(0,0,2))*wToO), attrs);
    }
    {
        const float Cs[3] = {1, 0.7, 0.7};
        r.add(createPatch(P, Cs, Mat4().setTranslation(Vec3(0,0,5))*wToO), attrs);
    }
    {
        const float Cs[3] = {0.7, 1, 0.7};
        r.add(createPatch(P, Cs, Mat4().setTranslation(Vec3(0,0,25))*wToO), attrs);
    }

    r.render();
}
开发者ID:UIKit0,项目名称:aqsis,代码行数:55,代码来源:dofamounttest.cpp

示例4: fprintf

void DataRewriter::organizeNewBss(Region* reg, unsigned char magic) {
   /**
    *
    */

   fprintf(stderr, "BSS region starts at %p\n", reg->getRegionAddr());

   VarList globals = filterVariables(reg);

   unsigned int dataSize = 0;
   unsigned int dataBase = 0;
   unsigned int dataOffset = 0;

   unsigned int rawIndex = 0;
   unsigned int rawValue = 0;

   unsigned int newRawIndex = 0;

   dataSize = reg->getRegionSize();
   dataBase = newDataBase + newDataSize;

   fprintf(stderr, "BSS base = %p\n", (void*) dataBase);

   unsigned int newBssSize = sizeof(unsigned char) * dataSize;

   oldRawBss = (unsigned char*) reg->getPtrToRawData();
   newRawBss = (unsigned char*) malloc (newBssSize);

   memcpy(newRawBss, oldRawBss, dataSize);


   for (int i = 0; i < globals.size(); i++) {
      dataOffset = globals[i]->getOffset();
      rawIndex = dataOffset - dataBase;
      // Update the relocated address mapping
      newLocs[dataOffset] = dataBase + newRawIndex;
      newRawIndex += globals[i]->getSize();
   }

   for (AddrMapping::const_iterator iter = newLocs.begin();
         iter != newLocs.end();
         ++iter) {
      fprintf(stderr, "%p -> %p\n", iter->first, iter->second);
   }

   // Causes a segfault in the mutated binary
   // 
   //if (!reg->setPtrToRawData(newRawBss, newDataSize)) {
   //   fprintf(stderr, "Unable to assign new data section.\n");
   //   exit(EXIT_FAILURE);
   //}

}
开发者ID:AmesianX,项目名称:memz,代码行数:53,代码来源:DataRewriter.cpp

示例5: var

    const Var* var( const size_t index ) const
    {
        VarList::const_iterator var = m_vars.begin();
        VarList::const_iterator last = m_vars.end();
        size_t counter = 0;
        while ( var != last )
        {
            if ( counter++ == index ) break;
            var++;
        }

        return( *var );
    }
开发者ID:zkbreeze,项目名称:OceanVis,代码行数:13,代码来源:main.cpp

示例6: filterVariables

void DataRewriter::organizeNewData(Region* reg, unsigned char magic) {
   /**
    *
    */
   VarList globals = filterVariables(reg);

   unsigned int dataSize = 0;
   unsigned int dataBase = 0;
   unsigned int dataOffset = 0;

   unsigned int rawIndex = 0;
   unsigned int rawValue = 0;

   unsigned int newRawIndex = 0;

   dataSize = reg->getRegionSize();
   dataBase = reg->getRegionAddr();

   newDataBase = dataBase;
   newDataSize = sizeof(unsigned char) * dataSize * 2;

   oldRaw = (unsigned char*) reg->getPtrToRawData();
   newRaw = (unsigned char*) malloc (newDataSize);

   // The dso_handle bullshit
   memcpy(newRaw, oldRaw, 4);
   memset(newRaw + 4, magic, 4);
   newRawIndex += 8;

   // Pad the new data section with an extra 4 bytes between all 4 byte values.
   for (int i = 0; i < globals.size(); i++) {
      dataOffset = globals[i]->getOffset();
      rawIndex = dataOffset - dataBase;
      memcpy(newRaw + newRawIndex, oldRaw + rawIndex, 4);
      // Sanity checks, write magic values into padding
      memset(newRaw + newRawIndex + 4, magic, 4);
      // Update the relocated address mapping
      newLocs[dataOffset] = dataBase + newRawIndex;
      newRawIndex += 8;
   }

   fprintf(stderr, "NEW DATA: %p through %p\n", newDataBase, newDataBase + newDataSize);

   if (!reg->setPtrToRawData(newRaw, newDataSize)) {
      fprintf(stderr, "Unable to assign new data section.\n");
      exit(EXIT_FAILURE);
   }

}
开发者ID:AmesianX,项目名称:memz,代码行数:49,代码来源:DataRewriter.cpp

示例7:

void CameraParameters::AdditionalCalibrationInformation::addSettingsToList(
    VarList& list) {
  for (int i = 0; i < kNumControlPoints; ++i) {
    list.addChild(control_point_set[i]);
  }

  list.addChild(initial_distortion);
  list.addChild(camera_height);
  list.addChild(line_search_corridor_width);
  list.addChild(image_boundary);
  list.addChild(max_feature_distance);
  list.addChild(convergence_timeout);
  list.addChild(cov_corner_x);
  list.addChild(cov_corner_y);
  list.addChild(cov_ls_x);
  list.addChild(cov_ls_y);
  list.addChild(pointSeparation);
}
开发者ID:AnthonyCAS,项目名称:ssl-vision,代码行数:18,代码来源:camera_calibration.cpp

示例8: test_varlist

void test_varlist()
{
	VarList args;	
	args.add(1);
	args.add("ddddd");
	args.add(true);
	printf("args count: %d\n", args.count());
	printf("args 0: %d\n", args.get(0).toInt());
	printf("args 1: %s\n", args.get(1).toString());
	printf("args 2: %s\n", args.get(2).toBool() ? "true" : "false");
}
开发者ID:wgq168668,项目名称:misc,代码行数:11,代码来源:main.cpp

示例9: call

Variable FunctionCheckInit::call( Variable &input, VarList lParams ) {
	VarList::const_iterator i = lParams.begin();
	
	// Fetch values
	Bu::String what = (*i).getString();
	
	// Lets check stuff!
	pContext->getView()->checkBegin(what);
	
	return new Variable(Variable::typeNone);
}
开发者ID:IngwiePhoenix,项目名称:IceTea_old,代码行数:11,代码来源:functioncheckinit.cpp

示例10: call

Variable FunctionTargets::call( Variable &/*input*/, VarList lParams )
{
    Variable vRet( Variable::typeList );
    TargetList lTrg;
    if( lParams.getSize() == 0 )
    {
        lTrg = pContext->getExplicitTargets();
    }
    else
    {
        lTrg = pContext->getTag( lParams.first().toString() );
    }
    for( TargetList::const_iterator i = lTrg.begin(); i; i++ )
    {
        for( StrList::const_iterator j = (*i)->getOutputList().begin(); j; j++ )
        {
            vRet.append( *j );
        }
    }
    return vRet;
}
开发者ID:IngwiePhoenix,项目名称:IceTea_old,代码行数:21,代码来源:functiontargets.cpp

示例11: GetString

	//------------------------------------------------------------------------
	wstring StringParser::GetString( const string& key, const VarList& args, bool returnKeyIfFailed/*=true*/ )
	{
		StringParser::StringItem* item = m_StringItems.GetStringItemById( key );
		if( item == 0 )
		{
			_LogError( string("StringParser::GetString Error : ") + key + " ²»´æÔÚ" );
			if( returnKeyIfFailed )
				return We::Type::ToWstring( key );
			return L"";
		}
		if( item->m_Texts.size() != args.Size() + 1 )
		{
			_LogError( string("StringParser::GetString Error : ") + key + " ²ÎÊý¸öÊý²»Æ¥Åä" );
			if( returnKeyIfFailed )
				return We::Type::ToWstring( key );
			return L"";
		}
		wstring ret = item->m_Texts[0];
		for( int i=0; i<args.Size(); ++i )
			ret += args.GetValue( item->m_Indexes[i]-1 ).ForceToWstring() + item->m_Texts[i+1];
		return ret;
	}
开发者ID:xpisceo,项目名称:hobbyDemo,代码行数:23,代码来源:WeStringParser.cpp

示例12: while

    ~File( void )
    {
        if ( m_file ) delete m_file;

        DimList::iterator dim = m_dims.begin();
        DimList::const_iterator last_dim = m_dims.end();
        while ( dim != last_dim )
        {
            if ( *dim ) delete *dim;
            dim++;
        }
        m_dims.clear();

        VarList::iterator var = m_vars.begin();
        VarList::const_iterator last_var = m_vars.end();
        while ( var != last_var )
        {
            if ( *var ) delete *var;
            var++;
        }
        m_vars.clear();
    }
开发者ID:zkbreeze,项目名称:OceanVis,代码行数:22,代码来源:main.cpp

示例13: addSettingsToList

void CameraParameters::addSettingsToList(VarList& list) {
  list.addChild(focal_length);
  list.addChild(principal_point_x);
  list.addChild(principal_point_y);
  list.addChild(distortion);
  list.addChild(q0);
  list.addChild(q1);
  list.addChild(q2);
  list.addChild(q3);
  list.addChild(tx);
  list.addChild(ty);
  list.addChild(tz);
}
开发者ID:AnthonyCAS,项目名称:ssl-vision,代码行数:13,代码来源:camera_calibration.cpp

示例14: setupUi

MainWindow::MainWindow(bool start_capture, bool enforce_affinity)
{

  affinity=0;
  if (enforce_affinity) affinity=new AffinityManager();
  //opt=new GetOpt();
  settings=0;
  setupUi((QMainWindow *)this);

  tree_view=new VarTreeView();
  tmodel=new VarTreeModel();

  splitter = new QSplitter(Qt::Horizontal,this);
  splitter2 = new QSplitter(Qt::Vertical);

  root=new VarList("Vision System");

  opts=new RenderOptions();
  right_tab=0;

  QString stack_id="";

  //opt->addArgument("stack",&stack_id);
  //opt->parse();

  //load RoboCup SSL stack by default:
  multi_stack=new MultiStackRoboCupSSL(opts, 2);

  VarExternal * stackvar;
  root->addChild(stackvar= new VarExternal((multi_stack->getSettingsFileName() + ".xml").c_str(),multi_stack->getName()));
  stackvar->addChild(multi_stack->getSettings());
  //create tabs, GL visualizations and tool-panes for each capture thread in the multi-stack:
  for (unsigned int i=0;i<multi_stack->threads.size();i++) {
    VisionStack * s = multi_stack->threads[i]->getStack();
    if (affinity!=0) multi_stack->threads[i]->setAffinityManager(affinity);

    GLWidget * gl=new GLWidget(0,false);
    gl->setRingBuffer(multi_stack->threads[i]->getFrameBuffer());
    gl->setVisionStack(s);
    QString label = "Camera " + QString::number(i);

    VarList * threadvar = new VarList(label.toStdString());

    threadvar->addChild(s->getSettings());
    //iterate through plugin variables

    QSplitter * stack_widget = new QSplitter(Qt::Horizontal);
    stack_widgets.push_back(stack_widget);
    QSplitter * stack_vis_splitter = new QSplitter(Qt::Vertical);
    stack_widget->addWidget(stack_vis_splitter);
    QTabWidget * stack_control_tab = new QTabWidget();
    stack_control_tab->setTabPosition(QTabWidget::East);
    stack_widget->addWidget(stack_control_tab);

    VideoWidget * w=new VideoWidget(label,gl);
    display_widgets.push_back(gl);
    threadvar->addChild(multi_stack->threads[i]->getSettings());

    stack_vis_splitter->addWidget(w);
    //iterate through all plugins
    unsigned int n=s->stack.size();
    for (unsigned int j=0;j<n;j++) {
      VisionPlugin * p=s->stack[j];
      if (p->isSharedAmongStacks()) {
        if (i==0) {
          //this is a shared global plugin...
          //add it to global pane
          if (p->getSettings()!=0) stackvar->addChild(p->getSettings());

          QWidget * tmp_control = p->getControlWidget();
          if (tmp_control!=0) {
            if (right_tab==0) {
              right_tab=new QTabWidget();
              right_tab->setTabPosition(QTabWidget::East);
            }
            right_tab->addTab(tmp_control,QString::fromStdString(p->getName()));
          }
        
          QWidget * tmp_vis = p->getVisualizationWidget();
          if (tmp_vis!=0) splitter2->addWidget(tmp_vis);
        }
      
      } else {
        if (p->getSettings()!=0) threadvar->addChild(p->getSettings());
        //this is a local plugin relating only to a single thread
        //add it to the context.
        QWidget * tmp_control = p->getControlWidget();
        if (tmp_control!=0) stack_control_tab->addTab(tmp_control,QString::fromStdString(p->getName()));
      
        QWidget * tmp_vis = p->getVisualizationWidget();
        if (tmp_vis!=0) stack_vis_splitter->addWidget(tmp_vis);
      }
    }
    stackvar->addChild(threadvar);

    splitter2->addWidget(stack_widget);
  }
  
  if (affinity!=0) affinity->demandCore(multi_stack->threads.size());

//.........这里部分代码省略.........
开发者ID:EjaadTech,项目名称:ssl-vision,代码行数:101,代码来源:mainwindow.cpp

示例15: ParseBool

void ParseBool(char *buffer)
{
string VarName="";
// skip boool 
int i=5;
while(buffer[i]!= '=')
	VarName+=buffer[i++];
// add to the global list
GlobalVar v(VarName,GlobalIndex,line);
GlobalList.push_back(v);
CheckForDuplicateVarNames();
GlobalIndex++;
// now get the variable value up to the ; token
// skip = sign
i++;
VarName="";
while(buffer[i]!= ';')
	VarName+=buffer[i++];
bool vf;
if(VarName == "true")
	vf=true;
else if(VarName == "false")
	vf=false;
else
	{
	cout <<"***************ERROR IN COMPILATION**********************"<<endl;
	cout <<" Error in compilation line :"<<line<<endl;
	cout <<" bool data type must be initialised as either true or false "<<endl;
	cout << "****************** COMPILATION FAILED EXITING ***********"<<endl;
	exit(0);
	}
VarObj Vo(vf);
Globals.Add(Vo);
}
开发者ID:NCCA,项目名称:NGL6Demos,代码行数:34,代码来源:ParseVariables.cpp


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