public method IO2GTradesTable.getNextRowByColumnValue
Brief
Gets the next row from IO2GTradesTable based on the column value.
| Declaration | ||||
|
||||
| Parameters | |
columnID |
The name of a column in the Trades table. For example, |
columnValueAsVariant |
The value of the column specified by the |
iterator |
The table iterator. |
row |
[out] The row fetched. |
Details
This method allows finding all rows that contain the specified column value.
If the row is not found, the method returns false.
Example
Get open positions in EUR/USD from the Trades table [hide]
O2G2Ptr<IO2GTradesTable> tradesTable = (IO2GTradesTable *)tableManager->getTable(Trades);
bool found = false;
IO2GTableIterator iterator;
IO2GTradeTableRow *trade = NULL;
while (tradesTable->getNextRowByColumnValue("OfferID", "1", iterator, trade))
{
found = true;
std::cout << "TradeID: " << trade->getTradeID() <<
" OfferID = " << trade->getOfferID() <<
" Amount = " << trade->getAmount() << std::endl;
trade->release();
}
if (!found)
std::cout << "You don't have any open positions in EUR/USD instrument.");
Note: The returned row contains the current column values. The values are not automatically updated. To monitor
changes, use IO2GTableListener.onChanged.
The row interface is thread-safe. The returned row can be used in different threads without synchronization.
Declared in IO2GTradesTable