public method IO2GOrdersTable.getNextRowByColumnValues

Brief

Gets the next row from IO2GOrdersTable based on any of the column values.

Declaration
C++
virtual bool  getNextRowByColumnValues (const char *columnName, const int valueCount, const void *columnValues[], IO2GTableIterator &iterator, IO2GOrderTableRow *&row) = 0

Parameters
columnName

The name of a column in the Orders table. For example, RequestID.

valueCount

Number of values of the column.

columnValues

The values of the column specified by the columnName parameter. For example, if you want to search the Orders table for limit and stop orders only, the columnName parameter value is Type, the columnValues parameter value is an array of L and S, the valueCount parameter value is 2.

iterator

The table iterator.

row

[out] The row fetched.

Details

This method allows finding all rows that contain any of the specified column values.
If the row is not found, the method returns false.

Example

Get limit and stop orders [hide]

    O2G2Ptr<IO2GOrdersTable> ordersTable = (IO2GOrdersTable *)tableManager->getTable(Orders);
    bool found = false;
    IO2GTableIterator iterator;
    IO2GOrderTableRow *order = NULL;
    const void *columnValues[] = {(void *)"L", (void *)"S"};
    while (ordersTable->getNextRowByColumnValues("Type", 2, columnValues, iterator, order))
    {
        found = true;
        std::cout << "OrderID: " << order->getOrderID() <<
                     " Amount = " << order->getAmount() <<
                     " BuySell = " << order->getBuySell() <<
                     " Type = " << order->getType() << std::endl;
        order->release();
    }
    if (!found)
        std::cout << "No orders match specified Type." << std::endl;

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 IO2GOrdersTable

back