Re: [Quickfix-users] bug in repeated group? or in my code?
Brought to you by:
orenmnero
From: Hei C. <str...@ya...> - 2009-07-14 00:03:06
|
Sorry, please discarded my message. The field didn't exist in the message. Sorry. ________________________________ From: Hei Chan <str...@ya...> To: qui...@li... Sent: Monday, July 13, 2009 4:47:12 PM Subject: bug in repeated group? or in my code? Hi, I am using the latest C++ version of quickfix. Here is the part of the dictionary I used: <message name="MarketDataIncrementalRefresh" msgtype="X" msgcat="app"> <group name="NoMDEntries" required="Y"> <field name="MDUpdateAction" required="Y" /> <field name="MDEntryType" required="Y" /> <field name="MDElementName" required="Y" /> <field name="Symbol" required="Y" /> <field name="CFICode" required="Y" /> <field name="SettlType" required="Y" /> <field name="QuoteCondition" required="N" /> <field name="MDEntryPx" required="N" /> <field name="TradeCondition" required="N" /> <field name="MDEntrySize" required="N" /> <component name="Parties" required="N" /> <field name="PriceTimeStamp" required="N" /> </group> </message> I used the following to traverse the groups: void someFunction(const FIX::message& message) { FIX44::MarketDataIncrementalRefresh::NoMDEntries group; FIX::MDUpdateAction action; FIX::MDEntryType entryType; FIX::MDEntryPx rate; FIX::MDEntrySize size; FIX::QuoteCondition quoteCondition; for(int i = 1; i <= entryCount; i++) { message.getGroup(i, group); group.get(action); if (action.getValue() == FIX::MDUpdateAction_CHANGE) { printf("get entryType\n"); group.get(entryType); bool hasTradeCondition = false; try { printf("get trade condition\n"); group.get(tradeCondition); hasTradeCondition = true; printf("has trade condition\n"); } catch (FIX::FieldNotFound) {} std::string sizeStr; std::string rateStr; printf("get size\n"); group.get(size); printf("get price\n"); group.get(rate); printf("convert\n"); sizeStr = size.getString(); rateStr = rate.getString(); printf("got price\n"); } else { printf("Unexpected update action: %c\n", action.getValue()); } } } When it tries to retrieve the value of field 271 (MDEntrySize), it throws a FIX::FieldNotFound exception. Here is the incoming FIX message: 8=FIX.4.4 9=323 35=X 49=[...] 56=[...] 34=6 52=20090113-23:29:06.725 268=4 279=1 269=1 5450=2 55=USD/JPY 461=RCSXXX 63=0 270=93.06 279=1 269=1 5450=46 55=USD/JPY 461=RCSXXX 63=0 270=93.06 271=2000000 279=1 269=1 5450=54 55=USD/JPY 461=RCSXXX 63=0 270=93.07 271=0 279=1 269=1 5450=52 55=USD/JPY 461=RCSXXX 63=0 270=93.08 271=2000000 10=086 It seems okay to me. I used the log viewer to open the log file, and it doesn't parse the groups correct either. Any idea? Side question: how come I can't catch FIX::FieldNotFound by reference? Thanks in advance. |