本文整理汇总了C++中Split::setTransferAccount方法的典型用法代码示例。如果您正苦于以下问题:C++ Split::setTransferAccount方法的具体用法?C++ Split::setTransferAccount怎么用?C++ Split::setTransferAccount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Split
的用法示例。
在下文中一共展示了Split::setTransferAccount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stmt
// Returns a vector of Splits.
bool
QuasarDB::select(vector<Split>& splits, const SplitSelect& conditions)
{
splits.clear();
QString cmd = gltxCmd("split", "split_id", "account_id,"
"split.amount,transfer_id", conditions);
Statement stmt(connection(), cmd);
if (!execute(stmt)) return false;
while (stmt.next()) {
Split split;
int next = 1;
selectData(split, stmt, next);
selectGltx(split, stmt, next);
split.setAccountId(stmtGetId(stmt, next++));
split.setAmount(stmtGetFixed(stmt, next++));
split.setTransferAccount(stmtGetId(stmt, next++));
splits.push_back(split);
}
QString cmd1 = "select store_id,amount from split_alloc where "
"split_id = ? order by seq_num";
Statement stmt1(connection(), cmd1);
for (unsigned int i = 0; i < splits.size(); ++i) {
Id gltx_id = splits[i].id();
GLTX_ACCOUNTS(splits);
stmtSetId(stmt1, gltx_id);
if (!execute(stmt1)) return false;
while (stmt1.next()) {
AllocLine line;
line.store_id = stmtGetId(stmt1, 1);
line.amount = stmtGetFixed(stmt1, 2);
splits[i].allocations().push_back(line);
}
}
commit();
return true;
}