本文整理汇总了C++中Expression::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Expression::begin方法的具体用法?C++ Expression::begin怎么用?C++ Expression::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expression
的用法示例。
在下文中一共展示了Expression::begin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evalExpr
int SSIEngine::evalExpr(HttpSession *pSession, SubstItem *pItem)
{
int ret = 0;
if ((!pItem) || (pItem->getType() != REF_EXPR))
return 0;
Expression *pExpr = (Expression *)pItem->getAny();
ExprToken *pTok = pExpr->begin();
ret = evalOperator(pSession, pTok);
return ret;
}
示例2: addConstraints
/** Add a list of constraints from a string
* @param str :: A comma-separated list of constraint expressions.
* @param isDefault :: Flag to mark as default the value of an object associated with this reference.
*
*/
void IFunction::addConstraints(const std::string& str, bool isDefault)
{
Expression list;
list.parse(str);
list.toList();
for(auto expr = list.begin(); expr != list.end(); ++expr)
{
IConstraint* c = ConstraintFactory::Instance().createInitialized(this,*expr,isDefault);
this->addConstraint(c);
}
}
示例3: Expression
/// Copy constructor
Expression::Expression(const Expression& expr)
:m_namespace(expr.m_namespace),
m_object(expr.m_object),
m_name(expr.m_name),
m_op(expr.m_op),
m_operators(expr.m_operators)
{
for(const_iterator it = expr.begin();it!=expr.end();it++)
{
m_terms.push_back(boost::shared_ptr<Expression>(new Expression(**it)));
}
}
示例4: print_expression
void print_expression(Expression &expr)
{
LessConstant* pconst;
LessColor* pcolor;
cout<<"expression begin\n"<<endl;
for(auto iter = expr.begin(); iter != expr.end(); ++iter) {
switch(iter->type) {
case CONSTANT:
pconst = (LessConstant *)iter->data;
cout<<"constant:"<<pconst->val<<pconst->unit<<'\n'<<endl;
break;
case STRING:
cout<<"string:"<<*((string*)iter->data)<<"\n"<<endl;
break;
case COLOR:
cout<<"color:";
cout<<"r:"<<((LessColor *)iter->data)->r;
cout<<"g:"<<((LessColor *)iter->data)->g;
cout<<"b:"<<((LessColor *)iter->data)->b;
cout<<"\n"<<endl;
break;
case LEFT_BRACE:
cout<<"left brace\n"<<endl;
break;
case RIGHT_BRACE:
cout<<"right brace\n"<<endl;
break;
case OP_AT:
cout<<"operator @\n"<<endl;
break;
case OP_ADD:
cout<<"operator +\n"<<endl;
break;
case OP_NEG:
cout<<"operator negative\n"<<endl;
break;
case OP_SUB:
cout<<"operator sub\n"<<endl;
break;
case OP_MUL:
cout<<"operator *\n"<<endl;
break;
case OP_DIV:
cout<<"operator /\n"<<endl;
break;
default:
break;
}
}
cout<<"expression end\n"<<endl;
}
示例5: addTies
/**
* Add ties to the function.
* @param ties :: Comma-separated list of name=value pairs where name is a parameter name and value
* is a math expression tying the parameter to other parameters or a constant.
* @param isDefault :: Flag to mark as default the value of an object associated with this reference: a tie or a constraint.
*
*/
void IFunction::addTies(const std::string& ties, bool isDefault)
{
Expression list;
list.parse(ties);
list.toList();
for(auto t = list.begin(); t != list.end(); ++t)
{
if (t->name() == "=" && t->size() >= 2)
{
size_t n = t->size() - 1;
const std::string value = (*t)[n].str();
for( size_t i = n; i != 0; )
{
--i;
this->tie( (*t)[i].name(), value, isDefault );
}
}
}
}