public method IO2GTradesTable.getNextRowByMultiColumnValues
Brief
Gets the next row from IO2GTradesTable
based on the multiple columns values.
Declaration | ||||
|
Parameters | |
columnCount |
Number of columns in which the search is to be performed. |
columnNames |
The array of column names in the Trades table. |
columnValues |
The array of values of the columns specified by the |
iterator |
The table iterator. |
row |
[out] The row fetched. |
Details
If the row is not found, the method returns false
.
Example
Get open positions by specified AccountID
and OfferID
from the Trades table [hide]
O2G2Ptr<IO2GTradesTable> tradesTable = (IO2GTradesTable *)tableManager->getTable(Trades); bool found = false; IO2GTableIterator iterator; IO2GTradeTableRow *trade = NULL; const char *columnNames[] = {"AccountID", "OfferID"}; const void *columnValues[] = {(void *)"12345", (void *)"1"}; while (tradesTable->getNextRowByColumnValues(2, columnNames, columnValues, 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 by specified account and instrument.");
Note: The returned row contains the current columns 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