public method IO2GOrdersTable.getNextRowByColumnValue

Brief

Gets the next row from IO2GOrdersTable based on the column value.

Declaration
C++
virtual bool  getNextRowByColumnValue (const char *columnID, const void *columnValueAsVariant, IO2GTableIterator &iterator, IO2GOrderTableRow *&row) = 0

Parameters
columnID

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

columnValueAsVariant

The value of the column specified by the columnId parameter. For example, if you created an entry order with attached stop/limit orders, all orders must have the same RequestID. If you want to search the Orders table for these orders only, the columnId parameter value is RequestID, the columnValue parameter value is obtained by calling the IO2GRequest.getRequestID method.

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 orders with the same RequestID from the Orders table [hide]

    O2G2Ptr<IO2GOrdersTable> ordersTable = (IO2GOrdersTable *)tableManager->getTable(Orders);
    bool found = false;
    IO2GTableIterator iterator;
    IO2GOrderTableRow *order = NULL;
    while (ordersTable->getNextRowByColumnValue("RequestID", mRequestID.c_str(), 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 your RequestID." << 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