public method IO2GOrdersTable.findRow

Brief

Finds a row in the IO2GOrdersTable by OrderID.

Declaration
C++
virtual bool  findRow (const char * id, IO2GOrderTableRow *& row) = 0

Parameters
id

The unique identification number of an order. The number is unique within the same database that stores the account the order is placed on. For example, MINIDEMO or U100D1. The uniqueness of the order itself is ensured by the combination of the database ID and the value of this parameter.

row

[out] The row fetched.

Details

If the row is not found, the method returns false.

Example

Find order by OrderID [hide]

    O2G2Ptr<IO2GOrdersTable> ordersTable = (IO2GOrdersTable *)tableManager->getTable(Orders);
    IO2GOrderTableRow *order = NULL;
    if (ordersTable->findRow(mOrderID.c_str(), order))
    {
        std::cout << "OrderID: " << order->getOrderID() <<
                     " Amount = " << order->getAmount() <<
                     " BuySell = " << order->getBuySell() << std::endl;
        order->release();
    }

Note: The returned row contains the current values of fields. The values are not automatically updated. To monitor changes, use IO2GTableListener.onChanged. The row interface is thread-safe. One can use the returned row in different threads without synchronization.

Declared in IO2GOrdersTable

back