public method IO2GAccountsTable.getNextRowByMultiColumnValues

Brief

Gets the next row from IO2GAccountsTable based on the multiple columns values.

Declaration
C++
virtual bool  getNextRowByMultiColumnValues (const int columnCount, const char *columnNames[], const void *columnValues[], IO2GTableIterator &iterator, IO2GAccountTableRow *&row) = 0

Parameters
columnCount

Number of columns in which the search is to be performed.

columnNames

The array of column names in the Accounts table. For example, AccountKind, AccountID.

columnValues

The array of values of the columns specified by the columnNames parameter. For example, if you want to search the Accounts table for trading accounts without a margin call flag, the columnNames parameter value is an array of AccountKind and MarginCallFlag, the columnValues parameter is an array of 32 and N, the columnCount parameter value is 2.

iterator

The table iterator.

row

[out] The row fetched.

Details

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

Example

Get trading accounts without the margin call flag from the Accounts table [hide]

    O2G2Ptr<IO2GAccountsTable> accountsTable = (IO2GAccountsTable *)tableManager->getTable(Accounts);
    bool found = false;
    IO2GTableIterator iterator;
    IO2GAccountTableRow *account = NULL;
    const char *columnNames[] = {"AccountKind", "MarginCallFlag"};
    const void *columnValues[] = {(void *)"32", (void *)"N"};
    while(accountsTable->getNextRowByMultiColumnValues(2, columnNames, columnValues, iterator, account))
    {
        found = true;
        std::cout << "AccountID: " << account->getAccountID() <<
                     " Equity = " << account->getEquity() <<
                     " UsableMargin = " << account->getUsableMargin() << std::endl;
        account->release();
    }
    if (!found)
        std::cout << "No accounts found." << std::endl;

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 IO2GAccountsTable

back