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


C++ VariableList::begin方法代码示例

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


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

示例1: whereClause

	virtual void whereClause (const WhereClause* const, const TableOperation* p_GroupGraphPattern, const BindingClause* p_BindingClause) {
	    ResultSet* joined(NULL);
	    const ResultSet* working = &rs;
	    if (p_BindingClause != NULL) {
		working = joined = new ResultSet(rs);
		p_BindingClause->bindVariables(NULL, joined);
	    }

	    vars.clear(); // probably got filled with e.g. select vars.
	    p_GroupGraphPattern->express(this);
	    const TableOperation* op = last.tableOperation;
	    const VariableList* knownVars = working->getKnownVars();
	    std::vector<const POS*> v(vars.size() + knownVars->size());
	    std::vector<const POS*>::iterator needed =
		std::set_intersection (vars.begin(), vars.end(), knownVars->begin(),
				       knownVars->end(), v.begin());
	    const std::set<const POS*> s(v.begin(), v.end());
	    const Expression* filter = working->getFederationExpression(s, false);
	    if (filter) {
		Filter* f = new Filter(op);
		f->addExpression(filter);
		op = f;
	    }

	    if (joined)
		delete joined;
	    last.whereClause = new WhereClause(op, NULL);
	}
开发者ID:RubenVerborgh,项目名称:SWObjects,代码行数:28,代码来源:ResultSet.cpp

示例2:

std::vector<FormalParameter> juli::Function::transformParameterList(VariableList args, const TypeInfo& typeInfo) {
	std::vector<FormalParameter> formalArguments;
	for (VariableList::iterator i = args.begin(); i != args.end(); ++i) {
		formalArguments.push_back(FormalParameter((*i)->type->resolve(typeInfo), (*i)->name->name));
	}
	return formalArguments;
}
开发者ID:widmoser,项目名称:juli,代码行数:7,代码来源:functions.cpp

示例3: calculateSignature

std::string NFunctionSignature::calculateSignature(const NType& returnType, const VariableList& arguments)
{
	std::string name = "fp-(";
	name += returnType.name + "-";
	for (VariableList::const_iterator i = arguments.begin(); i != arguments.end(); i++)
		name += (*i)->type.name + ",";
	name += ")";
	return name;
}
开发者ID:tyrel,项目名称:DCPUToolchain,代码行数:9,代码来源:NFunctionSignature.cpp

示例4: abstract_rates

void Location::abstract_rates(const VariableList &cvl, 
						       const Valuations &dvl, 
						       vector<int> &v_rates) const
{
    int pos = 0;
    for ( auto it = cvl.begin(); it != cvl.end(); it++, pos++) {
        auto x = *it;
	    for ( auto iit = rates.begin(); iit != rates.end(); iit++) {
	        if (x == iit->get_var()) {
                int r = iit->eval(dvl);
                v_rates[pos] = r;
                break;
            }
        }
    }

}
开发者ID:glipari,项目名称:forts,代码行数:17,代码来源:automaton.cpp

示例5: testVarParser

void testVarParser(char *buf)
{
    printf("===== Testing Variable parser ======\n");
//	time_t start = GetTickCount();
    VariableList li;
//	fflush(stdout);

    std::map<std::string, std::string> ignoreTokens;
    get_variables(buf, li, ignoreTokens, true);
//	time_t end = GetTickCount();
    for (VariableList::iterator iter = li.begin(); iter != li.end(); iter++) {
        Variable var = *iter;
        var.Print();
    }

//	printf("total time: %d\n", end-start);
    printf("matches found: %d\n", li.size());
}
开发者ID:Hmaal,项目名称:codelite,代码行数:18,代码来源:main.cpp

示例6: rates_to_Linear_Constraint

Linear_Constraint Location::rates_to_Linear_Constraint(const VariableList &cvl, 
						       const Valuations &dvl, 
						       VariableList &lvars) const
{
    Linear_Constraint lc;
    for ( auto const &x : cvl) {
	//string x = it->name;
	for ( auto iit = rates.begin(); iit != rates.end(); iit++) {
	    if (x == iit->get_var()) {
		PPL::Variable v = get_ppl_variable(cvl, x);
		Linear_Expr le = iit->to_Linear_Expr(cvl, dvl);
		AT_Constraint atc = (v==le);
		lc.insert(atc);
		for (auto lt = lvars.begin(); lt != lvars.end(); lt++)
		    if ( x == *lt) {
			lvars.erase(lt);
			break;
		    }
		break;
	    }
	}
    }
    return lc;
}
开发者ID:glipari,项目名称:forts,代码行数:24,代码来源:automaton.cpp

