public method IO2GAccountsTable.getNextRowByColumnValues

Brief

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

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

Parameters
columnName

The name of a column in the Accounts table. For example, AccountKind.

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 Accounts table for trading accounts or manager accounts, the columnName parameter value is AccountKind, the columnValue parameter value is an array of 32 and 36, 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 trading accounts or manager accounts from the Accounts table [hide]

    O2G2Ptr<IO2GAccountsTable> accountsTable = (IO2GAccountsTable *)tableManager->getTable(Accounts);
    bool found = false;
    IO2GTableIterator iterator;
    IO2GAccountTableRow *account = NULL;
    const void *columnValues[] = {(void *)"32", (void *)"36"};
    while(accountsTable->getNextRowByColumnValues("AccountKind", 2, 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 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 IO2GAccountsTable

back