public method IO2GEachRowListener.onEachRow
Brief
Processes iteration through rows of a table.
Declaration | ||||
|
Parameters | |
rowID |
The identifier of a row. The parameter has the value of the row identifier for a specific trading table. For example, for the Accounts table, it has the value of the AccountID field. The complete list of the identifiers is shown below. |
rowData |
The object representing a row of a table. In order to process the parameter, you need to know what table it belongs to. It can be accomplished by calling
the |
Details
Table name |
|
Cast |
Casting syntax |
AccountID |
|
||
OfferID |
|
||
TradeID |
|
||
TradeID |
|
||
OrderID |
|
||
MsgID |
|
||
OfferID |
|
To get notifications about iteration through each row of a specific table, an instance of the class implementing
the IO2GEachRowListener
interface must be passed to the O2GTable
.forEachRow
method as an argument.
For example, if you want to get notifications about iteration through the rows of the Trades table, write the following line:
tradesTable.forEachRow(forEachListener);
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.
For the method implementation details, see the example below.
Example
Process iteration through the rows of the Trades table [hide]
void Work() { //... session.useTableManager(O2GTableManagerMode.Yes, null); session.login(sUserID, sPassword, sURL, sConnection); //... //get table manager and wait for the end of loading for all tables O2GTableManager tableMgr = session.getTableManager(); O2GTableManagerStatus managerStatus = tableMgr.getStatus(); while (managerStatus == O2GTableManagerStatus.TablesLoading) { Thread.Sleep(50); managerStatus = tableMgr.getStatus(); } if (managerStatus == O2GTableManagerStatus.TablesLoaded) { O2GTable ordersTable = tableMgr.getTable(O2GTableType.Orders); EachRowListener eachRowListener = new EachRowListener(); ordersTable.forEachRow(eachRowListener); } } class EachRowListener : IO2GEachRowListener { public void onEachRow(string rowID, O2GRow rowData) { O2GOrderTableRow orderTableRow = (O2GOrderTableRow)rowData; Console.WriteLine("OrderID={0}; AccountID={1}; Type={2}; Status={3}; OfferID={4}; Amount={5}; BuySell={6}; Rate={7}; Stop={8}; Limit={9}", sOrderID, orderTableRow.AccountID, orderTableRow.Type, orderTableRow.Status, orderTableRow.OfferID, orderTableRow.Amount, orderTableRow.BuySell, orderTableRow.Rate, orderTableRow.Stop, orderTableRow.Limit); } }
The type defined in the fxcore2.dll
assembly.
The namespace is fxcore2
.
Declared in IO2GEachRowListener