示例7: reset

// do not need to revise all variables because we assume soft AC already done
void VACExtension::reset()
{
    VACVariable *x;
    TreeDecomposition *td = wcsp->getTreeDec();
    clear();
    while (!queueP->empty())
        queueP->pop();
    while (!queueR->empty())
        queueR->pop();
    //  int bucket = cost2log2glb(ToulBar2::costThreshold);
    int bucket = cost2log2glb(itThreshold);
    if (bucket < 0)
        bucket = 0;
    for (; bucket < wcsp->getNCBucketSize(); bucket++) {
        VariableList *varlist = wcsp->getNCBucket(bucket);
        for (VariableList::iterator iter = varlist->begin();
                iter != varlist->end();) {
            x = (VACVariable *) * iter;
            if (x->unassigned() && (x->getMaxCost() >= itThreshold)) {
                if (td) {
                    if (td->
                            isActiveAndInCurrentClusterSubTree
                            (x->getCluster()))
                        x->queueVAC();
                } else
                    x->queueVAC();
            }
            ++iter;
        }
    }
    //   for (BTQueue::iterator it = VAC2.begin(); it != VAC2.end(); ++it) {
    //     x = (VACVariable*) (*it);
    //     if (td) { if(td->isActiveAndInCurrentClusterSubTree(x->getCluster())) x->queueVAC(); }
    //  else x->queueVAC();
    //   }
}
开发者ID:eomahony,项目名称:Numberjack,代码行数:37,代码来源:tb2vac.cpp

示例8: parse

void BashSupportPart::parse(const QString &fileName)
{
	QFileInfo fi(fileName);
	m_vars.clear();
	if (fi.extension() == "sh")
	{
		if( codeModel()->hasFile(fileName) ){
		    emit aboutToRemoveSourceInfo( fileName );
		    codeModel()->removeFile( codeModel()->fileByName(fileName) );
		}

		FileDom m_file = codeModel()->create<FileModel>();
		m_file->setName( fileName );

		m_vars.clear();
		QFile f(QFile::encodeName(fileName));
		if (!f.open(IO_ReadOnly))
			return;
		QString rawline;
		QString line;
		uint lineNo = 0;
		//KRegExp methodre("\\b([\\d\\w]+[\\s]*)\\([\\s]*\\)");
		QRegExp methodre("^\\s*(\\w+)\\s*\\(\\s*\\)");
		QRegExp varre( "^\\s*(\\w+)[=]" );
		QRegExp expvarre( "^export\\s*(\\w+)[=]" );
		QRegExp forvarre("\\bfor[\\s]+([\\d\\w]+)[\\s]+in[\\s]+");

		QTextStream stream(&f);
		while (!stream.atEnd())
		{
			 rawline = stream.readLine();
       			 line = rawline.stripWhiteSpace().local8Bit();
			 kdDebug() << "Trying line: " << line << endl;
			 if (methodre.search(line) != -1)
			 {
				FunctionDom method = codeModel()->create<FunctionModel>();
				method->setName(methodre.cap(1));
				method->setFileName(fileName);
				method->setStartPosition(lineNo, 0);

				if( !m_file->hasFunction(method->name()) ){
					kdDebug() << "Add global method " << method->name() << endl;
					m_file->addFunction( method );
				}
			}
			else if(varre.search(line) != -1)
			{
				addAttribute(varre.cap(1), m_file, lineNo);
			}
			else if(expvarre.search(line) != -1)
			{
				addAttribute(expvarre.cap(1), m_file, lineNo);
			}
			else if(forvarre.search(line) != -1)
			{
				addAttribute(forvarre.cap(1), m_file, lineNo);
			}
			++lineNo;
		}
		f.close();

		kdDebug() << "Trying to add list..." << endl;
		codeModel()->addFile( m_file );
		VariableList attrList = codeModel()->globalNamespace()->variableList();
		for (VariableList::Iterator it = attrList.begin(); it != attrList.end(); ++it)
		{
			kdDebug() << "Adding " << (*it)->name() << endl;
			m_vars.append((*it)->name());
		}
		m_cc->setVars(m_vars);

		codeModel()->addFile( m_file );
	}

}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:75,代码来源:bashsupport_part.cpp


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