本文整理汇总了C++中statement类的典型用法代码示例。如果您正苦于以下问题:C++ statement类的具体用法?C++ statement怎么用?C++ statement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了statement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: bind
static void bind(statement& st, ColOrName col_or_name, const std::unique_ptr<T>& v)
{
if (v)
st.bind(col_or_name, *v);
else
st.bind(col_or_name, null);
}
开发者ID:shuffle-c,项目名称:edba,代码行数:7,代码来源:std_unique_ptr.hpp
示例2:
inline
bool
operator == (statement const & _lhs, statement const & _rhs)
{
if (_lhs.which() != _rhs.which()) {
return false;
}
if (!(*_lhs == *_rhs)) {
return false;
}
return true;
}
开发者ID:tomilov,项目名称:insituc,代码行数:12,代码来源:compare.hpp
示例3: execute_vector_inplace_sub_vector
/** @brief Deals with x = y for a vector y */
void execute_vector_inplace_sub_vector(statement const & s)
{
typedef typename statement::container_type StatementContainer;
StatementContainer const & expr = s.array();
if (expr[0].lhs_type_ == VECTOR_FLOAT_TYPE && expr[0].rhs_type_ == VECTOR_FLOAT_TYPE)
{
viennacl::vector_base<float> & x = *(expr[0].lhs_.vector_float_);
viennacl::vector_base<float> const & y = *(expr[0].rhs_.vector_float_);
viennacl::linalg::avbv(x,
x, 1.0, 1, false, false,
y, -1.0, 1, false, false);
}
else if (expr[0].lhs_type_ == VECTOR_DOUBLE_TYPE && expr[0].rhs_type_ == VECTOR_DOUBLE_TYPE)
{
viennacl::vector_base<double> & x = *(expr[0].lhs_.vector_double_);
viennacl::vector_base<double> const & y = *(expr[0].rhs_.vector_double_);
viennacl::linalg::avbv(x,
x, 1.0, 1, false, false,
y, -1.0, 1, false, false);
}
else
throw "not yet supported!";
}
开发者ID:rollingstone,项目名称:viennamos-dev,代码行数:26,代码来源:execute_vector_inplace_sub.hpp
示例4: execute_matrix_col_inplace_sub_matrix
/** @brief Deals with A -= B for a matrix B */
inline void execute_matrix_col_inplace_sub_matrix(statement const & s)
{
typedef statement::container_type StatementContainer;
StatementContainer const & expr = s.array();
if (expr[0].lhs_type_ == MATRIX_COL_FLOAT_TYPE && expr[0].rhs_type_ == MATRIX_COL_FLOAT_TYPE)
{
viennacl::matrix_base<float, viennacl::column_major> & A = *(expr[0].lhs_.matrix_col_float_);
viennacl::matrix_base<float, viennacl::column_major> const & B = *(expr[0].rhs_.matrix_col_float_);
viennacl::linalg::ambm(A,
A, 1.0, 1, false, false,
B, -1.0, 1, false, false);
}
else if (expr[0].lhs_type_ == MATRIX_COL_DOUBLE_TYPE && expr[0].rhs_type_ == MATRIX_COL_DOUBLE_TYPE)
{
viennacl::matrix_base<double, viennacl::column_major> & A = *(expr[0].lhs_.matrix_col_double_);
viennacl::matrix_base<double, viennacl::column_major> const & B = *(expr[0].rhs_.matrix_col_double_);
viennacl::linalg::ambm(A,
A, 1.0, 1, false, false,
B, -1.0, 1, false, false);
}
else
throw "not yet supported!";
}
开发者ID:bollig,项目名称:viennacl-dev,代码行数:26,代码来源:execute_matrix_col_inplace_sub.hpp
示例5: do_bind
void do_bind(statement& st, int)
{
if ( this->pos_ < 0 )
{
this->pos_ = st.column_index(this->name_);
}
}
开发者ID:huangqinjin,项目名称:sqlitepp,代码行数:7,代码来源:into.hpp
示例6:
bool branch::operator==(statement const& o) const {
bool is_equal = false;
statement_visitor v;
v._([&](branch const* o) {
is_equal = this->hint == o->hint && *this->target == *o->target;
});
o.accept(v);
return is_equal;
}
开发者ID:tizmd,项目名称:gdsl-toolkit,代码行数:9,代码来源:branch.cpp
示例7:
bool store::operator==(statement const& o) const {
bool is_equal = false;
statement_visitor v;
v._([&](store const* o) {
is_equal = this->size == o->size && *this->address_ == *o->address_ &&
*this->rhs == *o->rhs;
});
o.accept(v);
return is_equal;
}
开发者ID:tizmd,项目名称:gdsl-toolkit,代码行数:10,代码来源:store.cpp
示例8: execute_vector_assign
/** @brief Generic dispatcher */
void execute_vector_assign(statement const & s)
{
typedef typename statement::container_type StatementContainer;
StatementContainer const & expr = s.array();
switch (expr[0].rhs_type_family_)
{
case COMPOSITE_OPERATION_FAMILY:
execute_vector_assign_composite(s);
break;
case VECTOR_TYPE_FAMILY:
execute_vector_assign_vector(s);
break;
default:
throw "invalid rvalue in vector assignment";
}
}
开发者ID:rollingstone,项目名称:viennamos-dev,代码行数:19,代码来源:execute_vector_assign.hpp
示例9: execute_matrix_col_inplace_sub
/** @brief Generic dispatcher */
inline void execute_matrix_col_inplace_sub(statement const & s)
{
typedef statement::container_type StatementContainer;
StatementContainer const & expr = s.array();
switch (expr[0].rhs_type_family_)
{
case COMPOSITE_OPERATION_FAMILY:
execute_matrix_col_inplace_sub_composite(s);
break;
case MATRIX_COL_TYPE_FAMILY:
execute_matrix_col_inplace_sub_matrix(s);
break;
default:
throw "invalid rvalue in vector assignment";
}
}
开发者ID:bollig,项目名称:viennacl-dev,代码行数:19,代码来源:execute_matrix_col_inplace_sub.hpp
示例10: switch
QString toSQLParse::indentStatement(statement &stat, int level/*SQLITEMAN, toSyntaxAnalyzer &syntax*/)
{
QString ret;
switch (stat.Type)
{
default:
{
QMessageBox::warning(QApplication::activeWindow(), "Sqliteman",
"toSQLparse: Internal error in toSQLParse, should never get here");
}
case statement::Block:
{
ret = IndentComment(level, 0, stat.Comment, false);
int exc = 0;
for (std::list<toSQLParse::statement>::iterator i = stat.subTokens().begin();
i != stat.subTokens().end();
i++)
{
int add
= 0;
std::list<toSQLParse::statement>::iterator j = i;
j++;
if (i != stat.subTokens().begin() &&
j != stat.subTokens().end())
add
= Settings.IndentLevel;
else
exc = 0;
QString t;
if ((*i).subTokens().begin() != (*i).subTokens().
end())
t = (*(*i).subTokens().begin()).String.toUpper();
if (t == ("BEGIN") || t == ("WHEN") || t == ("ELSE") || t == ("ELSIF"))
add
= 0;
if ((*i).Type == statement::List)
ret += indentString(level + add
+ exc);
ret += indentStatement(*i, level + add
+ exc/*SQLITEMAN , syntax*/);
if ((*i).Type == statement::List)
{
int i;
for (i = ret.length() - 1;i >= 0 && ret[i].isSpace();i--)
;
ret = ret.mid(0, std::max(i + 1, 0));
ret += ("\n");
ret += indentString(level + exc);
}
if (t == ("EXCEPTION"))
exc = Settings.IndentLevel * 2;
}
if (Settings.EndBlockNewline && level != 0)
ret += ("\n");
}
break;
case statement::List:
case statement::Statement:
int maxlev = 0;
int maxlevorig = 0;
bool useMaxLev = false;
bool any = true;
int current;
bool first;
bool noKeyBreak = false;
bool lineList = false;
QString comment;
if (stat.Type == statement::Statement)
{
ret = IndentComment(level, 0, stat.Comment, false);
useMaxLev = true;
first = true;
current = 0;
}
else
{
for (std::list<toSQLParse::statement>::iterator i = stat.subTokens().begin();
i != stat.subTokens().end();)
{
if ((*i).Type != statement::Keyword)
noKeyBreak = true;
else
useMaxLev = true;
break;
}
current = level;
first = true;
}
if (useMaxLev)
{
int count = 0;
for (std::list<toSQLParse::statement>::iterator i = stat.subTokens().begin();
i != stat.subTokens().end();
i++)
{
if (any)
{
QString upp = (*i).String.toUpper();
//.........这里部分代码省略.........
开发者ID:MatiasNAmendola,项目名称:sqliteman,代码行数:101,代码来源:tosqlparse.cpp
示例11: bind
static void bind(statement& st, ColOrName col_or_name, const boost::posix_time::ptime& v)
{
st.bind(col_or_name, boost::posix_time::to_tm(v));
}
开发者ID:shuffle-c,项目名称:edba,代码行数:4,代码来源:boost_posix_time_ptime.hpp
示例12: visit
void statement_visitor::visit(statement &statement)
{
statement.visit(*this);
}
开发者ID:zneak,项目名称:interpiler,代码行数:4,代码来源:parse.cpp
示例13: execute_vector_assign_composite
/** @brief Deals with x = RHS where RHS is a vector expression */
void execute_vector_assign_composite(statement const & s)
{
typename statement::container_type const & expr = s.array();
if (expr[1].op_type_ == OPERATION_BINARY_ADD_TYPE)
{
if (expr[0].lhs_type_ == VECTOR_FLOAT_TYPE
&& expr[1].lhs_type_ == VECTOR_FLOAT_TYPE
&& expr[1].rhs_type_ == VECTOR_FLOAT_TYPE)
{
viennacl::vector_base<float> & x = *(expr[0].lhs_.vector_float_);
viennacl::vector_base<float> const & y = *(expr[1].lhs_.vector_float_);
viennacl::vector_base<float> const & z = *(expr[1].rhs_.vector_float_);
viennacl::linalg::avbv(x,
y, 1.0, 1, false, false,
z, 1.0, 1, false, false);
}
else if (expr[0].lhs_type_ == VECTOR_DOUBLE_TYPE
&& expr[1].lhs_type_ == VECTOR_DOUBLE_TYPE
&& expr[1].rhs_type_ == VECTOR_DOUBLE_TYPE)
{
viennacl::vector_base<double> & x = *(expr[0].lhs_.vector_double_);
viennacl::vector_base<double> const & y = *(expr[1].lhs_.vector_double_);
viennacl::vector_base<double> const & z = *(expr[1].rhs_.vector_double_);
viennacl::linalg::avbv(x,
y, 1.0, 1, false, false,
z, 1.0, 1, false, false);
}
else
throw "TODO";
}
else if (expr[1].op_type_ == OPERATION_BINARY_SUB_TYPE)
{
if (expr[0].lhs_type_ == VECTOR_FLOAT_TYPE
&& expr[1].lhs_type_ == VECTOR_FLOAT_TYPE
&& expr[1].rhs_type_ == VECTOR_FLOAT_TYPE)
{
viennacl::vector_base<float> & x = *(expr[0].lhs_.vector_float_);
viennacl::vector_base<float> const & y = *(expr[1].lhs_.vector_float_);
viennacl::vector_base<float> const & z = *(expr[1].rhs_.vector_float_);
viennacl::linalg::avbv(x,
y, 1.0, 1, false, false,
z, -1.0, 1, false, false);
}
else if (expr[0].lhs_type_ == VECTOR_DOUBLE_TYPE
&& expr[1].lhs_type_ == VECTOR_DOUBLE_TYPE
&& expr[1].rhs_type_ == VECTOR_DOUBLE_TYPE)
{
viennacl::vector_base<double> & x = *(expr[0].lhs_.vector_double_);
viennacl::vector_base<double> const & y = *(expr[1].lhs_.vector_double_);
viennacl::vector_base<double> const & z = *(expr[1].rhs_.vector_double_);
viennacl::linalg::avbv(x,
y, 1.0, 1, false, false,
z, -1.0, 1, false, false);
}
else
throw "TODO";
}
else
throw "TODO";
}
开发者ID:rollingstone,项目名称:viennamos-dev,代码行数:62,代码来源:execute_vector_assign.hpp
示例14: do_bind
void do_bind(statement& st, int)
{
st.use_value(st.use_pos(this->name_), converter<T>::from(this->value_));
}
开发者ID:Fadis,项目名称:SQLitepp_CMake,代码行数:4,代码来源:use.hpp
示例15: do_update
void do_update(statement& st)
{
typename converter<T>::base_type t;
st.column_value(this->pos_, t);
this->value_ = converter<T>::to(t);
}
开发者ID:huangqinjin,项目名称:sqlitepp,代码行数:6,代码来源:into.hpp
注:本文中的statement类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论