本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
}
}
}
示例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());
}
示例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;
}
示例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();
// }
}
示例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 );
}
}