本文整理汇总了C++中OrderList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ OrderList::push_back方法的具体用法?C++ OrderList::push_back怎么用?C++ OrderList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderList
的用法示例。
在下文中一共展示了OrderList::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
void JSONObject::write(std::ostream& str, WriteVisitor& visitor)
{
OrderList defaultOrder;
defaultOrder.push_back("UniqueID");
defaultOrder.push_back("Name");
defaultOrder.push_back("TargetName");
writeOrder(str, defaultOrder, visitor);
}
示例2: getOrders
OrderList PgsqlDataProvider::getOrders(OrderType type, string methodName, uint32_t stockId)
{
OrderList orderList;
nontransaction command(*conn);
string query = "SELECT id, broker_id, stock_id, amount, price FROM " + methodName + "(" + to_string(stockId) + ");";
result queryResult(command.exec(query));
if (verbose)
cout << "Result of " << query << ": " << endl;
ResultIterator endIterator = queryResult.end();
for (ResultIterator iterator = queryResult.begin(); iterator != endIterator; ++iterator)
{
Order order;
order.setId(iterator[0].as<uint64_t>());
order.setType(type);
order.setBrokerId(iterator[1].as<uint32_t>());
order.setStockId(iterator[2].as<uint32_t>());
order.setAmount(iterator[3].as<uint32_t>());
order.setPrice(Decimal(iterator[4].as<string>()));
orderList.push_back(order);
}
if (verbose)
cout << orderList.size() << " orders. " << endl;
return orderList;
}