[Quickfix-developers] Fwd: weird code
Brought to you by:
orenmnero
From: Shane T. <str...@co...> - 2008-03-05 22:19:29
|
Azmat, According to the documentation on how to get groups that you posted in the first email: If you notice, you use message.getGroup(1, group) to insert the first group of "message" into the "group" object. Then you can utilize "group" to pull out the pieces of information. For example: // Create group holder object. QuickFix42.MarketDataSnapshotFullRefresh.NoMDEntries group = new QuickFix42.MarketDataSnapshotFullRefresh.NoMDEntries(); // From message, insert group data from the first group into "group" object. message.getGroup(1, group); // Create the objects we want to store the values in. QuickFix.MDEntryPx mdEntryPx = new QuickFix.MDEntryPx(); QuickFix.MDEntryType mdEntryType = new QuickFix.MDEntryType(); // Insert the group values into the holder objects. group.get(mdEntryType); group.get(mdEntryPx); Now mdEntryType will contain the type of the first group, and mdEntryPx will contain the price of the first group. Now you can test the types using standard QuickFIX types: switch (mdEntryType.getValue()) { case QuickFix.MDEntryType.BID: bidPrice = mdEntryPx.getValue(); break; case QuickFix.MDEntryType.OFFER: offerPrice = mdEntryPx.getValue(); break; } -- Shane Trotter Connamara Systems, LLC |